Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1380452ybb; Wed, 1 Apr 2020 22:58:15 -0700 (PDT) X-Google-Smtp-Source: APiQypI7WxULG8PLX1JoC1a/kNcVd/4oTG43FRyLBN3PihdLGqbY4kIiZfeEpk/ABpVqnLMM4eAD X-Received: by 2002:aca:d446:: with SMTP id l67mr1105185oig.115.1585807095613; Wed, 01 Apr 2020 22:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585807095; cv=none; d=google.com; s=arc-20160816; b=FBgzyhzpJVejAC12RcLMgc31pmtCJDp+/8kS+iHh1+JWWMfH+iVK5eOEGYhBKsNkg1 OMaqRI4C+gZy3KND+uRVTHuvpcYxtGGMhAdM8fSHgfTEqur+EdeL6mZo1H/+hRUJkjcb y8uy3XPbC0E9O2guXc+tPbZiWS0BXzXJ9hShpQemo+hbj+GWNnrWHbZ66sJvpYOuAg44 WwChVhF5ZiXplaiwe8t7y33q9t5dLtkd8z6LMP+jUsXp4NXUcgfaw5DpmgF5pzPpP1cF hUh41g/UeHE2GcE71gKV/N7TGYXRRsemxDRcDR48+q3VHrqW/e1W+gVCBIRzqOx68blx Ehzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id; bh=NOVyi7QnTCiULK090eFIqdauO8tTXuj3BRgY3GODhEM=; b=wq3UXnQ42/f1O3loy8QATLJGEghwPrUCU4/pIIgYQF/XIy2wAXqyoWf8rr3QTKpARA y3QSzGzd20QN0uFOZg3IsWDHPUpzr11mLQKD8lN4e+6kuM3EUV5gTpAZzz7IWkk7R0Xz L3ifNwxA2HCR3Br0H8Eyng6m36JLatbf40Be2/c1KfSIA9uAWDQ5IRnpifmS5lpUNRJn lR1WWN3X0SDmJwDqJXQ2PPEUUmyVE+qvIyv4Gr47cKE0AaPMmwzUUQRpMzXD0VTAMLnp IXEznzV1Cfbm5I6FoIzMAWGSJwoUQJpGb0bZ7jQFOhjR+yw+sxalmFamwW7WDBcVlXbO koXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u25si2038500otg.199.2020.04.01.22.58.03; Wed, 01 Apr 2020 22:58:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728425AbgDBF4P (ORCPT + 99 others); Thu, 2 Apr 2020 01:56:15 -0400 Received: from smtprelay0030.hostedemail.com ([216.40.44.30]:35508 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725789AbgDBF4P (ORCPT ); Thu, 2 Apr 2020 01:56:15 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 38DD15010; Thu, 2 Apr 2020 05:56:14 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1381:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2692:2828:3138:3139:3140:3141:3142:3354:3622:3865:3867:3868:4250:4321:4605:5007:6119:7514:7875:7903:10004:10400:10848:11026:11232:11473:11658:11914:12043:12048:12296:12297:12438:12555:12740:12760:12895:13439:13972:14096:14097:14181:14659:14721:21080:21627:21990:30012:30045:30046:30054:30070: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: judge59_8d939426bb842 X-Filterd-Recvd-Size: 3915 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA; Thu, 2 Apr 2020 05:56:12 +0000 (UTC) Message-ID: <5d35084fcc0476fc2f43e3cf371f5078c0fbeeab.camel@perches.com> Subject: Re: [PATCH 1/2] staging: gasket: Fix 4 over 80 char warnings From: Joe Perches To: "John B. Wyatt IV" , outreachy-kernel@googlegroups.com, Rob Springer , Todd Poynor , Ben Chan , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Wed, 01 Apr 2020 22:54:17 -0700 In-Reply-To: <20200402053617.826678-2-jbwyatt4@gmail.com> References: <20200402053617.826678-1-jbwyatt4@gmail.com> <20200402053617.826678-2-jbwyatt4@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-04-01 at 22:36 -0700, John B. Wyatt IV wrote: > Fix 4 over 80 char warnings by caching long enum values into local > variables. > > All enums are only used once inside each function (and once inside > the entire file). > > Reported by checkpatch. > > Signed-off-by: John B. Wyatt IV > --- > drivers/staging/gasket/apex_driver.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c > index 46199c8ca441..f48209ec7d24 100644 > --- a/drivers/staging/gasket/apex_driver.c > +++ b/drivers/staging/gasket/apex_driver.c > @@ -253,6 +253,8 @@ static int apex_get_status(struct gasket_dev *gasket_dev) > /* Enter GCB reset state. */ > static int apex_enter_reset(struct gasket_dev *gasket_dev) > { > + int idle_gen_reg = APEX_BAR2_REG_IDLEGENERATOR_IDLEGEN_IDLEREGISTER; > + This indirection only makes the code more difficult to understand. > if (bypass_top_level) > return 0; > > @@ -263,7 +265,7 @@ static int apex_enter_reset(struct gasket_dev *gasket_dev) > * - Enable GCB idle > */ > gasket_read_modify_write_64(gasket_dev, APEX_BAR_INDEX, > - APEX_BAR2_REG_IDLEGENERATOR_IDLEGEN_IDLEREGISTER, > + idle_gen_reg, > 0x0, 1, 32); > > /* - Initiate DMA pause */ > @@ -395,11 +397,12 @@ static int apex_device_cleanup(struct gasket_dev *gasket_dev) > u64 scalar_error; > u64 hib_error; > int ret = 0; > + int status = APEX_BAR2_REG_SCALAR_CORE_ERROR_STATUS; > > hib_error = gasket_dev_read_64(gasket_dev, APEX_BAR_INDEX, > APEX_BAR2_REG_USER_HIB_ERROR_STATUS); > scalar_error = gasket_dev_read_64(gasket_dev, APEX_BAR_INDEX, > - APEX_BAR2_REG_SCALAR_CORE_ERROR_STATUS); > + status); > > dev_dbg(gasket_dev->dev, > "%s 0x%p hib_error 0x%llx scalar_error 0x%llx\n", > @@ -584,6 +587,8 @@ static int apex_pci_probe(struct pci_dev *pci_dev, > ulong page_table_ready, msix_table_ready; > int retries = 0; > struct gasket_dev *gasket_dev; > + int page_table_init = APEX_BAR2_REG_KERNEL_HIB_PAGE_TABLE_INIT; > + int msix_table_init = APEX_BAR2_REG_KERNEL_HIB_MSIX_TABLE_INIT; > > ret = pci_enable_device(pci_dev); > if (ret) { > @@ -606,10 +611,10 @@ static int apex_pci_probe(struct pci_dev *pci_dev, > while (retries < APEX_RESET_RETRY) { > page_table_ready = > gasket_dev_read_64(gasket_dev, APEX_BAR_INDEX, > - APEX_BAR2_REG_KERNEL_HIB_PAGE_TABLE_INIT); > + page_table_init); > msix_table_ready = > gasket_dev_read_64(gasket_dev, APEX_BAR_INDEX, > - APEX_BAR2_REG_KERNEL_HIB_MSIX_TABLE_INIT); > + msix_table_init); > if (page_table_ready && msix_table_ready) > break; > schedule_timeout(msecs_to_jiffies(APEX_RESET_DELAY));