Skip to contentSkip to conversation

Remove __must_check for device_for_each_child()

PATCH New Russell King 1 participant 1 message Oct 22, 2006 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove __must_check for device_for_each_child()

Eliminate more __must_check madness.

The return code from device_for_each_child() depends on the values which the helper function returns. If the helper function always returns zero, it's utterly pointless to check the return code from device_for_each_child().

The only code which knows if the return value should be checked is the caller itself, so forcing the return code to always be checked is silly. Hence, remove the __must_check annotation.

include/linux/device.h +1 -1
index 662e6a1..9d4f6a9 100644
@@ -393,7 +393,7 @@ extern void device_unregister(struct dev
 extern void device_initialize(struct device * dev);
 extern int __must_check device_add(struct device * dev);
 extern void device_del(struct device * dev);
-extern int __must_check device_for_each_child(struct device *, void *,
+extern int device_for_each_child(struct device *, void *,
 		     int (*fn)(struct device *, void *));
 extern int device_rename(struct device *dev, char *new_name);
 
Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core