From: Greg KH <greg@kroah.com>
To: Jim Cromie <jim.cromie@gmail.com>, Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org, rpjday@crashcourse.ca
Subject: Re: [PATCH] fix bogus use of rc = alloc_chrdev_region()
Date: Fri, 10 Jun 2011 13:44:03 -0700 [thread overview]
Message-ID: <20110610204403.GA13450@kroah.com> (raw)
In-Reply-To: <BANLkTi=8bv54-Z=xCyqUhFAnxM5G40k2WQ@mail.gmail.com>
On Fri, Jun 10, 2011 at 02:29:42PM -0600, Jim Cromie wrote:
> can someone pick this up,
> for this release or next ?
It was rumored that Arnd wanted to take over drivers/char/.
Arnd?
>
> On Thu, Jun 2, 2011 at 11:38 PM, Jim Cromie <jim.cromie@gmail.com> wrote:
> > Robert P.J. Day noticed a bogus assignment: major = rc, after
> > the call to alloc_chrdev_region() in pc8736x_gpio_init().
> >
> > The code as written expects return-code behavior as for
> > register_chrdev(), ie on success: rc = reserved-major when
> > requested-major = 0. But for alloc_chrdev_region(), this isnt the
> > case. Since its used for debug printing only, just excise the mess.
> >
> > Signed-of-by: Jim Cromie <jim.cromie@gmail.com>
> > Reported-by: Robert P.J. Day <rpjday@crashcourse.ca>
> > cc: Greg KH <greg@kroah.com.
> > Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
> > ---
> > drivers/char/pc8736x_gpio.c | 5 +----
> > 1 files changed, 1 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c
> > index b304ec0..30d92fe 100644
> > --- a/drivers/char/pc8736x_gpio.c
> > +++ b/drivers/char/pc8736x_gpio.c
> > @@ -314,10 +314,7 @@ static int __init pc8736x_gpio_init(void)
> > dev_err(&pdev->dev, "register-chrdev failed: %d\n", rc);
> > goto undo_request_region;
> > }
> > - if (!major) {
> > - major = rc;
> > - dev_dbg(&pdev->dev, "got dynamic major %d\n", major);
> > - }
> > + dev_dbg(&pdev->dev, "using chardev major %d\n", major);
> >
> > pc8736x_init_shadow();
> >
> > --
> > 1.7.4.2
> >
> >
next prev parent reply other threads:[~2011-06-10 21:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1307079502-6326-1-git-send-email-jim.cromie@gmail.com>
2011-06-10 20:29 ` [PATCH] fix bogus use of rc = alloc_chrdev_region() Jim Cromie
2011-06-10 20:44 ` Greg KH [this message]
2011-06-14 14:07 ` Arnd Bergmann
2011-06-14 16:23 ` Grant Likely
2011-06-14 18:17 ` Arnd Bergmann
2011-06-14 18:23 ` Jim Cromie
2011-06-14 19:19 ` Grant Likely
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=20110610204403.GA13450@kroah.com \
--to=greg@kroah.com \
--cc=arnd@arndb.de \
--cc=jim.cromie@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpjday@crashcourse.ca \
/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