[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200824.161346.1009201417411312987.davem@davemloft.net>
Date: Mon, 24 Aug 2020 16:13:46 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: natechancellor@...il.com
Cc: olteanv@...il.com, andrew@...n.ch, vivien.didelot@...il.com,
f.fainelli@...il.com, kuba@...nel.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
clang-built-linux@...glegroups.com
Subject: Re: [PATCH] net: dsa: sja1105: Do not use address of compatible
member in sja1105_check_device_id
From: Nathan Chancellor <natechancellor@...il.com>
Date: Fri, 21 Aug 2020 15:25:16 -0700
> Clang warns:
>
> drivers/net/dsa/sja1105/sja1105_main.c:3418:38: warning: address of
> array 'match->compatible' will always evaluate to 'true'
> [-Wpointer-bool-conversion]
> for (match = sja1105_dt_ids; match->compatible; match++) {
> ~~~ ~~~~~~~^~~~~~~~~~
> 1 warning generated.
>
> We should check the value of the first character in compatible to see if
> it is empty or not. This matches how the rest of the tree iterates over
> IDs.
>
> Fixes: 0b0e299720bb ("net: dsa: sja1105: use detected device id instead of DT one on mismatch")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1139
> Signed-off-by: Nathan Chancellor <natechancellor@...il.com>
Applied, thanks.
Powered by blists - more mailing lists