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  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:   Wed, 5 Jun 2019 18:24:06 +0000
From:   "Enrico Weigelt, metux IT consult" <lkml@...ux.net>
To:     Kefeng Wang <wangkefeng.wang@...wei.com>,
        linux-kernel@...r.kernel.org
Cc:     Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org
Subject: Re: [PATCH] block: Drop unlikely before IS_ERR(_OR_NULL)

On 05.06.19 14:24, Kefeng Wang wrote:

> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index b97b479e4f64..1f7127b03490 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -881,7 +881,7 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
>   			blkg_free(new_blkg);
>   		} else {
>   			blkg = blkg_create(pos, q, new_blkg);
> -			if (unlikely(IS_ERR(blkg))) {
> +			if (IS_ERR(blkg)) {
>   				ret = PTR_ERR(blkg);
>   				goto fail_unlock;
>   			}
> 

I think this cocci script should do such things automatically:

virtual patch
virtual context
virtual org
virtual report

@@
expression E;
@@
- unlikely(IS_ERR(E))
+ IS_ERR(E)


Do you already do it this way and have a cocci scrip on the way
to mainline ?


--mtx


-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@...ux.net -- +49-151-27565287

Powered by blists - more mailing lists