* [PATCH] staging: ks7010: remove unnecessary parentheses
@ 2019-01-23 2:18 Matt McCoy
2019-01-23 2:45 ` Joe Perches
0 siblings, 1 reply; 5+ messages in thread
From: Matt McCoy @ 2019-01-23 2:18 UTC (permalink / raw)
To: Matt McCoy
Cc: Greg Kroah-Hartman, Sergio Paracuellos, Quytelda Kahja, devel,
linux-kernel
Remove unnecessary parentheses reported by checkpatch.
Signed-off-by: Matt McCoy <mattmccoy110@gmail.com>
---
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]),
+ &ap->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]));
+ &priv->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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: ks7010: remove unnecessary parentheses
2019-01-23 2:18 [PATCH] staging: ks7010: remove unnecessary parentheses Matt McCoy
@ 2019-01-23 2:45 ` Joe Perches
2019-01-23 22:21 ` Matt McCoy
0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2019-01-23 2:45 UTC (permalink / raw)
To: Matt McCoy
Cc: Greg Kroah-Hartman, Sergio Paracuellos, Quytelda Kahja, devel,
linux-kernel
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]),
> + &ap->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,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: ks7010: remove unnecessary parentheses
2019-01-23 2:45 ` Joe Perches
@ 2019-01-23 22:21 ` Matt McCoy
0 siblings, 0 replies; 5+ messages in thread
From: Matt McCoy @ 2019-01-23 22:21 UTC (permalink / raw)
To: Joe Perches
Cc: Greg Kroah-Hartman, Sergio Paracuellos, Quytelda Kahja, devel,
linux-kernel
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]),
> > + &ap->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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] staging: ks7010: remove unnecessary parentheses
@ 2023-03-30 12:48 Joel Camilo Chang Gonzalez
2023-03-30 12:53 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Joel Camilo Chang Gonzalez @ 2023-03-30 12:48 UTC (permalink / raw)
To: driverdev-devel, linux-staging, gregkh
Remove redundant parentheses
Signed-off-by: Joel Camilo Chang Gonzalez <jcchangg3@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: ks7010: remove unnecessary parentheses
2023-03-30 12:48 Joel Camilo Chang Gonzalez
@ 2023-03-30 12:53 ` Greg KH
0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2023-03-30 12:53 UTC (permalink / raw)
To: Joel Camilo Chang Gonzalez; +Cc: driverdev-devel, linux-staging
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 <jcchangg3@gmail.com>
> ---
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-03-30 12:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-23 2:18 [PATCH] staging: ks7010: remove unnecessary parentheses Matt McCoy
2019-01-23 2:45 ` Joe Perches
2019-01-23 22:21 ` Matt McCoy
-- strict thread matches above, loose matches on Subject: below --
2023-03-30 12:48 Joel Camilo Chang Gonzalez
2023-03-30 12:53 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.