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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Aug 2020 08:07:17 -0700
From:   Joe Perches <joe@...ches.com>
To:     Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc:     linuxarm@...wei.com, mauro.chehab@...wei.com,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org
Subject: Re: [PATCH 35/44] staging: regulator: hi6421v600-regulator: add a
 driver-specific debug macro

On Thu, 2020-08-13 at 12:10 +0200, Mauro Carvalho Chehab wrote:
> Em Wed, 12 Aug 2020 09:10:29 -0700
> Joe Perches <joe@...ches.com> escreveu:
> 
> > On Wed, 2020-08-12 at 17:56 +0200, Mauro Carvalho Chehab wrote:
> > > Using dev_dbg() is not too nice, as, instead of printing the
> > > name of the regulator, it prints "regulator.<number>", making
> > > harder to associate what is happening with each ldo line.
> > > 
> > > So, add a debug-specific macro, which will print the rdev's
> > > name, just like the regulator core.  
> > 
> > Seems sensible, but trivially:
> > 
> > > diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421v600-regulator.c  
> > []
> > > @@ -209,10 +212,10 @@ static unsigned int hi6421_spmi_regulator_get_optimum_mode(struct regulator_dev
> > >  	struct hi6421v600_regulator *sreg = rdev_get_drvdata(rdev);
> > >  
> > >  	if (load_uA || ((unsigned int)load_uA > sreg->eco_uA)) {
> > > -		dev_dbg(&rdev->dev, "%s: normal mode", __func__);
> > > +		rdev_dbg(rdev, "normal mode");
> > >  		return REGULATOR_MODE_NORMAL;
> > >  	} else {
> > > -		dev_dbg(&rdev->dev, "%s: idle mode", __func__);
> > > +		rdev_dbg(rdev, "idle mode");  
> > 
> > missing terminating newlines
> 
> As per request from Jonathan, I ended dropping those rdev_dbg()
> on a followup patch.
> 
> Btw, after this changeset:
> 
> 	commit 563873318d328d9bbab4b00dfd835ac7c7e28697
> 	Merge: 24532f768121 bfd8d3f23b51
> 	Author: Linus Torvalds <torvalds@...ux-foundation.org>
> 	Date:   Mon Oct 10 09:29:50 2016 -0700
> 
> 	    Merge branch 'printk-cleanups'
>     
> 	    Merge my system logging cleanups, triggered by the broken '\n' patches.
> 
> the printk lib will add a line feed if a "\n" is missing. I had
> to get rid of pr_cont() & friends on that time on media, due to that. 

I know.

Message formats should still end in a newline.

Any other subsystem could use a pr_cont and that
could be added to any line without a terminating
newline.

Also any line without a newline will not be emitted
until another message is emitted.


Powered by blists - more mailing lists