Re: [PATCH] staging: ks7010: remove unnecessary parentheses

2023-03-30 Thread Greg KH
On Thu, Mar 30, 2023 at 08:48:28PM +0800, Joel Camilo Chang Gonzalez wrote:
> Remove redundant parentheses
> 
> Signed-off-by: Joel Camilo Chang Gonzalez 
> ---
>  drivers/staging/ks7010/ks_wlan_net.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks_wlan_net.c 
> b/drivers/staging/ks7010/ks_wlan_net.c
> index e03c87f0bfe7..eef1a1e70088 100644
> --- a/drivers/staging/ks7010/ks_wlan_net.c
> +++ b/drivers/staging/ks7010/ks_wlan_net.c
> @@ -193,14 +193,14 @@ static int ks_wlan_set_freq(struct net_device *dev,
>   fwrq->freq.m = c + 1;
>   }
>   /* Setting by channel number */
> - if ((fwrq->freq.m > 1000) || (fwrq->freq.e > 0))
> + if (fwrq->freq.m > 1000 || fwrq->freq.e > 0)

Do you want to have to remember the precidence order between "||" and
">"?  I don't, so please don't make this change.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: remove unnecessary parentheses

2023-03-30 Thread Joel Camilo Chang Gonzalez
Remove redundant parentheses

Signed-off-by: Joel Camilo Chang Gonzalez 
---
 drivers/staging/ks7010/ks_wlan_net.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c 
b/drivers/staging/ks7010/ks_wlan_net.c
index e03c87f0bfe7..eef1a1e70088 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -193,14 +193,14 @@ static int ks_wlan_set_freq(struct net_device *dev,
fwrq->freq.m = c + 1;
}
/* Setting by channel number */
-   if ((fwrq->freq.m > 1000) || (fwrq->freq.e > 0))
+   if (fwrq->freq.m > 1000 || fwrq->freq.e > 0)
return -EOPNOTSUPP;
 
channel = fwrq->freq.m;
/* We should do a better check than that,
 * based on the card capability !!!
 */
-   if ((channel < 1) || (channel > 14)) {
+   if (channel < 1 || channel > 14) {
netdev_dbg(dev, "%s: New channel value of %d is invalid!\n",
   dev->name, fwrq->freq.m);
return -EINVAL;
@@ -663,7 +663,7 @@ static int ks_wlan_set_rts(struct net_device *dev, struct 
iw_request_info *info,
/* for SLEEP MODE */
if (vwrq->rts.disabled)
rthr = 2347;
-   if ((rthr < 0) || (rthr > 2347))
+   if (rthr < 0 || rthr > 2347)
return -EINVAL;
 
priv->reg.rts = rthr;
@@ -701,7 +701,7 @@ static int ks_wlan_set_frag(struct net_device *dev,
/* for SLEEP MODE */
if (vwrq->frag.disabled)
fthr = 2346;
-   if ((fthr < 256) || (fthr > 2346))
+   if (fthr < 256 || fthr > 2346)
return -EINVAL;
 
fthr &= ~0x1;   /* Get an even value - is it really needed ??? */
@@ -780,7 +780,7 @@ static int ks_wlan_set_encode(struct net_device *dev,
return -EINVAL;
 
/* for SLEEP MODE */
-   if ((index < 0) || (index > 4))
+   if (index < 0 || index > 4)
return -EINVAL;
 
index = (index == 0) ? priv->reg.wep_index : (index - 1);
@@ -881,7 +881,7 @@ static int ks_wlan_get_encode(struct net_device *dev,
}
 
/* Which key do we want ? -1 -> tx index */
-   if ((index < 0) || (index >= 4))
+   if (index < 0 || index >= 4)
index = priv->reg.wep_index;
if (priv->reg.privacy_invoked) {
enc->flags &= ~IW_ENCODE_DISABLED;
-- 
2.37.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: ks7010: remove unnecessary parentheses

2019-01-23 Thread Matt McCoy
On Tue, Jan 22, 2019 at 06:45:37PM -0800, Joe Perches wrote:
> On Tue, 2019-01-22 at 21:18 -0500, Matt McCoy wrote:
> > Remove unnecessary parentheses reported by checkpatch.
> []
> > diff --git a/drivers/staging/ks7010/ks_hostif.c 
> > b/drivers/staging/ks7010/ks_hostif.c
> []
> > @@ -171,7 +171,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct 
> > link_ap_info *ap_info)
> >"- rate_set_size=%d\n",
> >ap->bssid[0], ap->bssid[1], ap->bssid[2],
> >ap->bssid[3], ap->bssid[4], ap->bssid[5],
> > -  &(ap->ssid.body[0]),
> > +  >ssid.body[0],
> >ap->rate_set.body[0], ap->rate_set.body[1],
> >ap->rate_set.body[2], ap->rate_set.body[3],
> >ap->rate_set.body[4], ap->rate_set.body[5],
> 
> This bit:
> 
> []
>   netdev_dbg(priv->net_dev, "Link AP\n"
>  "- bssid=%02X:%02X:%02X:%02X:%02X:%02X\n"
> []
>  ap->bssid[0], ap->bssid[1], ap->bssid[2],
> 
> should instead use the vsprintf %pM extension
> 
>   "- bssid: %pM\n"
> []
>   ap->bssid,
> 
>

Should I just make a v2 of this patch with 2 parts ?
One being this change and the other using the %pM extension.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: ks7010: remove unnecessary parentheses

2019-01-23 Thread Joe Perches
On Tue, 2019-01-22 at 21:18 -0500, Matt McCoy wrote:
> Remove unnecessary parentheses reported by checkpatch.
[]
> diff --git a/drivers/staging/ks7010/ks_hostif.c 
> b/drivers/staging/ks7010/ks_hostif.c
[]
> @@ -171,7 +171,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct 
> link_ap_info *ap_info)
>  "- rate_set_size=%d\n",
>  ap->bssid[0], ap->bssid[1], ap->bssid[2],
>  ap->bssid[3], ap->bssid[4], ap->bssid[5],
> -&(ap->ssid.body[0]),
> +>ssid.body[0],
>  ap->rate_set.body[0], ap->rate_set.body[1],
>  ap->rate_set.body[2], ap->rate_set.body[3],
>  ap->rate_set.body[4], ap->rate_set.body[5],

This bit:

[]
netdev_dbg(priv->net_dev, "Link AP\n"
   "- bssid=%02X:%02X:%02X:%02X:%02X:%02X\n"
[]
   ap->bssid[0], ap->bssid[1], ap->bssid[2],

should instead use the vsprintf %pM extension

"- bssid: %pM\n"
[]
ap->bssid,


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: remove unnecessary parentheses

2019-01-22 Thread Matt McCoy
Remove unnecessary parentheses reported by checkpatch.

Signed-off-by: Matt McCoy 
---
 drivers/staging/ks7010/ks_hostif.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 065bce1..d938b09 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -35,7 +35,7 @@ static inline u8 get_byte(struct ks_wlan_private *priv)
 {
u8 data;
 
-   data = *(priv->rxp)++;
+   data = *priv->rxp++;
/* length check in advance ! */
--(priv->rx_size);
return data;
@@ -171,7 +171,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct 
link_ap_info *ap_info)
   "- rate_set_size=%d\n",
   ap->bssid[0], ap->bssid[1], ap->bssid[2],
   ap->bssid[3], ap->bssid[4], ap->bssid[5],
-  &(ap->ssid.body[0]),
+  >ssid.body[0],
   ap->rate_set.body[0], ap->rate_set.body[1],
   ap->rate_set.body[2], ap->rate_set.body[3],
   ap->rate_set.body[4], ap->rate_set.body[5],
@@ -732,7 +732,7 @@ void hostif_scan_indication(struct ks_wlan_private *priv)
netdev_dbg(priv->net_dev, " scan_ind_count=%d :: 
aplist.size=%d\n",
priv->scan_ind_count, priv->aplist.size);
get_ap_information(priv, (struct ap_info *)(priv->rxp),
-  &(priv->aplist.ap[priv->scan_ind_count - 
1]));
+  >aplist.ap[priv->scan_ind_count - 1]);
priv->aplist.size = priv->scan_ind_count;
} else {
netdev_dbg(priv->net_dev, " count over :: scan_ind_count=%d\n",
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel