[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260113172353.2ae6ef81@kernel.org>
Date: Tue, 13 Jan 2026 17:23:53 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>, "David S.
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo
Abeni <pabeni@...hat.com>, Wen Gu <guwen@...ux.alibaba.com>, Philo Lu
<lulie@...ux.alibaba.com>, Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
Lorenzo Bianconi <lorenzo@...nel.org>, Lukas Bulwahn
<lukas.bulwahn@...hat.com>, Dong Yibo <dong100@...se.com>, Dust Li
<dust.li@...ux.alibaba.com>
Subject: Re: [PATCH net-next v19 2/6] eea: introduce ring and descriptor
structures
On Tue, 13 Jan 2026 09:18:52 +0800 Xuan Zhuo wrote:
> +void ering_irq_unactive(struct eea_ring *ering)
> +{
> + union {
> + u64 data;
> + struct eea_db db;
> + } val;
> +
> + if (ering->mask == EEA_IRQ_MASK)
> + return;
> +
> + ering->mask = EEA_IRQ_MASK;
> +
> + val.db.kick_flags = EEA_IRQ_MASK;
> +
> + writeq(val.data, (void __iomem *)ering->db);
> +}
AI code review points out that this is writing out a partially
initialized structure. You're only setting kick_flags, so 1byte
and the other 7 bytes are whatever was there before on the stack.
This needs to be fixed.
In general we recommend using FIELD_PREP()-family of macros to encode
bitfields.
--
pw-bot: cr
Powered by blists - more mailing lists