driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Frans Klaver <fransklaver@gmail.com>
To: Leon Krieg <info@madcow.dev>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	driverdev-devel@linuxdriverproject.org
Subject: Re: [PATCH] staging/ks7010: Fix coding style problems
Date: Wed, 18 Aug 2021 09:04:11 +0200	[thread overview]
Message-ID: <CAH6sp9Ov1JZCBm_9hB1+SqctNSvnieN-eqCrh_0Ui6yNTzeyig@mail.gmail.com> (raw)
In-Reply-To: <20210816175503.GA17772@mad-cln-mothership-1.local>

On Mon, Aug 16, 2021 at 8:06 PM Leon Krieg <info@madcow.dev> wrote:
>
> Sorry to bother you with this low-effort patch but I'd really like to get
> my feet in the water and this whole process is making me nervous. I'd
> really appreciate you taking the time to look over this diff and
> hopefully I did not screw up to badly.
>
> Signed-off-by: Leon Krieg <info@madcow.dev>
> ---
>  drivers/staging/ks7010/Kconfig       |  7 ++++---
>  drivers/staging/ks7010/ks_hostif.c   |  2 +-
>  drivers/staging/ks7010/ks_wlan_net.c | 20 ++++++++++----------
>  3 files changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/staging/ks7010/Kconfig b/drivers/staging/ks7010/Kconfig
> index 0987fdc2f70d..4bc17e50ac89 100644
> --- a/drivers/staging/ks7010/Kconfig
> +++ b/drivers/staging/ks7010/Kconfig
> @@ -6,6 +6,7 @@ config KS7010
>         select WEXT_PRIV
>         select FW_LOADER
>         help
> -         This is a driver for KeyStream KS7010 based SDIO WIFI cards. It is
> -         found on at least later Spectec SDW-821 (FCC-ID "S2Y-WLAN-11G-K" only,
> -         sadly not FCC-ID "S2Y-WLAN-11B-G") and Spectec SDW-823 microSD cards.
> +         Selecting this option enables the driver for KeyStream KS7010 SDIO
> +         hardware found in at least Spectec SDW-821 and SDW-823 microSD cards
> +         (FCC-ID "S2Y-WLAN-11G-K" but not FCC-ID "S2Y-WLAN-11B-G" and Spectec
> +         SDW-823).
>
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> index eaa70893224a..d2f9d0ed62c1 100644
>  drivers/staging/ks7010/Kconfig       |  7 ++++---
>  drivers/staging/ks7010/ks_hostif.c   |  2 +-
>  drivers/staging/ks7010/ks_wlan_net.c | 20 ++++++++++----------
>  3 files changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/staging/ks7010/Kconfig b/drivers/staging/ks7010/Kconfig
> index 0987fdc2f70d..4bc17e50ac89 100644
> --- a/drivers/staging/ks7010/Kconfig
> +++ b/drivers/staging/ks7010/Kconfig
> @@ -6,6 +6,7 @@ config KS7010
>         select WEXT_PRIV
>         select FW_LOADER
>         help
> -         This is a driver for KeyStream KS7010 based SDIO WIFI cards. It is
> -         found on at least later Spectec SDW-821 (FCC-ID "S2Y-WLAN-11G-K" only,
> -         sadly not FCC-ID "S2Y-WLAN-11B-G") and Spectec SDW-823 microSD cards.
> +         Selecting this option enables the driver for KeyStream KS7010 SDIO
> +         hardware found in at least Spectec SDW-821 and SDW-823 microSD cards
> +         (FCC-ID "S2Y-WLAN-11G-K" but not FCC-ID "S2Y-WLAN-11B-G" and Spectec
> +         SDW-823).
>
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> index eaa70893224a..d2f9d0ed62c1 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -134,7 +134,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info *ap_info)
>         size = (ap_info->rsn.size <= RSN_IE_BODY_MAX) ?
>                 ap_info->rsn.size : RSN_IE_BODY_MAX;
>         if ((ap_info->rsn_mode & RSN_MODE_WPA2) &&
> -           (priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2)) {
> +           priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2) {
>                 ap->rsn_ie.id = RSN_INFO_ELEM_ID;
>                 ap->rsn_ie.size = size;
>                 memcpy(ap->rsn_ie.body, ap_info->rsn.body, size);
> diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> index 09e7b4cd0138..33abb6a7dbe0 100644
> --- a/drivers/staging/ks7010/ks_wlan_net.c
> +++ b/drivers/staging/ks7010/ks_wlan_net.c
> @@ -181,26 +181,26 @@ static int ks_wlan_set_freq(struct net_device *dev,
>
>         /* for SLEEP MODE */
>         /* If setting by frequency, convert to a channel */
> -       if ((fwrq->freq.e == 1) &&
> -           (fwrq->freq.m >= 241200000) && (fwrq->freq.m <= 248700000)) {
> +       if (fwrq->freq.e == 1 &&
> +           fwrq->freq.m >= 241200000 && fwrq->freq.m <= 248700000) {
>                 int f = fwrq->freq.m / 100000;
>                 int c = 0;
>
>                 while ((c < 14) && (f != frequency_list[c]))
>                         c++;
> -               /* Hack to fall through... */
> +               fallthrough;
>                 fwrq->freq.e = 0;
>                 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;
> @@ -664,7 +664,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;
> @@ -702,7 +702,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 ??? */
> @@ -781,7 +781,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);
> @@ -882,7 +882,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;
> @@ -1860,7 +1860,7 @@ static int ks_wlan_set_power_mgmt(struct net_device *dev,
>                 return -EINVAL;
>
>         if ((*uwrq == POWER_MGMT_SAVE1 || *uwrq == POWER_MGMT_SAVE2) &&
> -           (priv->reg.operation_mode != MODE_INFRASTRUCTURE))
> +           priv->reg.operation_mode != MODE_INFRASTRUCTURE)
>                 return -EINVAL;
>
>         priv->reg.power_mgmt = *uwrq;
> --
> 2.27.0
>
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -134,7 +134,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info *ap_info)
>         size = (ap_info->rsn.size <= RSN_IE_BODY_MAX) ?
>                 ap_info->rsn.size : RSN_IE_BODY_MAX;
>         if ((ap_info->rsn_mode & RSN_MODE_WPA2) &&
> -           (priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2)) {
> +           priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2) {
>                 ap->rsn_ie.id = RSN_INFO_ELEM_ID;
>                 ap->rsn_ie.size = size;
>                 memcpy(ap->rsn_ie.body, ap_info->rsn.body, size);
> diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> index 09e7b4cd0138..33abb6a7dbe0 100644
> --- a/drivers/staging/ks7010/ks_wlan_net.c
> +++ b/drivers/staging/ks7010/ks_wlan_net.c
> @@ -181,26 +181,26 @@ static int ks_wlan_set_freq(struct net_device *dev,
>
>         /* for SLEEP MODE */
>         /* If setting by frequency, convert to a channel */
> -       if ((fwrq->freq.e == 1) &&
> -           (fwrq->freq.m >= 241200000) && (fwrq->freq.m <= 248700000)) {
> +       if (fwrq->freq.e == 1 &&
> +           fwrq->freq.m >= 241200000 && fwrq->freq.m <= 248700000) {
>                 int f = fwrq->freq.m / 100000;
>                 int c = 0;
>
>                 while ((c < 14) && (f != frequency_list[c]))
>                         c++;
> -               /* Hack to fall through... */
> +               fallthrough;
>                 fwrq->freq.e = 0;
>                 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;
> @@ -664,7 +664,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;
> @@ -702,7 +702,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 ??? */
> @@ -781,7 +781,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);
> @@ -882,7 +882,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;
> @@ -1860,7 +1860,7 @@ static int ks_wlan_set_power_mgmt(struct net_device *dev,
>                 return -EINVAL;
>
>         if ((*uwrq == POWER_MGMT_SAVE1 || *uwrq == POWER_MGMT_SAVE2) &&
> -           (priv->reg.operation_mode != MODE_INFRASTRUCTURE))
> +           priv->reg.operation_mode != MODE_INFRASTRUCTURE)
>                 return -EINVAL;
>
>         priv->reg.power_mgmt = *uwrq;
> --
> 2.27.0

Hi,

It seems you ran into some common issues and triggered some bots.
Don't worry about that. Just rework the patch into multiple patches
with sensible descriptions of what you did. Do follow the suggestions
made by gregkh's patchbot.

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

      parent reply	other threads:[~2021-08-18  7:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 17:55 [PATCH] staging/ks7010: Fix coding style problems Leon Krieg
2021-08-16 19:17 ` Greg KH
2021-08-16 22:09 ` kernel test robot
2021-08-16 22:43 ` kernel test robot
2021-08-17  3:07 ` kernel test robot
2021-08-18  7:04 ` Frans Klaver [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH6sp9Ov1JZCBm_9hB1+SqctNSvnieN-eqCrh_0Ui6yNTzeyig@mail.gmail.com \
    --to=fransklaver@gmail.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=info@madcow.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).