[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z8bq6XJGJNbycmJ9@smile.fi.intel.com>
Date: Tue, 4 Mar 2025 13:58:33 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Paolo Abeni <pabeni@...hat.com>, Christoph Hellwig <hch@....de>,
Marek Szyprowski <m.szyprowski@...sung.com>
Cc: Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Rasesh Mody <rmody@...vell.com>,
GR-Linux-NIC-Dev@...vell.com, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net v1 1/1] bnx2: Fix unused data compilation warning
+ Marek/Christoph (for the clarification/commenting on the below)
On Tue, Mar 04, 2025 at 12:39:40PM +0100, Paolo Abeni wrote:
> On 3/4/25 11:56 AM, Andy Shevchenko wrote:
> > On Mon, Mar 03, 2025 at 05:21:14PM -0800, Jakub Kicinski wrote:
> >> On Fri, 28 Feb 2025 12:05:37 +0200 Andy Shevchenko wrote:
> >>> In some configuration, compilation raises warnings related to unused
> >>> data. Indeed, depending on configuration, those data can be unused.
> >>>
> >>> Mark those data as __maybe_unused to avoid compilation warnings.
> >>
> >> Will making dma_unmap_addr access the first argument instead of
> >> pre-processing down to nothing not work?
> >
> > I looked at the implementation of those macros and I have no clue
> > how to do that in a least intrusive way. Otherwise it sounds to me
> > quite far from the scope of the small compilation error fix that
> > I presented here.
> I *think* Jakub is suggesting something alike:
I see. Perhpas we need Marek's/Christoph's opinion on this...
> ---
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index b79925b1c433..927884f10b0f 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -629,7 +629,7 @@ static inline int dma_mmap_wc(struct device *dev,
> #else
> #define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)
> #define DEFINE_DMA_UNMAP_LEN(LEN_NAME)
> -#define dma_unmap_addr(PTR, ADDR_NAME) (0)
> +#define dma_unmap_addr(PTR, ADDR_NAME) (((PTR)->ADDR_NAME), 0)
> #define dma_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
> #define dma_unmap_len(PTR, LEN_NAME) (0)
> #define dma_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
> ---
>
> Would that work?
I do not know. Not my area of expertise.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists