Re: [PATCH 8/8] staging: rtl8188eu: use is_broadcast_ether_addr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2018-07-29 at 19:08 +0200, Michael Straube wrote:
> Use is_broadcast_ether_addr instead of checking each byte of the
> address array for 0xff. Shortens the code and improves readability.

You should show in the commit log that sta_addr is __aligned(2)
as required by is_broadcast_ether_addr, otherwise you could be
introducing runtime alignment defects.

> diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
[]
> @@ -361,9 +361,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
>  		goto exit;
>  	}
>  
> -	if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
> -	    param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
> -	    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
> +	if (is_broadcast_ether_addr(param->sta_addr)) {
>  		if (param->u.crypt.idx >= WEP_KEYS) {
>  			ret = -EINVAL;
>  			goto exit;

etc...
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux