Re: [PATCH net-next v2 6/9] ice: use <linux/packing.h> for Tx and Rx queue context data
From: Dan Carpenter
Date: Thu Oct 31 2024 - 03:46:26 EST
On Wed, Oct 30, 2024 at 01:34:47PM -0700, Jacob Keller wrote:
>
>
> On 10/30/2024 4:19 AM, Dan Carpenter wrote:
> > Always just ignore the tool when it if it's not useful.
> >
> > CHECK_PACKED_FIELDS_ macros are just build time asserts, right? I can easily
> > just hard code Smatch to ignore CHECK_PACKED_FIELDS_* macros. I'm just going to
> > go ahead an do that in the ugliest way possible. If we have a lot of these then
> > I'll do it properly.
> >
>
> We have 2 for ice, and likely a handful for some of the drivers Vladimir
> is working on. More may happen in the future, but the number is likely
> to unlikely to grow quickly.
>
> I was thinking of making them empty definitions if __CHECKER__, but
> ignoring them in smatch would be easier on my end :D
>
Adding them to __CHECKER__ works too.
> > regards,
> > dan carpenter
> >
> Looking at how smatch works, it actually seems like we could implement
> the desired sanity checks in smatch, though I wasn't quite able to
> figure out how to hook into struct/array assignments to do that yet.
I'd do it the way you have. It's better to be close to the code. It's way
harder in Smatch and it's not like you need flow analysis.
regards,
dan carpenter