lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120911115716.GI18907@arwen.pp.htv.fi>
Date:	Tue, 11 Sep 2012 14:57:19 +0300
From:	Felipe Balbi <balbi@...com>
To:	Jingoo Han <jg1.han@...sung.com>
Cc:	'Ryan Mallon' <rmallon@...il.com>, balbi@...com,
	'Grant Likely' <grant.likely@...retlab.ca>,
	'Linus Walleij' <linus.walleij@...aro.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpio: samsung: use pr_* instead of printk

On Tue, Sep 11, 2012 at 04:02:59PM +0900, Jingoo Han wrote:
> On Tuesday, September 11, 2012 3:48 PM Ryan Mallon wrote
> > 
> > On 11/09/12 16:39, Jingoo Han wrote:
> > > On Tuesday, September 11, 2012 3:31 PM Felipe Balbi wrote
> > >
> > >>
> > >> Hi,
> > >>
> > >> On Mon, Sep 10, 2012 at 08:59:11PM +0900, Jingoo Han wrote:
> > >>> This patch uses pr_* instead of printk.
> > >>>
> > >>> Signed-off-by: Jingoo Han <jg1.han@...sung.com>
> > >>> ---
> > >>>  drivers/gpio/gpio-samsung.c |    6 +++---
> > >>>  1 files changed, 3 insertions(+), 3 deletions(-)
> > >>>
> > >>> diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
> > >>> index ba126cc..e38d990 100644
> > >>> --- a/drivers/gpio/gpio-samsung.c
> > >>> +++ b/drivers/gpio/gpio-samsung.c
> > >>> @@ -45,7 +45,7 @@
> > >>>  #ifndef DEBUG_GPIO
> > >>>  #define gpio_dbg(x...) do { } while (0)
> > >>>  #else
> > >>> -#define gpio_dbg(x...) printk(KERN_DEBUG x)
> > >>> +#define gpio_dbg(x...) pr_debug(x)
> > >>>  #endif
> > >>>
> > >>>  int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip,
> > >>> @@ -926,10 +926,10 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
> > >>>  #ifdef CONFIG_PM
> > >>>  	if (chip->pm != NULL) {
> > >>>  		if (!chip->pm->save || !chip->pm->resume)
> > >>> -			printk(KERN_ERR "gpio: %s has missing PM functions\n",
> > >>> +			pr_err("gpio: %s has missing PM functions\n",
> > >>>  			       gc->label);
> > >>
> > >> I would rather see dev_* conversion instead.
> > >>
> > >> my 2 cents
> > >
> > > Hi Felipe Balbi,
> > >
> > > OK, I will replace printk(KERN_ERR...) with dev_err.
> > > Thank you.
> > 
> > I was going to suggest that also, but I don't think that there is a dev
> > pointer to use. The gpio_chip structure has an optional one, but from my
> > quick glance it didn't look like the Samsung driver was using it. I
> > could be wrong though. If I am, go with dev_err (and dev_dbg for
> > replacing the gpio_dbg statements).
> 
> Also, I cannot find dev point to use.
> I will use pr_dbg, pr_err.

Now that I look at the driver, the missing dev pointer is just because
gpio-samsung.c is NOT a proper driver. I'd strongly suggest to convert
the driver to a proper platform_driver, but it's your call anyway ;-)

my 2 cents

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ