[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5913bf70-de74-4915-9ba1-9cd92dde6945@redhat.com>
Date: Thu, 27 Feb 2025 15:39:52 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Peter Seiderer <ps.report@....net>
Cc: Arnd Bergmann <arnd@...nel.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Arnd Bergmann <arnd@...db.de>, Simon Horman <horms@...nel.org>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pktgen: avoid unused-const-variable warning
On 2/27/25 3:21 PM, Peter Seiderer wrote:
> On Thu, 27 Feb 2025 12:35:45 +0100, Paolo Abeni <pabeni@...hat.com> wrote:
>> I think the unused define is preferable; I think pre-processor defines
>> are cheaper than static const.
>
> In which regards cheaper (out of interest)?
>
> Both (with and without static) produce the same code see e.g.
>
> https://godbolt.org/z/Tsr1jM45r
> https://godbolt.org/z/6sr1o8da3
I must admit I was unsure the compiler would always optimize out the
constant.
I guess the macro could still produce shorter build time (by a few clock
cycles, nothing measurable ;), so in the end it boils down again to a
personal preference.
Cheers,
Paolo
Powered by blists - more mailing lists