Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3987368rwl; Tue, 28 Mar 2023 00:34:41 -0700 (PDT) X-Google-Smtp-Source: AKy350bGnu2Ztz+l8CmJNMiJsYBZhrCMGmDYmHMJVK+H9OTvp1vB5LwSgAEZg3qdtrg6yTn//9yL X-Received: by 2002:a17:903:1d1:b0:1a0:76d1:545c with SMTP id e17-20020a17090301d100b001a076d1545cmr21946804plh.10.1679988881392; Tue, 28 Mar 2023 00:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679988881; cv=none; d=google.com; s=arc-20160816; b=k7Lg34jhexhKFePgXGgRtVbJCsKld9CefeCVs3QWfVDqj892DJCm3oiJAwkP0yqkiV rKSyikd0QqsxmnJB4Qyc+kPEQ2IPGn/hBBMbYOHD8P0TUkGqneVSbwJoiAlOS9v8WHof j0d50HAxVx/dIG3iCyomz9c7JO7lTVxeJKI1kqd+vWBnXfQF5458dhBcyqUAsqBEo87v 2ihuvqAuaSdI6oSGP+lV3zot1jRCTWskIo/tpQotFmEc6yyS4twLZaOWJ/oorI/TH4iS PJw4VxqmiQBtYa7pJPdPxpXViGbavB7m7DmlMCpRN+0pzyWBrliGVypw3Y8IE+f8JH5K nGNw== 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=pEALrOXc52gKsTn2OncrXyRPIgHxMGfS3XCj7g7S3bM=; b=Asb7fb7/5aTPP50ux/azl7xDsQSMupF0s7wdymNN4kpo4A21jkR+RQe8J/MZYY+Taz nFIXDrkvgyGm+J+/nEo2aGS4aavD+ul0b1bYr70+gwP87QAm4t8Xbuj6lncoUN/L8sbR 9dIv4dFqOzF/9tDiitgcJSLZbGUtB6qmYVeJfQ3ZYGNMxLpBBgYBOTzSwGrE8l4U2uIK JsUYzIS6eRSkAGTAfLRJ+kw7Z8tq8LN/0CNKtOx8k1JGCx1U+ru8TRVy1x8WMz3vlO3s T1mps9DGC7mK0sgIHAHo+wXt9Nsn+aorQP4HpJARFc57qTvA6KDoKFHeicwXIAjRWxeg PkTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FT1w0kRA; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a170902848400b0019ef86c257asi28555129plo.241.2023.03.28.00.34.29; Tue, 28 Mar 2023 00:34:41 -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=@gmail.com header.s=20210112 header.b=FT1w0kRA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230315AbjC1Hdm (ORCPT + 99 others); Tue, 28 Mar 2023 03:33:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbjC1Hdi (ORCPT ); Tue, 28 Mar 2023 03:33:38 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 202FA3C1D for ; Tue, 28 Mar 2023 00:33:30 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id r11so11079976wrr.12 for ; Tue, 28 Mar 2023 00:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679988808; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pEALrOXc52gKsTn2OncrXyRPIgHxMGfS3XCj7g7S3bM=; b=FT1w0kRA2s5NiRw3V1gbTmpedbwG7mGzbgKKFn6qwNEataJGR/ZnyqxEqiFGsOf30i ML6F4XWW+Z7XpC31p3drbfyLZ51oau2ZlTz2nyF4iA47Txf3RvNExXlR8EkOvnNBj+UT SSsX+DBcogeqgimGK1GCrTXmKXnJgWMurj+9TyQG1NV5clg010f711tzm/gjQLUsJQO9 s+K2eoP2rzo7Yg38G1bU2lXzzKTfZsEDdL9UbFtthDRPBf+j3Wx5bOTaCA/1M21TaY6X sd3qGnNJuQA6klpkwB+CPDfiZtzFrZSeg9xaXKJ3pRhf+3lSZipBPA9ztVC+1Oj1RP8b tIxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679988808; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pEALrOXc52gKsTn2OncrXyRPIgHxMGfS3XCj7g7S3bM=; b=Nto1L1weA7Az7PA752XQD2GCL7lhCWMW178UI8lCdvaLM+zTcNTo9/bP011WRIwFIY D2Zsl+ynhHXQORc51psDQb7Socz2kWLQ6Hjzuq3Z6e+kWi9I9rKEGLGPiFlIB11My0PP 6NKX4vFP9RnsO0m90U1fARuTmdY4d80aed1dHAIjwNUopY46V3cpF4kytD43HHfTx/Eo aMt8gBGjQTopS6G+Bq9AqBpPICWfANrH34o5Qo8DwKHUNMDi7Xq0LbQHFf+Fptg8puQw tsE5qGChcHfhI7uw2cqunI+IMiSqvsaIs7HRyWitqPp6+rg9wZsZGt7GhIPqIAQfyR5G P27Q== X-Gm-Message-State: AAQBX9drIde798fh8nhP0PNZxSWwtWwv5QS/ntoG2ofD8i5c4nq47fZq /NH7E0/2XuGhmK61XZci46A= X-Received: by 2002:a5d:6744:0:b0:2d0:d739:e37e with SMTP id l4-20020a5d6744000000b002d0d739e37emr12493068wrw.40.1679988808484; Tue, 28 Mar 2023 00:33:28 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id a10-20020a056000050a00b002d78a96cf5fsm19812481wrf.70.2023.03.28.00.33.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 00:33:28 -0700 (PDT) Date: Tue, 28 Mar 2023 10:33:23 +0300 From: Dan Carpenter To: Khadija Kamran 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=0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 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 > } > } > } > @@ -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 >