From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933195AbdCaJh4 (ORCPT ); Fri, 31 Mar 2017 05:37:56 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:47458 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932904AbdCaJhw (ORCPT ); Fri, 31 Mar 2017 05:37:52 -0400 X-ME-Sender: X-Sasl-enc: 3eE+e2BGz3zmSMjE67clUTD+cgtqYuB0aJxqTp0AeWWl 1490953065 Date: Fri, 31 Mar 2017 20:37:43 +1100 From: "Tobin C. Harding" To: Joe Perches Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Wolfram Sang , devel@linuxdriverproject.org, Tycho Andersen Subject: Re: [PATCH RFC] staging: ks7010: remove custom Michael MIC implementation Message-ID: <20170331093743.GA14196@eros> References: <1490935659-7196-1-git-send-email-me@tobin.cc> <1490935659-7196-2-git-send-email-me@tobin.cc> <1490937365.27353.8.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1490937365.27353.8.camel@perches.com> X-Mailer: Mutt 1.5.24 (2015-08-30) User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.