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] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 19 Apr 2020 22:17:20 -0700
From:   Bjorn Andersson <bjorn.andersson@...aro.org>
To:     Alex Elder <elder@...aro.org>
Cc:     Mathieu Poirier <mathieu.poirier@...aro.org>, ohad@...ery.com,
        s-anna@...com, Markus.Elfring@....de,
        linux-remoteproc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/7] remoteproc: Restructure firmware name allocation

On Wed 15 Apr 14:23 PDT 2020, Alex Elder wrote:

> On 4/15/20 3:48 PM, Mathieu Poirier wrote:
> > Improve the readability of function rproc_alloc_firmware() by using
> > a non-negated condition.
> > 
> > Suggested-by: Alex Elder <elder@...aro.org>
> > Signed-off-by: Mathieu Poirier <mathieu.poirier@...aro.org>
> 
> If it were me, I'd move the comment above the if statement and
> perhaps reword it a little bit to describe what's happening.
> But no matter, this looks good.
> 

This would also avoid the fact that we have a multiline block without
braces (which isn't needed, but looks odd to me). So that sounds like a
good idea.

Regards,
Bjorn

> Reviewed-by: Alex Elder <elder@...aro.org>
> 
> > ---
> >  drivers/remoteproc/remoteproc_core.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> > index ebaff496ef81..0bfa6998705d 100644
> > --- a/drivers/remoteproc/remoteproc_core.c
> > +++ b/drivers/remoteproc/remoteproc_core.c
> > @@ -1984,14 +1984,14 @@ static int rproc_alloc_firmware(struct rproc *rproc,
> >  {
> >  	const char *p;
> >  
> > -	if (!firmware)
> > +	if (firmware)
> > +		p = kstrdup_const(firmware, GFP_KERNEL);
> > +	else
> >  		/*
> >  		 * If the caller didn't pass in a firmware name then
> >  		 * construct a default name.
> >  		 */
> >  		p = kasprintf(GFP_KERNEL, "rproc-%s-fw", name);
> > -	else
> > -		p = kstrdup_const(firmware, GFP_KERNEL);
> >  
> >  	if (!p)
> >  		return -ENOMEM;
> > 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ