Thread (10 messages) 10 messages, 3 authors, 2020-09-15

Re: [PATCH net-next v5 1/6] lib8390: Fix coding style issues and remove version printing

From: Joe Perches <joe@perches.com>
Date: 2020-09-15 05:21:34

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)
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c
[]
quoted hunk ↗ jump to hunk
@@ -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);

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help