Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek...
[linux-2.6-block.git] / drivers / base / core.c
index 409298942d5afcaaa20165c376a776de409b7f7e..b2261f92f2f1c1356b8e2f78e915cce9efff36ba 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * drivers/base/core.c - core driver model code (device registration, etc)
  *
@@ -5,9 +6,6 @@
  * Copyright (c) 2002-3 Open Source Development Labs
  * Copyright (c) 2006 Greg Kroah-Hartman <gregkh@suse.de>
  * Copyright (c) 2006 Novell, Inc.
- *
- * This file is released under the GPLv2
- *
  */
 
 #include <linux/device.h>
@@ -2115,7 +2113,7 @@ int device_for_each_child(struct device *parent, void *data,
                return 0;
 
        klist_iter_init(&parent->p->klist_children, &i);
-       while ((child = next_device(&i)) && !error)
+       while (!error && (child = next_device(&i)))
                error = fn(child, data);
        klist_iter_exit(&i);
        return error;