From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Michael Jamet <michael.jamet@intel.com>,
Yehezkel Bernat <YehezkelShB@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [resend, PATCH net-next v1 2/2] net: thunderbolt: Use separate header data type for the Rx
Date: Wed, 30 Nov 2022 13:38:27 +0200 [thread overview]
Message-ID: <Y4dAs4SMb+ZHtJuC@smile.fi.intel.com> (raw)
In-Reply-To: <Y4c6B/mj+g2BCwy9@black.fi.intel.com>
On Wed, Nov 30, 2022 at 01:09:59PM +0200, Mika Westerberg wrote:
> On Wed, Nov 30, 2022 at 12:51:06PM +0200, Andy Shevchenko wrote:
> > On Wed, Nov 30, 2022 at 09:46:16AM +0200, Mika Westerberg wrote:
> > > On Tue, Nov 29, 2022 at 06:13:59PM +0200, Andy Shevchenko wrote:
> > > > The same data type structure is used for bitwise operations and
> > > > regular ones. It makes sparse unhappy, for example:
> > > >
> > > > .../thunderbolt.c:718:23: warning: cast to restricted __le32
> > > >
> > > > .../thunderbolt.c:953:23: warning: incorrect type in initializer (different base types)
> > > > .../thunderbolt.c:953:23: expected restricted __wsum [usertype] wsum
> > > > .../thunderbolt.c:953:23: got restricted __be32 [usertype]
> > > >
> > > > Split the header to bitwise one and specific for Rx to make sparse
> > > > happy. Assure the layout by involving static_assert() against size
> > > > and offsets of the member of the structures.
> >
> > > I would much rather keep the humans reading this happy than add 20+
> > > lines just to silence a tool. Unless this of course is some kind of a
> > > real bug.
> >
> > Actually, changing types to bitwise ones reduces the sparse noise
> > (I will double check this) without reducing readability.
> > Would it be accepted?
>
> Sure if it makes it more readable and does not add too many lines :)
It replaces types u* by __le*, that's it: -4 +4 LoCs.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-11-30 11:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 16:13 [resend, PATCH net-next v1 1/2] net: thunderbolt: Switch from __maybe_unused to pm_sleep_ptr() etc Andy Shevchenko
2022-11-29 16:13 ` [resend, PATCH net-next v1 2/2] net: thunderbolt: Use separate header data type for the Rx Andy Shevchenko
2022-11-30 7:46 ` Mika Westerberg
2022-11-30 10:51 ` Andy Shevchenko
2022-11-30 11:09 ` Mika Westerberg
2022-11-30 11:38 ` Andy Shevchenko [this message]
2022-11-30 7:43 ` [resend, PATCH net-next v1 1/2] net: thunderbolt: Switch from __maybe_unused to pm_sleep_ptr() etc Mika Westerberg
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=Y4dAs4SMb+ZHtJuC@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.jamet@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.