Re: [PATCH][next] fs: hpfs: Avoid multiple -Wflex-array-member-not-at-end warnings
From: Al Viro
Date: Wed Feb 05 2025 - 08:03:19 EST
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.