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: <alpine.DEB.2.21.1902190857300.2570@hadrien>
Date:   Tue, 19 Feb 2019 09:01:49 +0100 (CET)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Mao Wenan <maowenan@...wei.com>
cc:     kernel-janitors@...r.kernel.org, netdev@...r.kernel.org,
        john.fastabend@...il.com, hawk@...nel.org,
        jakub.kicinski@...ronome.com, daniel@...earbox.net, ast@...nel.org
Subject: Re: [PATCH] net: ns83820: drop pointless static qualifier in
 ns83820_probe_phy()



On Tue, 19 Feb 2019, Mao Wenan wrote:

> There is no need to have the 'int first' static
> since new value always be assigned before use it.
> The old codes of first dereferencing this variable have
> been commented out. So it is useless with 'static int first'.
> /*
> if (!first) {
>  ...
> }
> */
> first = 1;

Do you need the variable at all?

In the code, the commenting out is actually done with #if 0.  It could be
good for the commit log to reflect the code more accurately.

Can the #if 0 and code be removed?  Apparently it predates git.

A commented out printk below also predates git.

julia

>
> Signed-off-by: Mao Wenan <maowenan@...wei.com>
> ---
>  drivers/net/ethernet/natsemi/ns83820.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
> index 958fced4dacf..fb064df3a1a6 100644
> --- a/drivers/net/ethernet/natsemi/ns83820.c
> +++ b/drivers/net/ethernet/natsemi/ns83820.c
> @@ -1869,7 +1869,7 @@ static unsigned ns83820_mii_write_reg(struct ns83820 *dev, unsigned phy, unsigne
>  static void ns83820_probe_phy(struct net_device *ndev)
>  {
>  	struct ns83820 *dev = PRIV(ndev);
> -	static int first;
> +	int first;
>  	int i;
>  #define MII_PHYIDR1	0x02
>  #define MII_PHYIDR2	0x03
> --
> 2.20.1
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ