lkml.org 
[lkml]   [2018]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 8/8] staging: rtl8188eu: use is_broadcast_ether_addr
From
Date
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...

\
 
 \ /
  Last update: 2018-07-29 19:22    [W:0.047 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site