public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: Andi Kleen <ak@suse.de>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Trent Waddington" <trent.waddington@gmail.com>,
	"Bartlomiej Zolnierkiewicz" <bzolnier@gmail.com>,
	"Alan Cox" <alan@lxorguk.ukuu.org.uk>,
	jesper.juhl@gmail.com
Subject: Re: [PATCH][5/5][resend] floppy.c: Fix device_create_file() warning
Date: Mon, 19 Mar 2007 18:42:22 +0100	[thread overview]
Message-ID: <200703191842.24152.jesper.juhl@gmail.com> (raw)
In-Reply-To: <200703191620.00179.ak@suse.de>

On Monday 19 March 2007 16:20:00 Andi Kleen wrote:
> On Monday 19 March 2007 16:16, Jesper Juhl wrote:
> > On 19/03/07, Andi Kleen <ak@suse.de> wrote:
> > > > -            
> > > > 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);
> > >
> > > That change looks pretty useless. Either the error should be handled
> > > correctly by bailing out or the warn_unused_results should be dropped.
> >
> > At least letting the user know that something failed is better than
> > the current situation of just failing silently I'd say.
>
> I don't think so. That's just bloat.
>

Ok, how about one of the following then?  
Personally I'd be ok with either one.


Either this : 

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 577c621..9d543f3 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4302,7 +4302,12 @@ static int __init floppy_init(void)
 		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);
+			goto out_flush_work;
+		}
+
 		/* to be cleaned up... */
 		disks[drive]->private_data = (void *)(long)drive;
 		disks[drive]->queue = floppy_queue;


or this : 


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 577c621..9d543f3 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4302,7 +4302,12 @@ static int __init floppy_init(void)
 		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)
+			goto out_flush_work;
+
 		/* to be cleaned up... */
 		disks[drive]->private_data = (void *)(long)drive;
 		disks[drive]->queue = floppy_queue;


  reply	other threads:[~2007-03-19 17:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 15:11 [PATCH][5/5][resend] floppy.c: Fix device_create_file() warning Jesper Juhl
2007-03-19 15:13 ` Andi Kleen
2007-03-19 15:16   ` Jesper Juhl
2007-03-19 15:20     ` Andi Kleen
2007-03-19 17:42       ` Jesper Juhl [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-03-20  8:32 Mikael Pettersson
2007-03-20  9:24 ` Jesper Juhl
2007-03-21  7:11   ` Dmitriy Monakhov
2007-03-20 11:29 ` Andreas Kleen
2007-03-20 11:56 Mikael Pettersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200703191842.24152.jesper.juhl@gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bzolnier@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trent.waddington@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox