All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Tobin C. Harding" <me@tobin.cc>, linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Wolfram Sang <wsa@the-dreams.de>,
	devel@linuxdriverproject.org, Tycho Andersen <tycho@tycho.ws>
Subject: Re: [PATCH RFC] staging: ks7010: remove custom Michael MIC implementation
Date: Thu, 30 Mar 2017 22:16:05 -0700	[thread overview]
Message-ID: <1490937365.27353.8.camel@perches.com> (raw)
In-Reply-To: <1490935659-7196-2-git-send-email-me@tobin.cc>

On Fri, 2017-03-31 at 15:47 +1100, Tobin C. Harding wrote:
> ks7010 currently uses a custom implementation of the Michael MIC
> algorithm. The kernel has an implementation of this algorithm
> already, we should use it.

ok, trivia:

Do please run your patch through checkpatch and fix a few style nits.

$ ./scripts/checkpatch.pl ~/1.mbox --strict --terse | cut -f2- -d":"
161: WARNING: line over 80 characters
170: WARNING: Missing a blank line after declarations
205: WARNING: line over 80 characters
229: WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
263: WARNING: Prefer using "%s", __func__ to embedded function names
264: ERROR: code indent should use tabs where possible
264: WARNING: quoted string split across lines
272: WARNING: Prefer using "%s", __func__ to embedded function names
273: ERROR: code indent should use tabs where possible
273: WARNING: quoted string split across lines
325: WARNING: Prefer pr_warn(... to pr_warning(...
 2 errors, 9 warnings, 0 checks, 262 lines checked

and

> diff --git a/drivers/staging/ks7010/mic.c b/drivers/staging/ks7010/mic.c
[]
> +int ks_wlan_mic(struct crypto_shash *tfm_michael, u8 *key,
> +		u8 priority, u8 *data, size_t data_len, u8 *mic)
> +{
> +	SHASH_DESC_ON_STACK(desc, tfm_michael);
> +	u8 hdr[ETH_HLEN + 2]; /* 16 bytes */

It might be better to declare a struct for this

> +	hdr[ETH_ALEN * 2] = priority;
> +	hdr[ETH_ALEN * 2 + 1] = 0;
> +	hdr[ETH_ALEN * 2 + 2] = 0;
> +	hdr[ETH_ALEN * 2 + 3] = 0;

And use struct members here.

  reply	other threads:[~2017-03-31  5:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31  4:47 [PATCH RFC] remove custom Michael MIC implementation Tobin C. Harding
2017-03-31  4:47 ` [PATCH RFC] staging: ks7010: " Tobin C. Harding
2017-03-31  5:16   ` Joe Perches [this message]
2017-03-31  9:37     ` Tobin C. Harding
2017-03-31  7:58 ` [PATCH RFC] " Wolfram Sang
2017-03-31 10:21   ` Tobin C. Harding
2017-03-31 10:42     ` Wolfram Sang
2017-04-01 10:40       ` Tobin C. Harding
2017-04-26 23:23       ` Tobin C. Harding
2017-04-28  6:09         ` Wolfram Sang
2017-04-03  5:19     ` Kalle Valo
2017-04-03  9:03       ` Tobin C. Harding
2017-04-03  9:50         ` Toke Høiland-Jørgensen
2017-04-03 10:15           ` Arend Van Spriel
2017-04-03 21:39             ` Tobin C. Harding
2017-04-04 21:31               ` Arend Van Spriel
2017-04-05  1:18                 ` Tobin C. Harding
2017-04-03  9:55         ` Kalle Valo
2017-04-03 12:13         ` Greg Kroah-Hartman

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=1490937365.27353.8.camel@perches.com \
    --to=joe@perches.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@tobin.cc \
    --cc=tycho@tycho.ws \
    --cc=wsa@the-dreams.de \
    /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 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.