Subject: Re: [PATCH v2 2/3] net: thunderbolt: Fix sparse warnings in tbnet_xmit_csum_and_map()

From: Mika Westerberg <[email-masked]>
Date: Wed, 12 Apr 2023 11:03:43 +0300

On Tue, Apr 11, 2023 at 02:37:58PM +0200, Simon Horman wrote:
> On Tue, Apr 11, 2023 at 02:58:21PM +0300, Andy Shevchenko wrote:
> > On Tue, Apr 11, 2023 at 01:50:16PM +0200, Simon Horman wrote:
> > > On Tue, Apr 11, 2023 at 12:10:48PM +0300, Mika Westerberg wrote:
> > > > Fixes the following warning when the driver is built with sparse checks
> > > > enabled:
> > > > 
> > > > main.c:993:23: warning: incorrect type in initializer (different base types)
> > > > main.c:993:23:    expected restricted __wsum [usertype] wsum
> > > > main.c:993:23:    got restricted __be32 [usertype]
> > > > 
> > > > No functional changes intended.
> > > 
> > > This seems nice.
> > > 
> > > After you posted v1 I was wondering if, as a follow-up, it would be worth
> > > creating a helper for this, say cpu_to_wsum(), as I think this pattern
> > > occurs a few times. I'm thinking of a trivial wrapper around cpu_to_be32().
> > 
> > But it looks like it makes sense to have a standalone series for that matter.
> > I.o.w. it doesn't belong to Thunderbolt (only).
> 
> Yes, agreed.
> 
> I was more asking if it is a good idea than for any changes to this patchset.

I think it is a good idea :) I'll add this to my todo list and will do
at some point if nobody else have already done it.