From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: "Felix N. Kimbu" <felixkimbu1@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: outreachy@lists.linux.dev
Subject: Re: [PATCH] staging: p80211conv: Rename local foo to decrypt_check
Date: Mon, 11 Mar 2024 20:31:13 +0100 [thread overview]
Message-ID: <6d643351-8924-4c86-9fb5-9951e016f5db@gmail.com> (raw)
In-Reply-To: <Ze9Ie67PCSvBU+og@MOLeToid>
On 3/11/24 19:07, Felix N. Kimbu wrote:
> This change renames the local variable foo to decrypt_check in functions
> skb_ether_to_p80211(...) and skb_p80211_to_ether(...), giving intuitive
> meaning to the identifier.
>
> It also indents the parameters to match the the opening parentheses.
>
> Signed-off-by: Felix N. Kimbu <felixkimbu1@gmail.com>
Hi Felix,
I think the subject names the subsystem "staging" and then the driver
which is "wlan-ng" the file can follow but you cannot omit the driver
name.
Please check the following checkpatch warnings:
File Nr: 0 Patch: ../../../Downloads/20240311-[PATCH] staging_
p80211conv_ Rename local foo to decrypt_check-15036.txt
WARNING: Possible repeated word: 'the'
#11:
It also indents the parameters to match the the opening parentheses.
ERROR: code indent should use tabs where possible
#41: FILE: drivers/staging/wlan-ng/p80211conv.c:189:
+^I^I^I^I ^I^I^I^I^Iskb->len,$
WARNING: please, no space before tabs
#41: FILE: drivers/staging/wlan-ng/p80211conv.c:189:
+^I^I^I^I ^I^I^I^I^Iskb->len,$
CHECK: Alignment should match open parenthesis
#41: FILE: drivers/staging/wlan-ng/p80211conv.c:189:
+ decrypt_check = wep_encrypt(wlandev, skb->data, p80211_wep->data,
+ skb->len,
WARNING: line length of 115 exceeds 100 columns
#42: FILE: drivers/staging/wlan-ng/p80211conv.c:190:
+ wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK,
WARNING: line length of 105 exceeds 100 columns
#43: FILE: drivers/staging/wlan-ng/p80211conv.c:191:
+ p80211_wep->iv, p80211_wep->icv);
CHECK: Alignment should match open parenthesis
#72: FILE: drivers/staging/wlan-ng/p80211conv.c:309:
+ decrypt_check = wep_decrypt(wlandev, skb->data + payload_offset + 4,
+ payload_length - 8, -1,
total: 1 errors, 4 warnings, 2 checks, 58 lines checked
Thanks for your support.
Bye Philipp
> ---
> drivers/staging/wlan-ng/p80211conv.c | 30 ++++++++++++++--------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
> index 8336435eccc2..a0413928a843 100644
> --- a/drivers/staging/wlan-ng/p80211conv.c
> +++ b/drivers/staging/wlan-ng/p80211conv.c
> @@ -93,7 +93,7 @@ int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv,
> struct wlan_ethhdr e_hdr;
> struct wlan_llc *e_llc;
> struct wlan_snap *e_snap;
> - int foo;
> + int decrypt_check;
>
> memcpy(&e_hdr, skb->data, sizeof(e_hdr));
>
> @@ -185,14 +185,14 @@ int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv,
> p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC);
> if (!p80211_wep->data)
> return -ENOMEM;
> - foo = wep_encrypt(wlandev, skb->data, p80211_wep->data,
> - skb->len,
> - wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK,
> - p80211_wep->iv, p80211_wep->icv);
> - if (foo) {
> + decrypt_check = wep_encrypt(wlandev, skb->data, p80211_wep->data,
> + skb->len,
> + wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK,
> + p80211_wep->iv, p80211_wep->icv);
> + if (decrypt_check) {
> netdev_warn(wlandev->netdev,
> "Host en-WEP failed, dropping frame (%d).\n",
> - foo);
> + decrypt_check);
> kfree(p80211_wep->data);
> return 2;
> }
> @@ -265,7 +265,7 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
> struct wlan_llc *e_llc;
> struct wlan_snap *e_snap;
>
> - int foo;
> + int decrypt_check;
>
> payload_length = skb->len - WLAN_HDR_A3_LEN - WLAN_CRC_LEN;
> payload_offset = WLAN_HDR_A3_LEN;
> @@ -305,15 +305,15 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
> "WEP frame too short (%u).\n", skb->len);
> return 1;
> }
> - foo = wep_decrypt(wlandev, skb->data + payload_offset + 4,
> - payload_length - 8, -1,
> - skb->data + payload_offset,
> - skb->data + payload_offset +
> - payload_length - 4);
> - if (foo) {
> + decrypt_check = wep_decrypt(wlandev, skb->data + payload_offset + 4,
> + payload_length - 8, -1,
> + skb->data + payload_offset,
> + skb->data + payload_offset +
> + payload_length - 4);
> + if (decrypt_check) {
> /* de-wep failed, drop skb. */
> netdev_dbg(netdev, "Host de-WEP failed, dropping frame (%d).\n",
> - foo);
> + decrypt_check);
> wlandev->rx.decrypt_err++;
> return 2;
> }
next prev parent reply other threads:[~2024-03-11 19:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 18:07 [PATCH] staging: p80211conv: Rename local foo to decrypt_check Felix N. Kimbu
2024-03-11 19:31 ` Philipp Hortmann [this message]
2024-03-11 21:34 ` [PATCH v2] staging: wlan-ng: p80211conv: fix indentation problems, introduced by previous commit Felix N. Kimbu
2024-03-11 22:52 ` Alison Schofield
2024-03-12 14:19 ` Felix Kimbu
2024-03-11 22:46 ` [PATCH] staging: p80211conv: Rename local foo to decrypt_check Alison Schofield
2024-03-12 9:01 ` Dan Carpenter
2024-03-12 14:09 ` Felix Kimbu
2024-03-12 9:03 ` Dan Carpenter
2024-03-12 14:16 ` Felix Kimbu
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=6d643351-8924-4c86-9fb5-9951e016f5db@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=felixkimbu1@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy@lists.linux.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