[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87jz18cje2.fsf@nvidia.com>
Date: Mon, 6 Oct 2025 13:59:50 +0200
From: Petr Machata <petrm@...dia.com>
To: Phil Sutter <phil@....cc>
CC: Jakub Kicinski <kuba@...nel.org>, <davem@...emloft.net>,
<netdev@...r.kernel.org>, <edumazet@...gle.com>, <pabeni@...hat.com>,
<andrew+netdev@...n.ch>, <horms@...nel.org>, <shuah@...nel.org>,
<jv@...sburgh.net>, <olteanv@...il.com>, <jiri@...nulli.us>,
<mst@...hat.com>, <jasowang@...hat.com>, <xuanzhuo@...ux.alibaba.com>,
<eperezma@...hat.com>, <kuniyu@...gle.com>, <matttbe@...nel.org>,
<martineau@...nel.org>, <pablo@...filter.org>, <kadlec@...filter.org>,
<fw@...len.de>, <antonio@...nvpn.net>, <allison.henderson@...cle.com>,
<petrm@...dia.com>, <razor@...ckwall.org>, <idosch@...dia.com>,
<linux-kselftest@...r.kernel.org>, <mptcp@...ts.linux.dev>,
<netfilter-devel@...r.kernel.org>, <coreteam@...filter.org>
Subject: Re: [PATCH net] selftests: net: unify the Makefile formats
Phil Sutter <phil@....cc> writes:
>> diff --git a/tools/testing/selftests/drivers/net/netdevsim/Makefile b/tools/testing/selftests/drivers/net/netdevsim/Makefile
>> index 07b7c46d3311..daf51113c827 100644
>> --- a/tools/testing/selftests/drivers/net/netdevsim/Makefile
>> +++ b/tools/testing/selftests/drivers/net/netdevsim/Makefile
>> @@ -1,6 +1,7 @@
>> # SPDX-License-Identifier: GPL-2.0+ OR MIT
>>
>> -TEST_PROGS = devlink.sh \
>> +TEST_PROGS := \
>
> Maybe irrelevant, but assignment type changes should be avoided IMO
> (there are more cases like this one).
AFAIK, = vs := differ in when the assigned-to variable is evaluated.
Variables assigned-to with := are evaluated at the time of definition, =
at the time of use. This can make difference if the variable definition
contains other expansions.
I do not think this patch touches variables where this distinction
matters, as most of it is fixed strings. There's an occasional patsubst
etc., but those ought to lead to the same results regardless of
expansion time. So IMHO we can freely use either.
In theory someone could use something like `TEST_PROGS = $(OTHER_PROGS)
foo.sh bar.sh' and then override OTHER_PROGS based on the target, or
reassign it at a later point. Personally I'd much much rather see an
explicit if-else prior to TEST_PROGS, and then an immediate expansion. I
think that makes things easier to reason about and debug. So my
preference would actually be to use := as the default.
Powered by blists - more mailing lists