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]
Message-ID: <5A6840F0.9090201@bfs.de>
Date:   Wed, 24 Jan 2018 09:16:48 +0100
From:   walter harms <wharms@....de>
To:     kernel-janitors@...r.kernel.org
CC:     Christopher Díaz Riveros 
        <chrisadr@...too.org>, sudeep.dutt@...el.com,
        ashutosh.dixit@...el.com, arnd@...db.de,
        gregkh@...uxfoundation.org, viro@...iv.linux.org.uk,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH-next] misc: mic: Use PTR_ERR_OR_ZERO



Am 23.01.2018 21:10, schrieb Christopher Díaz Riveros:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Christopher Díaz Riveros <chrisadr@...too.org>
> ---
>  drivers/misc/mic/scif/scif_epd.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/misc/mic/scif/scif_epd.h b/drivers/misc/mic/scif/scif_epd.h
> index f39b663da287..b2a835665390 100644
> --- a/drivers/misc/mic/scif/scif_epd.h
> +++ b/drivers/misc/mic/scif/scif_epd.h
> @@ -165,9 +165,7 @@ static inline int scif_verify_epd(struct scif_endpt *ep)
>  static inline int scif_anon_inode_getfile(scif_epd_t epd)
>  {
>  	epd->anon = anon_inode_getfile("scif", &scif_anon_fops, NULL, 0);
> -	if (IS_ERR(epd->anon))
> -		return PTR_ERR(epd->anon);
> -	return 0;
> +	return PTR_ERR_OR_ZERO(epd->anon);
>  }
>  

the patch looks ok,
but someone should thing about if it makes sense to have a oneliner as function.
IMHO this will only confuse readers (note: yes, there are reasons in some cases,
but i do not see what applies here if any).

re,
 wh

>  static inline void scif_anon_inode_fput(scif_epd_t epd)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ