Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933229AbdCaFQN (ORCPT ); Fri, 31 Mar 2017 01:16:13 -0400 Received: from smtprelay0026.hostedemail.com ([216.40.44.26]:49573 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932977AbdCaFQM (ORCPT ); Fri, 31 Mar 2017 01:16:12 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3872:4321:4823:5007:10004:10400:10848:11026:11473:11658:11914:12043:12296:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21451:30012:30030:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: frogs30_3567087d19543 X-Filterd-Recvd-Size: 2498 Message-ID: <1490937365.27353.8.camel@perches.com> Subject: Re: [PATCH RFC] staging: ks7010: remove custom Michael MIC implementation From: Joe Perches To: "Tobin C. Harding" , linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Wolfram Sang , devel@linuxdriverproject.org, Tycho Andersen Date: Thu, 30 Mar 2017 22:16:05 -0700 In-Reply-To: <1490935659-7196-2-git-send-email-me@tobin.cc> References: <1490935659-7196-1-git-send-email-me@tobin.cc> <1490935659-7196-2-git-send-email-me@tobin.cc> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.3-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1523 Lines: 41 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.