Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] dvb_core: Replace memset with eth_zero_addr

Use eth_zero_addr to assign the zero address to the given address
array instead of memset when second argument is address of zero.

The Coccinelle semantic patch that makes this change is as follows:

// <smpl>
@eth_zero_addr@
expression e;
@@

-memset(e,0x00,ETH_ALEN);
+eth_zero_addr(e);
// </smpl>

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Vaishali Thakkar and committed by
Mauro Carvalho Chehab
4dc102b2 a4c4f95e

+1 -1
+1 -1
drivers/media/dvb-core/dvb_net.c
··· 709 709 if (!priv->ule_dbit) { 710 710 /* dest_addr buffer is only valid if priv->ule_dbit == 0 */ 711 711 memcpy(ethh->h_dest, dest_addr, ETH_ALEN); 712 - memset(ethh->h_source, 0, ETH_ALEN); 712 + eth_zero_addr(ethh->h_source); 713 713 } 714 714 else /* zeroize source and dest */ 715 715 memset( ethh, 0, ETH_ALEN*2 );