All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Jeff Garzik <jeff@garzik.org>
Cc: Roland McGrath <roland@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] genhd must_check warning fix
Date: Wed, 12 Mar 2008 14:40:26 +1100	[thread overview]
Message-ID: <200803121440.26356.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <47D74D0E.8090308@garzik.org>

On Wednesday 12 March 2008 14:25, Jeff Garzik wrote:
> Roland McGrath wrote:
> > Fixes:
> >
> > 	block/genhd.c:361: warning: ignoring return value of ‘class_register’,
> > declared with attribute warn_unused_result
> >
> > Signed-off-by: Roland McGrath <roland@redhat.com>
> > ---
> >  block/genhd.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/block/genhd.c b/block/genhd.c
> > index c44527d..00da521 100644
> > --- a/block/genhd.c
> > +++ b/block/genhd.c
> > @@ -360,7 +360,9 @@ static struct kobject *base_probe(dev_t devt, int
> > *part, void *data)
> >
> >  static int __init genhd_device_init(void)
> >  {
> > -	class_register(&block_class);
> > +	int error = class_register(&block_class);
> > +	if (unlikely(error))
> > +		return error;
> >  	bdev_map = kobj_map_init(base_probe, &block_class_lock);
> >  	blk_dev_init();
>
> ACK
>
> I was silly and simply tuned out this warning, assuming [wrongly] that
> it was difficult to fix like the fs/partitions.c warning.
>
> Shows how "helpful" those warnings are...

I don't see why? If the warning wasn't there, then Roland probably
wouldn't have noticed. So to me it shows that the warning actually
is helpful (without "") in this case.


  reply	other threads:[~2008-03-12  3:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-12  0:13 [PATCH] genhd must_check warning fix Roland McGrath
2008-03-12  3:25 ` Jeff Garzik
2008-03-12  3:40   ` Nick Piggin [this message]
2008-03-12  3:53     ` Jeff Garzik
2008-03-12  4:07       ` Nick Piggin
2008-03-12 15:05         ` Linus Torvalds

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=200803121440.26356.nickpiggin@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.