fix compile warning in arch/powerpc/kernel/sysfs.c
PATCH 1/1 fix compile warning in arch/powerpc/kernel/sysfs.c
This fixes the following warning:arch/powerpc/kernel/sysfs.c:388: warning: ignoring return value of 'sysfs_create_group', declared with attribute warn_unused_result
Signed-off-by Michael Neuling <[email protected]>
--- arch/powerpc/kernel/sysfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/powerpc/kernel/sysfs.c +6 -2
@@ -378,14 +378,18 @@ EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr);int cpu_add_sysdev_attr_group (struct attribute_group *attrs) { -int cpu; +int cpu, err;struct sys_device *sysdev;mutex_lock (&cpu_mutex);for_each_possible_cpu (cpu) { sysdev =get_cpu_sysdev (cpu); -sysfs_create_group (&sysdev->kobj, attrs); + err =sysfs_create_group (&sysdev->kobj, attrs); +if (err) { +mutex_unlock (&cpu_mutex); +return err; + } }mutex_unlock (&cpu_mutex);
It seems I missed a long discussion about this warning... Please ignore.
Mikey
Quoted 41 lines · In message <[email protected]> you wrote:
This fixes the following warning:
arch/powerpc/kernel/sysfs.c:388: warning: ignoring return value of 'sysfs_create_group', declared with attributewarn_unused_resultSigned-off-by Michael Neuling <[email protected]>--- arch/powerpc/kernel/sysfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)Index:
linux-2.6-ozlabs/arch/powerpc/kernel/sysfs.c
===================================================================arch/powerpc/kernel/sysfs.c +6
-2@@ -378,14 +378,18 @@ EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr);int cpu_add_sysdev_attr_group (struct attribute_group *attrs) { -int cpu; +int cpu, err;struct sys_device *sysdev;mutex_lock (&cpu_mutex);for_each_possible_cpu (cpu) { sysdev =get_cpu_sysdev (cpu); -sysfs_create_group (&sysdev->kobj, attrs); + err =sysfs_create_group (&sysdev->kobj, attrs); +if (err) { +mutex_unlock (&cpu_mutex); +return err; + } }mutex_unlock (&cpu_mutex);_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev