public inbox for cocci@systeme.lip6.fr
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: Philipp Hahn <phahn-oss@avm.de>
Cc: cocci@inria.fr, linux-fsdevel@vger.kernel.org,
	v9fs@lists.linux.dev, Eric Van Hensbergen <ericvh@kernel.org>,
	Latchesar Ionkov <lucho@ionkov.net>,
	Christian Schoenebeck <linux_oss@crudebyte.com>
Subject: Re: [cocci] [PATCH 06/61] 9p: Prefer IS_ERR_OR_NULL over manual NULL check
Date: Wed, 11 Mar 2026 17:29:36 +0900	[thread overview]
Message-ID: <abEn8GjSxsVD3D7j@codewreck.org> (raw)
In-Reply-To: <20260310-b4-is_err_or_null-v1-6-bd63b656022d@avm.de>

-most lists...
Hopefully anyone who might care about 9p is on fsdevel.

I second whoever it was who said this should be split and not send all
the patches to everyone...

Philipp Hahn wrote on Tue, Mar 10, 2026 at 12:48:32PM +0100:
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
> 
> Change generated with coccinelle.
> 
> To: Eric Van Hensbergen <ericvh@kernel.org>
> To: Latchesar Ionkov <lucho@ionkov.net>
> To: Dominique Martinet <asmadeus@codewreck.org>
> To: Christian Schoenebeck <linux_oss@crudebyte.com>
> Cc: v9fs@lists.linux.dev
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
>  fs/9p/fid.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/9p/fid.h b/fs/9p/fid.h
> index 0d6138bee2a3d1ab565ab2d210c0a3f3bf97e4e3..3bb7ef4380e972a2d9ab67eb4aab6cc5bfe2eea7 100644
> --- a/fs/9p/fid.h
> +++ b/fs/9p/fid.h
> @@ -27,7 +27,7 @@ static inline struct p9_fid *v9fs_fid_clone(struct dentry *dentry)
>  	struct p9_fid *fid, *nfid;
>  
>  	fid = v9fs_fid_lookup(dentry);
> -	if (!fid || IS_ERR(fid))
> +	if (IS_ERR_OR_NULL(fid))

FWIW v9fs_fid_lookup cannot return NULL -- and all its other callers
only check for IS_ERR() so if there is a corner case that does return
NULL then we have another problem -- so please drop the !fid check
instead.

(not that it matters much... But might as well do it right)

-- 
Dominique Martinet | Asmadeus

  parent reply	other threads:[~2026-03-11  9:46 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260310-b4-is_err_or_null-v1-0-bd63b656022d@avm.de>
     [not found] ` <20260310-b4-is_err_or_null-v1-37-bd63b656022d@avm.de>
2026-03-10 12:08   ` [cocci] [PATCH 37/61] drm: Prefer IS_ERR_OR_NULL over manual NULL check Christian König
     [not found] ` <20260310-b4-is_err_or_null-v1-61-bd63b656022d@avm.de>
2026-03-10 12:23   ` [cocci] [PATCH 61/61] file: Drop unlikely() around IS_ERR_OR_NULL() Jeff Layton
     [not found] ` <20260310-b4-is_err_or_null-v1-30-bd63b656022d@avm.de>
2026-03-10 12:23   ` [cocci] [PATCH 30/61] net/sunrpc: Prefer IS_ERR_OR_NULL over manual NULL check Jeff Layton
2026-03-10 13:23   ` Chuck Lever
2026-03-11  9:22   ` [cocci] [Intel-wired-lan] " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-18-bd63b656022d@avm.de>
2026-03-10 12:28   ` [cocci] [PATCH 18/61] sound: " Mark Brown
     [not found] ` <20260310-b4-is_err_or_null-v1-57-bd63b656022d@avm.de>
2026-03-10 12:43   ` [cocci] [PATCH 57/61] reset: " Philipp Zabel
2026-03-11  4:59   ` Masami Hiramatsu
     [not found] ` <20260310-b4-is_err_or_null-v1-56-bd63b656022d@avm.de>
2026-03-10 13:21   ` [cocci] [PATCH 56/61] clk: " Brian Masney
2026-03-11  2:07   ` Chen-Yu Tsai
     [not found] ` <20260310-b4-is_err_or_null-v1-24-bd63b656022d@avm.de>
2026-03-10 13:47   ` [cocci] [PATCH 24/61] net/9p: " Christian Schoenebeck
2026-03-11  9:19   ` [cocci] [Intel-wired-lan] " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-15-bd63b656022d@avm.de>
2026-03-10 14:07   ` [cocci] [PATCH 15/61] trace: " Steven Rostedt
2026-03-11  5:13     ` Masami Hiramatsu
2026-03-11 14:03       ` Steven Rostedt
2026-03-11 14:06         ` Geert Uytterhoeven
2026-03-10 14:14 ` [cocci] [PATCH 00/61] treewide: Use IS_ERR_OR_NULL over manual NULL check - refactor Steven Rostedt
2026-03-10 14:23 ` Theodore Tso
     [not found] ` <20260310-b4-is_err_or_null-v1-3-bd63b656022d@avm.de>
2026-03-10 18:13   ` [cocci] [PATCH 03/61] ceph: Prefer IS_ERR_OR_NULL over manual NULL check Viacheslav Dubeyko
2026-03-11  8:16   ` [cocci] [Intel-wired-lan] " Loktionov, Aleksandr
2026-03-10 18:40 ` [cocci] [PATCH 00/61] treewide: Use IS_ERR_OR_NULL over manual NULL check - refactor Kuan-Wei Chiu
2026-03-12 12:57   ` Jason Gunthorpe
2026-03-12 15:32     ` James Bottomley
2026-03-12 16:54       ` Jason Gunthorpe
2026-03-11  0:09 ` Russell King (Oracle)
     [not found] ` <20260310-b4-is_err_or_null-v1-38-bd63b656022d@avm.de>
2026-03-10 15:07   ` [cocci] [EXTERNAL] [PATCH 38/61] net: Prefer IS_ERR_OR_NULL over manual NULL check Elad Nachman
2026-03-11  0:16   ` [cocci] " Russell King (Oracle)
2026-03-11  9:24   ` [cocci] [Intel-wired-lan] " Loktionov, Aleksandr
2026-03-12 16:11   ` [cocci] " Przemek Kitszel
     [not found] ` <20260310-b4-is_err_or_null-v1-6-bd63b656022d@avm.de>
2026-03-10 13:45   ` [cocci] [PATCH 06/61] 9p: " Christian Schoenebeck
2026-03-11  8:17   ` [cocci] [Intel-wired-lan] " Loktionov, Aleksandr
2026-03-11  8:29   ` Dominique Martinet [this message]
     [not found] ` <20260310-b4-is_err_or_null-v1-8-bd63b656022d@avm.de>
2026-03-11  8:18   ` [cocci] [Intel-wired-lan] [PATCH 08/61] fuse: " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-13-bd63b656022d@avm.de>
2026-03-11  8:19   ` [cocci] [Intel-wired-lan] [PATCH 13/61] squashfs: " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-16-bd63b656022d@avm.de>
2026-03-11  9:16   ` [cocci] [Intel-wired-lan] [PATCH 16/61] sched: " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-17-bd63b656022d@avm.de>
2026-03-10 14:45   ` [cocci] [PATCH 17/61] module: " Aaron Tomlin
2026-03-11  9:18   ` [cocci] [Intel-wired-lan] " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-22-bd63b656022d@avm.de>
2026-03-11  9:19   ` [cocci] [Intel-wired-lan] [PATCH 22/61] md: " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-25-bd63b656022d@avm.de>
2026-03-10 13:55   ` [cocci] [PATCH 25/61] net/bluetooth: " Bastien Nocera
2026-03-11  9:21   ` [cocci] [Intel-wired-lan] " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-28-bd63b656022d@avm.de>
2026-03-11  9:22   ` [cocci] [Intel-wired-lan] [PATCH 28/61] net/sched: " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-39-bd63b656022d@avm.de>
2026-03-11  9:24   ` [cocci] [Intel-wired-lan] [PATCH 39/61] irqchip: " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-46-bd63b656022d@avm.de>
2026-03-10 12:53   ` [cocci] [PATCH 46/61] vfio: " Pranjal Shrivastava
2026-03-11  9:25   ` [cocci] [Intel-wired-lan] " Loktionov, Aleksandr
2026-03-16 22:10   ` [cocci] " Alex Williamson
     [not found] ` <20260310-b4-is_err_or_null-v1-49-bd63b656022d@avm.de>
2026-03-11  9:25   ` [cocci] [Intel-wired-lan] [PATCH 49/61] media: " Loktionov, Aleksandr
2026-03-11 23:03   ` [cocci] " Kieran Bingham
     [not found] ` <20260310-b4-is_err_or_null-v1-54-bd63b656022d@avm.de>
2026-03-11  9:26   ` [cocci] [Intel-wired-lan] [PATCH 54/61] aoe: " Loktionov, Aleksandr
     [not found] ` <20260310-b4-is_err_or_null-v1-41-bd63b656022d@avm.de>
2026-03-11  9:32   ` [cocci] [PATCH 41/61] pinctrl: " Linus Walleij
     [not found] ` <20260310-b4-is_err_or_null-v1-36-bd63b656022d@avm.de>
2026-03-11 13:15   ` [cocci] [PATCH 36/61] arch/sh: " Geert Uytterhoeven
     [not found] ` <20260310-b4-is_err_or_null-v1-48-bd63b656022d@avm.de>
2026-03-12 19:33   ` [cocci] [PATCH 48/61] mtd: " Richard Weinberger
     [not found] ` <20260310-b4-is_err_or_null-v1-2-bd63b656022d@avm.de>
2026-03-13 19:22   ` [cocci] [PATCH 02/61] btrfs: " David Sterba
     [not found] ` <20260310-b4-is_err_or_null-v1-50-bd63b656022d@avm.de>
2026-03-11  9:26   ` [cocci] [Intel-wired-lan] [PATCH 50/61] iommu: " Loktionov, Aleksandr
2026-03-16 13:30   ` [cocci] " Robin Murphy
     [not found] ` <20260310-b4-is_err_or_null-v1-12-bd63b656022d@avm.de>
2026-03-11  8:19   ` [cocci] [Intel-wired-lan] [PATCH 12/61] quota: " Loktionov, Aleksandr
2026-03-19 14:13   ` [cocci] " Jan Kara
2026-04-09 18:16 ` [cocci] [PATCH 00/61] treewide: Use IS_ERR_OR_NULL over manual NULL check - refactor Al Viro

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=abEn8GjSxsVD3D7j@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=cocci@inria.fr \
    --cc=ericvh@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=phahn-oss@avm.de \
    --cc=v9fs@lists.linux.dev \
    /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