From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6CF11383; Mon, 20 Mar 2023 08:53:22 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id er8so31903979edb.0; Mon, 20 Mar 2023 01:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679302401; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=CSur2724Mrb+t2O165F/BN6jWN51XTSV+JAwdxRyZN0=; b=HtN7OaOaVn8D25XKoV7oyiJWUZl790qSN5SbGGws1TIykkdNweRUTVRhIB1VmtUHbG X3rrND9fEoKsd/V7KKgqV6RcENuMAsQr73/zK/LBj8GIm4HoXflUn23Ai61cybHckB+w 0qr5VHUA9vmZt8PzmV6iprXrXFKSAcLdec1MYeMZ48JmItqa6MgoXhf3zULptmQ1Cw54 7l7Q6KISU3yCkbwMJ9yt1yDP2uAx0zK+1gCnuH8dN1gdXsB7Votre8aOzJb9O51w4iPg 03GR5VaLw1HMmHyS+EtWTfGV2aCDLonOuX57risk7aoDMYJVomfhlwgMdaMt6AV8SEM+ F0Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679302401; h=in-reply-to:content-transfer-encoding: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=CSur2724Mrb+t2O165F/BN6jWN51XTSV+JAwdxRyZN0=; b=1m4tb68BlUkDuKhU7rbkea70q7zOXdpVUezN0+hzVvEQzcFROZzSNhs/lxbqieCVa3 TkbFgKF+11fhtoqf2iJ0/jmGjHe1OXidcO1wB0pcKhhQ1sxZmCI69lf83WzQACMIipdK +gcmM7pZ/Wy/EharfFdtD48sY5D9mRQ/ZYxJtyyCdIPz87HZkttPVL7ijy0ppqp9jKRi rYKAtO+wv0kHka5UpWlCorjKfx6CounTdaBXEe9N4Bm21uJECidfUnAfhf/zcrQIvXC9 V3ZkOXRGnC8I8WKf6ZLL+H4mEtw052Eg+nuH62ovIc9shMBP5wCmXAIqSeu+2lUY8leA /S6w== X-Gm-Message-State: AO0yUKUUfIHrkZr9nn79tDiBZmHYEoK74n2XSKT9KcKf8kLhWsfZ20VI ycgYXAQF8b4cZLAR6WmX+ok= X-Google-Smtp-Source: AK7set9pXllFdkoHzA8sdpIZJzcBcpJTv8PFDi87umJRA+YksZIIVd0ezRSV46JAJnTPD1fWINCqjQ== X-Received: by 2002:aa7:c049:0:b0:4fd:21a6:a649 with SMTP id k9-20020aa7c049000000b004fd21a6a649mr11200682edo.40.1679302400922; Mon, 20 Mar 2023 01:53:20 -0700 (PDT) Received: from khadija-virtual-machine ([39.41.14.14]) by smtp.gmail.com with ESMTPSA id j30-20020a508a9e000000b004af5968cb3bsm4474230edj.17.2023.03.20.01.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 01:53:20 -0700 (PDT) Date: Mon, 20 Mar 2023 13:53:18 +0500 From: Khadija Kamran To: Ira Weiny 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 v2] staging: greybus: remove tabs to fix line length and merge lines Message-ID: References: <640e75cfd8fc_229a89294a3@iweiny-mobl.notmuch> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <640e75cfd8fc_229a89294a3@iweiny-mobl.notmuch> On Sun, Mar 12, 2023 at 06:01:03PM -0700, Ira Weiny wrote: > Khadija Kamran wrote: > > In file drivers/staging/greybus/arche-platform.c, > > - Length of line 181 exceeds 100 columns, fix by removing tabs from the > > line. > > - If condition and spin_unlock_...() call is split into two lines, join > > them to form a single line. > > > > Signed-off-by: Khadija Kamran > > Fundamentally the problem with arche_platform_wd_irq() is that the > indentation is too great. > > "... if you need more than 3 levels of indentation, you’re screwed anyway, > and should fix your program." > > -- https://www.kernel.org/doc/html/v4.10/process/coding-style.html#indentation > > I think a better solution would be to refactor the entire function. This > would make the logic of the function more clear as well IMHO. > > Here is another tip to help: > > https://www.kernel.org/doc/html/v4.10/process/coding-style.html#centralized-exiting-of-functions > > Do you think you could try that? Hey Ira! Sorry about the late reply. Thank you for your feedback. I have looked into the above link. Are you referring to the use of goto statements in arche_platform_wd_irq() call? Thank you! Regards, Khadija > Ira > > > --- > > Changes in v2: > > - Change the subject and log message > > - Merge if condition and spin_unlock...() from two lines to one > > drivers/staging/greybus/arche-platform.c | 8 +++----- > > 1 file changed, 3 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c > > index fcbd5f71eff2..00ed5dfd7915 100644 > > --- a/drivers/staging/greybus/arche-platform.c > > +++ b/drivers/staging/greybus/arche-platform.c > > @@ -176,12 +176,10 @@ static irqreturn_t arche_platform_wd_irq(int irq, void *devid) > > * Check we are not in middle of irq thread > > * already > > */ > > - if (arche_pdata->wake_detect_state != > > - WD_STATE_COLDBOOT_START) { > > + 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); > > + WD_STATE_COLDBOOT_TRIG); > > + spin_unlock_irqrestore(&arche_pdata->wake_lock, flags); > > return IRQ_WAKE_THREAD; > > } > > } > > -- > > 2.34.1 > > > > > >