[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250205130308.GC1977892@ZenIV>
Date: Wed, 5 Feb 2025 13:03:08 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Mikulas Patocka <mikulas@...ax.karlin.mff.cuni.cz>,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH][next] fs: hpfs: Avoid multiple
-Wflex-array-member-not-at-end warnings
On Tue, Feb 04, 2025 at 02:13:37PM +1030, Gustavo A. R. Silva wrote:
> +#define anode_btree container_of(&anode->btree, struct bplus_header, __hdr)
> +#define ranode_btree container_of(&ranode->btree, struct bplus_header, __hdr)
> +#define fnode_btree container_of(&fnode->btree, struct bplus_header, __hdr)
> +
> /* Find a sector in allocation tree */
>
> secno hpfs_bplus_lookup(struct super_block *s, struct inode *inode,
> @@ -27,7 +31,7 @@ secno hpfs_bplus_lookup(struct super_block *s, struct inode *inode,
> a = le32_to_cpu(btree->u.internal[i].down);
> brelse(bh);
> if (!(anode = hpfs_map_anode(s, a, &bh))) return -1;
> - btree = &anode->btree;
> + btree = anode_btree;
Just for this - NAK. And then you proceed to add dozens more of the same.
If it looks like a variable name, it must not turn out to be a bloody macro;
if a macro expansion depends upon a local variable with given name existing
in scope of its use, make that name an explicit argument. You manage to
violate both.
Powered by blists - more mailing lists