Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1613806

Re: [PATCH RFC] staging: ks7010: remove custom Michael MIC implementation

From "Tobin C. Harding" <me@tobin.cc>
Newsgroups linux.kernel
Subject Re: [PATCH RFC] staging: ks7010: remove custom Michael MIC implementation
Date 2017-03-31 11:40 +0200
Message-ID <tr1cf-2Nd-47@gated-at.bofh.it> (permalink)
References <tqWFA-8cM-5@gated-at.bofh.it> <tqWFA-8cM-3@gated-at.bofh.it> <tqX8C-cu-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Mar 30, 2017 at 10:16:05PM -0700, Joe Perches wrote:
> 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

Face palm :)

> 
> 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.
> 

Thanks Joe,
Tobin.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH RFC] staging: ks7010: remove custom Michael MIC implementation "Tobin C. Harding" <me@tobin.cc> - 2017-03-31 06:50 +0200
  Re: [PATCH RFC] staging: ks7010: remove custom Michael MIC  implementation Joe Perches <joe@perches.com> - 2017-03-31 07:20 +0200
    Re: [PATCH RFC] staging: ks7010: remove custom Michael MIC  implementation "Tobin C. Harding" <me@tobin.cc> - 2017-03-31 11:40 +0200

csiph-web