mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Enrico Weigelt, metux IT consult" <lkml@metux.net>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	linux-kernel@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Pravin B Shelar <pshelar@ovn.org>,
	Anton Altaparmakov <anton@tuxera.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] block: Drop unlikely before IS_ERR(_OR_NULL)
Date: Wed, 05 Jun 2019 11:32:14 -0700	[thread overview]
Message-ID: <44c945bf0573842fe9b2db89407e40c88fcc7eb4.camel@perches.com> (raw)
In-Reply-To: <8221bc17-b0bb-da6f-4343-3e73467252d5@metux.net>

On Wed, 2019-06-05 at 18:24 +0000, Enrico Weigelt, metux IT consult
wrote:
> 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)

Likely change all of these too:

$ git grep -P '\blikely.*IS_ERR'
drivers/net/vxlan.c:    if (likely(!IS_ERR(rt))) {
fs/ntfs/lcnalloc.c:     if (likely(page && !IS_ERR(page))) {
fs/ntfs/mft.c:  if (likely(!IS_ERR(page))) {
fs/ntfs/mft.c:  if (likely(!IS_ERR(m)))
fs/ntfs/mft.c:          if (likely(!IS_ERR(m))) {
fs/ntfs/mft.c:          if (likely(!IS_ERR(rl2)))
fs/ntfs/namei.c:                if (likely(!IS_ERR(dent_inode))) {
fs/ntfs/runlist.c:      if (likely(!IS_ERR(old_rl)))
net/openvswitch/datapath.c:             if (likely(!IS_ERR(reply))) {
net/socket.c:   if (likely(!IS_ERR(newfile))) {



  reply	other threads:[~2019-06-05 18:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 14:24 [PATCH] fs: gfs2: Use IS_ERR_OR_NULL Kefeng Wang
2019-06-05 14:24 ` [PATCH] fs: cifs: Drop unlikely before IS_ERR(_OR_NULL) Kefeng Wang
2019-06-05 14:24 ` [PATCH net-next] net: " Kefeng Wang
2019-06-05 16:13   ` Jesse Brandeburg
2019-06-06  1:39     ` Kefeng Wang
2019-06-06 20:41       ` Enrico Weigelt, metux IT consult
2019-06-05 16:40   ` Neil Horman
2019-06-05 14:24 ` [PATCH] block: " Kefeng Wang
2019-06-05 14:22   ` Jens Axboe
2019-06-05 18:24   ` Enrico Weigelt, metux IT consult
2019-06-05 18:32     ` Joe Perches [this message]
2019-06-05 20:55       ` Enrico Weigelt, metux IT consult
2019-06-05 14:24 ` [PATCH] Input: alps: " Kefeng Wang
2019-06-05 14:42   ` Pali Rohár
2019-06-06  1:08     ` Kefeng Wang
2019-06-06  2:28       ` Joe Perches
2019-06-12  0:59         ` Dmitry Torokhov
2019-06-12  7:14           ` Pali Rohár
2019-06-12  8:35             ` Joe Perches
2019-06-11 16:23 ` [PATCH] fs: gfs2: Use IS_ERR_OR_NULL Andreas Gruenbacher
2019-06-12  1:07   ` Kefeng Wang
2019-06-12  1:17   ` [PATCH v2] " Kefeng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44c945bf0573842fe9b2db89407e40c88fcc7eb4.camel@perches.com \
    --to=joe@perches.com \
    --cc=anton@tuxera.com \
    --cc=axboe@kernel.dk \
    --cc=davem@davemloft.net \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@metux.net \
    --cc=pshelar@ovn.org \
    --cc=wangkefeng.wang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®