From: Greg KH <gregkh@linuxfoundation.org>
To: Camylla Goncalves Cantanheide <c.cantanheide@gmail.com>
Cc: navid.emamdoost@gmail.com, sylphrenadin@gmail.com,
nishkadg.linux@gmail.com, stephen@brennan.io,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
lkcamp@lists.libreplanetbr.org
Subject: Re: [PATCH 1/2] staging: rtl8192u: Refactoring setKey function
Date: Mon, 13 Apr 2020 14:50:15 +0200 [thread overview]
Message-ID: <20200413125015.GA3077651@kroah.com> (raw)
In-Reply-To: <20200413030129.861-1-c.cantanheide@gmail.com>
On Mon, Apr 13, 2020 at 03:01:28AM +0000, Camylla Goncalves Cantanheide wrote:
> Changes of the local variable value and
> modification in the seletive repetition structure.
>
> Signed-off-by: Camylla Goncalves Cantanheide <c.cantanheide@gmail.com>
> ---
> drivers/staging/rtl8192u/r8192U_core.c | 52 ++++++++++++--------------
> 1 file changed, 24 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index 9b8d85a4855d..87c02aee3854 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -4880,7 +4880,7 @@ void EnableHWSecurityConfig8192(struct net_device *dev)
> void setKey(struct net_device *dev, u8 entryno, u8 keyindex, u16 keytype,
> u8 *macaddr, u8 defaultkey, u32 *keycontent)
> {
> - u32 target_command = 0;
> + u32 target_command = CAM_CONTENT_COUNT * entryno | BIT(31) | BIT(16);
> u32 target_content = 0;
> u16 us_config = 0;
> u8 i;
> @@ -4890,39 +4890,35 @@ void setKey(struct net_device *dev, u8 entryno, u8 keyindex, u16 keytype,
>
> RT_TRACE(COMP_SEC,
> "====>to %s, dev:%p, EntryNo:%d, KeyIndex:%d, KeyType:%d, MacAddr%pM\n",
> - __func__, dev, entryno, keyindex, keytype, macaddr);
> + __func__, dev, entryno, keyindex, keytype, macaddr);
>
> if (defaultkey)
> us_config |= BIT(15) | (keytype << 2);
> else
> us_config |= BIT(15) | (keytype << 2) | keyindex;
>
> - for (i = 0; i < CAM_CONTENT_COUNT; i++) {
> - target_command = i + CAM_CONTENT_COUNT * entryno;
> - target_command |= BIT(31) | BIT(16);
> -
> - if (i == 0) { /* MAC|Config */
> - target_content = (u32)(*(macaddr + 0)) << 16 |
> - (u32)(*(macaddr + 1)) << 24 |
> - (u32)us_config;
> -
> - write_nic_dword(dev, WCAMI, target_content);
> - write_nic_dword(dev, RWCAM, target_command);
> - } else if (i == 1) { /* MAC */
> - target_content = (u32)(*(macaddr + 2)) |
> - (u32)(*(macaddr + 3)) << 8 |
> - (u32)(*(macaddr + 4)) << 16 |
> - (u32)(*(macaddr + 5)) << 24;
> - write_nic_dword(dev, WCAMI, target_content);
> - write_nic_dword(dev, RWCAM, target_command);
> - } else {
> - /* Key Material */
> - if (keycontent) {
> - write_nic_dword(dev, WCAMI,
> - *(keycontent + i - 2));
> - write_nic_dword(dev, RWCAM, target_command);
> - }
> - }
> + target_content = macaddr[0] << 16 |
> + macaddr[0] << 24 |
> + (u32)us_config;
> +
> + write_nic_dword(dev, WCAMI, target_content);
> + write_nic_dword(dev, RWCAM, target_command++);
> +
> + /* MAC */
> + target_content = macaddr[2] |
> + macaddr[3] << 8 |
> + macaddr[4] << 16 |
> + macaddr[5] << 24;
> + write_nic_dword(dev, WCAMI, target_content);
> + write_nic_dword(dev, RWCAM, target_command++);
> +
> + /* Key Material */
> + if (!keycontent)
> + return;
> +
> + for (i = 2; i < CAM_CONTENT_COUNT; i++) {
> + write_nic_dword(dev, WCAMI, *keycontent++);
> + write_nic_dword(dev, RWCAM, target_command++);
> }
> }
>
> --
> 2.20.1
>
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- Your patch did many different things all at once, making it difficult
to review. All Linux kernel patches need to only do one thing at a
time. If you need to do multiple things (such as clean up all coding
style issues in a file/driver), do it in a sequence of patches, each
one doing only one thing. This will make it easier to review the
patches to ensure that they are correct, and to help alleviate any
merge issues that larger patches can cause.
- You did not specify a description of why the patch is needed, or
possibly, any description at all, in the email body. Please read the
section entitled "The canonical patch format" in the kernel file,
Documentation/SubmittingPatches for what is needed in order to
properly describe the change.
- You did not write a descriptive Subject: for the patch, allowing Greg,
and everyone else, to know what this patch is all about. Please read
the section entitled "The canonical patch format" in the kernel file,
Documentation/SubmittingPatches for what a proper Subject: line should
look like.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
next prev parent reply other threads:[~2020-04-13 12:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-13 3:01 [PATCH 1/2] staging: rtl8192u: Refactoring setKey function Camylla Goncalves Cantanheide
2020-04-13 3:01 ` [PATCH 2/2] staging: rtl8192u: Renames variables in " Camylla Goncalves Cantanheide
2020-04-13 12:50 ` Greg KH
2020-04-13 12:50 ` Greg KH [this message]
2020-04-13 15:39 ` [PATCH 1/2] staging: rtl8192u: Refactoring " Joe Perches
2020-04-14 12:33 ` Dan Carpenter
2020-04-14 16:01 ` Joe Perches
2020-04-14 18:32 ` Dan Carpenter
[not found] ` <CAG3pEr+huVACoP7sTMALYfE46dc+D8DdGPF0ky6EShd4eXD9eg@mail.gmail.com>
2020-04-15 3:09 ` Joe Perches
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=20200413125015.GA3077651@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=c.cantanheide@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkcamp@lists.libreplanetbr.org \
--cc=navid.emamdoost@gmail.com \
--cc=nishkadg.linux@gmail.com \
--cc=stephen@brennan.io \
--cc=sylphrenadin@gmail.com \
/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