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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 14 Sep 2020 22:21:28 -0700
From:   Joe Perches <>
To:     Armin Wolf <>,,
        Geert Uytterhoeven <>
Subject: Re: [PATCH net-next v5 1/6] lib8390: Fix coding style issues and
 remove version printing

On Mon, 2020-09-14 at 23:01 +0200, Armin Wolf wrote:
> Fix various checkpatch warnings.
> Remove version printing so modules including lib8390 do not
> have to provide a global version string for successful
> compilation.

This 8390 code is for a _really_ old driver.
It doesn't seem likely these changes are all that useful.
(and I say that as someone that's done a lot of drive-by
 cleaning to this code, mostly treewide though)

> diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c
> @@ -308,25 +301,24 @@ static netdev_tx_t __ei_start_xmit(struct sk_buff *skb,
>  	char *data = skb->data;
>  	if (skb->len < ETH_ZLEN) {
> -		memset(buf, 0, ETH_ZLEN);	/* more efficient than doing just the needed bits */
> +		/* More efficient than doing just the needed bits */
> +		memset(buf, 0, ETH_ZLEN);
>  		memcpy(buf, data, skb->len);

Even with the comment, this bit seems less than optimal.
Maybe not overwriting the already zeroed content is better?
At least it's fewer memory accesses.

		memcpy(buf, data, skb->len);
		memset(&buf[skb->len], 0, ETH_ZLEN - skb->len);

Powered by blists - more mailing lists