From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9069C8300B for ; Wed, 29 Apr 2020 04:56:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 839812072A for ; Wed, 29 Apr 2020 04:56:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=rylan.coffee header.i=@rylan.coffee header.b="NquLEErk"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HP/TZYcC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726773AbgD2EzT (ORCPT ); Wed, 29 Apr 2020 00:55:19 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:51847 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726619AbgD2EzT (ORCPT ); Wed, 29 Apr 2020 00:55:19 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 818D35C03A3; Wed, 29 Apr 2020 00:55:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 29 Apr 2020 00:55:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rylan.coffee; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=/qkEJFxQQnd+DohDVJwiAH2Q88T 56mCRQ/dGzRWSAe0=; b=NquLEErkc+H3mfU66c2KdmdeMbGYLKw8iHHObVYhCx1 L1FeY0fhdsWfuPUERh5Y/MHfM0QsB2l5Wi4maeLXWwogeCU2q8H8CxzcUldzCNFQ ZnFYzdTYxIKEIkNSgln2Qi/IS1FFf0b1FmXbdU1E3oPl4DGh2Euut5LEyC8Ro8SU SK8AWX10XObr59hLZ0SHZSO35AJiX60+eaauKJmofi4CAfOnGPqgLl1AXj9R21y7 24Ono03VnXXNZ0cZ3UZgX5PwuOQZrdLbrVuHVPfPdkQxQH3LCPcypDeEz8WZ0F1o Lc6ROSMGhIqK1q+HAng0nbxXdT7cqcM6euBDJk6llFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=/qkEJF xQQnd+DohDVJwiAH2Q88T56mCRQ/dGzRWSAe0=; b=HP/TZYcChIkCuJFrXQnDtr lpV55mIILTGUQI1glACIz4aeCfSe5TlNzhE++8PnKcfg5YncJVxoSY78i35W84Ga 71kFJS63X78JlcWu3LC0kfBQjMvVDvq1FpBY20Aq3ZESjjqPxfx9QKfxGMF9sgTM MWJcEo9QdblAMoudhGFMor4sIcIUsB6cnIcOQcQFRUsxxhq3JEImGqdTWj3BX9Zp qWsF5wohZPSIxQw7UwESKGeB5WvAJgdREkZcqMDmi3G5do4VFK1uYRjuaPJYavTi EmuS9UD0r4o/cDlaDLxnz3cm+OM5hrejtkcH7hr7k7ox4AmCk1xWv2YKhlR9CJrA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedriedvgdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtjeenucfhrhhomheptfihlhgrnhcu ffhmvghllhhouceomhgrihhlsehrhihlrghnrdgtohhffhgvvgeqnecukfhppedutdekrd egledrudehkedrkeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepmhgrihhlsehrhihlrghnrdgtohhffhgvvg X-ME-Proxy: Received: from athena (pool-108-49-158-84.bstnma.fios.verizon.net [108.49.158.84]) by mail.messagingengine.com (Postfix) with ESMTPA id A59A83280069; Wed, 29 Apr 2020 00:55:17 -0400 (EDT) Date: Wed, 29 Apr 2020 00:55:16 -0400 From: Rylan Dmello To: Joe Perches Cc: Manish Chopra , GR-Linux-NIC-Dev@marvell.com, Greg Kroah-Hartman , netdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] staging: qlge: Remove multi-line dereferences from qlge_main.c Message-ID: <20200429045516.GA2421@athena> References: <0dcf9712a49968da1935061de130bc3668e63088.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0dcf9712a49968da1935061de130bc3668e63088.camel@perches.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Apr 28, 2020 at 09:31:10PM -0700, Joe Perches wrote: > On Wed, 2020-04-29 at 00:04 -0400, Rylan Dmello wrote: > > Fix checkpatch.pl warnings: > > > > WARNING: Avoid multiple line dereference - prefer 'qdev->func' > > WARNING: Avoid multiple line dereference - prefer 'qdev->flags' > > Assuming you are doing this for exercise: > > It'd be better to unindent all the switch/case > blocks for the entire function so more functions > fit on single lines > > switch (foo) { > case bar: > { > ...; > > should be: > > switch (foo) { > case bar: { > ...; > > goto exit; might as well be break; and remove > the exit label too. > Thank you - I noticed that clang-format unindented the switch-case blocks, but wasn't sure whether to include that in this patch set or not. I will send a V2 patch that unindents these switch-case blocks throughout the two functions listed here, and also removes the exit label from this function. > > Signed-off-by: Rylan Dmello > > --- > > drivers/staging/qlge/qlge_main.c | 9 ++++----- > > 1 file changed, 4 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c > > index d7e4dfafc1a3..10daae025790 100644 > > --- a/drivers/staging/qlge/qlge_main.c > > +++ b/drivers/staging/qlge/qlge_main.c > > @@ -396,8 +396,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type, > > * the route field to NIC core. > > */ > > cam_output = (CAM_OUT_ROUTE_NIC | > > - (qdev-> > > - func << CAM_OUT_FUNC_SHIFT) | > > + (qdev->func << CAM_OUT_FUNC_SHIFT) | > > (0 << CAM_OUT_CQ_ID_SHIFT)); > > if (qdev->ndev->features & NETIF_F_HW_VLAN_CTAG_RX) > > cam_output |= CAM_OUT_RV; > > @@ -3432,9 +3431,9 @@ static int ql_request_irq(struct ql_adapter *qdev) > > &qdev->rx_ring[0]); > > status = > > request_irq(pdev->irq, qlge_isr, > > - test_bit(QL_MSI_ENABLED, > > - &qdev-> > > - flags) ? 0 : IRQF_SHARED, > > + test_bit(QL_MSI_ENABLED, &qdev->flags) > > + ? 0 > > + : IRQF_SHARED, > > intr_context->name, &qdev->rx_ring[0]); > > if (status) > > goto err_irq; >