lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230312105729.bnxn4a6mf2gav7ym@skbuf>
Date:   Sun, 12 Mar 2023 12:57:29 +0200
From:   Vladimir Oltean <olteanv@...il.com>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Hauke Mehrtens <hauke@...ke-m.de>,
        Woojung Huh <woojung.huh@...rochip.com>,
        UNGLinuxDriver@...rochip.com,
        Claudiu Manoil <claudiu.manoil@....com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Colin Foster <colin.foster@...advantage.com>,
        Michael Hennerich <michael.hennerich@...log.com>,
        Alexander Aring <alex.aring@...il.com>,
        Stefan Schmidt <stefan@...enfreihafen.org>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-wpan@...r.kernel.org
Subject: Re: [PATCH 01/12] net: dsa: lantiq_gswip: mark OF related data as
 maybe unused

On Sun, Mar 12, 2023 at 11:20:38AM +0100, Krzysztof Kozlowski wrote:
> On 11/03/2023 19:14, Vladimir Oltean wrote:
> > On Sat, Mar 11, 2023 at 06:32:52PM +0100, Krzysztof Kozlowski wrote:
> >> The driver can be compile tested with !CONFIG_OF making certain data
> >> unused:
> >>
> >>   drivers/net/dsa/lantiq_gswip.c:1888:34: error: ‘xway_gphy_match’ defined but not used [-Werror=unused-const-variable=]
> >>
> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> >> ---
> > 
> > Do you happen to have any context as to why of_match_node() without
> > CONFIG_OF is implemented as:
> > 
> > #define of_match_node(_matches, _node)	NULL
> > 
> > and not as:
> > 
> > static inline const struct of_device_id *
> > of_match_node(const struct of_device_id *matches,
> > 	      const struct device_node *node)
> > {
> > 	return NULL;
> > }
> > 
> > ?
> > 
> > Generally, the static inline shim function model is nicer, because it
> > allows us to not scatter __maybe_unused all around.
> 
> Sorry, I don't follow. I don't touch that wrappers, just fix errors
> related to OF device ID tables, although in few cases it is indeed
> related to of_match_node.

I'm saying this because in lantiq_gswip.c, xway_gphy_match is accessed
through of_match_node(). If the shim definition for of_match_node() was
different, the variable wouldn't have been unused with CONFIG_OF=n.
I guess it's worth considering changing that wrapper instead of adding
the __maybe_unused.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ