LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH][5/5] floppy.c: Fix device_create_file() warning
@ 2007-02-05 23:30 Jesper Juhl
  2007-02-06  5:59 ` Gene Heskett
  0 siblings, 1 reply; 4+ messages in thread
From: Jesper Juhl @ 2007-02-05 23:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andi Kleen, Trent Waddington, Bartlomiej Zolnierkiewicz,
	Alan Cox, Linus Torvalds, Jesper Juhl


This fixes the warning 
  warning: ignoring return value of `device_create_file', declared with attribute warn_unused_result
in function `floppy_init'. It does this by checking the return value and 
printing a warning message in case of no success.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 floppy.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- linux-2.6.20/drivers/block/floppy.c.patch4	2007-02-05 23:22:26.000000000 +0100
+++ linux-2.6.20/drivers/block/floppy.c	2007-02-05 23:32:42.000000000 +0100
@@ -4302,7 +4302,12 @@
 		if (err)
 			goto out_flush_work;
 
-		device_create_file(&floppy_device[drive].dev,&dev_attr_cmos);
+		err = device_create_file(&floppy_device[drive].dev, &dev_attr_cmos);
+		if (err)
+			printk(KERN_WARNING "Unable to create sysfs attribute "
+				"file for floppy device: %s\n", 
+				floppy_device[drive].name);
+
 		/* to be cleaned up... */
 		disks[drive]->private_data = (void *)(long)drive;
 		disks[drive]->queue = floppy_queue;




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-02-06 16:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-05 23:30 [PATCH][5/5] floppy.c: Fix device_create_file() warning Jesper Juhl
2007-02-06  5:59 ` Gene Heskett
2007-02-06  6:32   ` H. Peter Anvin
2007-02-06 16:15     ` Gene Heskett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).