Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5082668rwl; Tue, 28 Mar 2023 16:09:48 -0700 (PDT) X-Google-Smtp-Source: AKy350YncdCUY8iOQv+qzY/TJqDb3UkTJsDhNeNbN6wpvBssySU2M7CO8avOVi+ttVX8wJJunix1 X-Received: by 2002:a17:903:2343:b0:1a1:ee8c:eef8 with SMTP id c3-20020a170903234300b001a1ee8ceef8mr21242349plh.2.1680044988106; Tue, 28 Mar 2023 16:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680044988; cv=none; d=google.com; s=arc-20160816; b=w+/DBl+FEZqUpWXxtpBXRLhSF5OCk6UeVPm4BYLeaE0UOtlgV702+6BCKqbwGLnT14 Ka+1rv8NJ9GLtWUE4U9WISsVMAd2ohQohbsoO8g2/o/Z0HuuzX9aOCvpcHmqkENn/usy nGaKFw5+3hdKz/bWdaPuOfFJ7FVLIT6/HndPN9vBc7lMXYuFAFRRBCPEJrCukKcy1cx7 HWUzszsLKhCb5zR6uj8aKCwVRGgT76ehLcOzm6Q89N6NiE8P1MW3iJrkrpZJXulPkirO EH8wIDDm67Ui+JCneyFhxqz2UIs0PnVZ27+IwVWPCBYRrbgM3YBsI0775DPt90J+aySB ngfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mv/1XU5eWHfQjaWrQVqPXw2SlriO8XNlCaCDUI0QZXQ=; b=q65qb64fR3NgplVMjDEisUkZlupdwT/bNyS5Z/ikiVB2/Xoq7lCo3yvU5/D8vxJHE6 QnwlTLnJgyFc+aJF2fX85UAcXigBKrgf2HaFk4SqCzj2ADFo/RmvQSivlgwGCblNXDwr YCuRAlcvY8kDWwjLu0Yjc7VGlHTCAxcaWPyFTlrMFk0t/j8SMRVwY/QtW4xazVGQc3Q7 0+GehO0G2gjomuAjiApyB+6uKw3dR5UonzrUqgHLobHvLy+Orv2VRoRmDcP9PaxwgD53 Md1A80e+Yk+f9ErPHHq+j7mKFuLGHJrkro9O6jxDM7e55/dnliR8uqCvaaLk5vPF1Gqh YwoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SeIpoXZ8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f1-20020a6547c1000000b0050bea56f69asi30504236pgs.735.2023.03.28.16.09.35; Tue, 28 Mar 2023 16:09:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SeIpoXZ8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbjC1XEj (ORCPT + 99 others); Tue, 28 Mar 2023 19:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjC1XEh (ORCPT ); Tue, 28 Mar 2023 19:04:37 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20988268A for ; Tue, 28 Mar 2023 16:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680044676; x=1711580676; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Pezn8xNxurkZBFxsQdb+ZWL+d/jfpSEsRx1iVibRi7M=; b=SeIpoXZ8GGzXPCbXXXDsGTU8sFlFFhqAILgQMyQmmoM/k1FT2QlCwB72 DCT/v/sIIuVnloaQaipqoeQ8iqgj3aCbrXnPPoyohtV3jqOOLc0miqvA1 lxk6pKEuUpZI3W5a7W3QhLRXLSXEvy1wjhVeuUf4u5Swv+co3Cec2Ck4d 4let9r/UKl3qCjilZIzWCVyjoyt0OvKOyuJZJUG+t4Qcbs3Hvtxcfs68o Js1d8bj/8EkQvajyVKHZvfDsCYTG6nRyTngiiPuRvlzJDPXXTzgbbRWZ1 5Uuh19p/XjASSAeRSM4ZelblVop7527RHmfE7A8VSP5x00gh2K6wSuLxM w==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="368486620" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="368486620" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 16:04:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="686603765" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="686603765" Received: from aschofie-mobl2.amr.corp.intel.com (HELO aschofie-mobl2) ([10.209.62.61]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 16:04:34 -0700 Date: Tue, 28 Mar 2023 16:04:33 -0700 From: Alison Schofield To: Khadija Kamran , Dan Carpenter Cc: outreachy@lists.linux.dev, Vaibhav Hiremath , Johan Hovold , Alex Elder , Greg Kroah-Hartman , greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: greybus: refactor arche_platform_wd_irq() function Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 28, 2023 at 10:33:23AM +0300, Dan Carpenter wrote: > On Tue, Mar 28, 2023 at 01:18:53AM +0500, Khadija Kamran wrote: > > Refactor function by adding goto statement. This reduces the > > indentation and fixes the issue reported by checkpatch.pl script. > > > > "CHECK: line length of 101 exceeds 100 columns" > > > > Signed-off-by: Khadija Kamran > > --- > > drivers/staging/greybus/arche-platform.c | 11 ++++++----- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c > > index fcbd5f71eff2..c7d3b6f7368f 100644 > > --- a/drivers/staging/greybus/arche-platform.c > > +++ b/drivers/staging/greybus/arche-platform.c > > @@ -178,11 +178,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void *devid) > > */ > > if (arche_pdata->wake_detect_state != > > WD_STATE_COLDBOOT_START) { > > - arche_platform_set_wake_detect_state(arche_pdata, > > - WD_STATE_COLDBOOT_TRIG); > > - spin_unlock_irqrestore(&arche_pdata->wake_lock, > > - flags); > > - return IRQ_WAKE_THREAD; > > + goto out; > > I don't like this goto. > > It suggests that calling arche_platform_set_wake_detect_state(arche_pdata, WD_STATE_COLDBOOT_TRIG); > is a part of a shared exit path when that is not true so it is sort of > lying to the reader and making things harder to understand. > > Unlocking is shared. goto unlock is fine. But that doesn't help with > the very long lines. (I am not saying that goto unlock is a worthwhile > patch to send but I would definitely have found it tolerable). > > regards, > dan carpenter Khadija, While you are reworking this, just wanted to note that, once 'out:' becomes the single exit path for the function, it won't be a lie any more. So you will have addressed Dan's concern. Alison > > > } > > } > > } > > @@ -205,6 +201,11 @@ static irqreturn_t arche_platform_wd_irq(int irq, void *devid) > > spin_unlock_irqrestore(&arche_pdata->wake_lock, flags); > > > > return IRQ_HANDLED; > > + > > +out: > > + arche_platform_set_wake_detect_state(arche_pdata, WD_STATE_COLDBOOT_TRIG); > > + spin_unlock_irqrestore(&arche_pdata->wake_lock, flags); > > + return IRQ_WAKE_THREAD; > > } > > > > /* > > -- > > 2.34.1 > > >