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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A735BC83F01 for ; Sat, 26 Aug 2023 12:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rFZ6SmLT4eENVkvqMYt9wn73Y6nrf3yLHTo2XzGFYt4=; b=WZf0I/G1uRxT9o EKp3BnNULygX6jWIolqV9EL6uXObBkkHeym5Z7ASN8ITewzYPyiykjfeih+vtXT8q1uKjahLKZBtf q+GgQHR976pq3ljKXzgBv59wYQmabQsSa8sEryckLne6kS+WLH9Sw2GRPstmw5cwZqeeJJxB7OlC7 JsGx2/lPwI8+zZlwgLq/vrKJ+OtnMjzW47tN/TCkJJoH4CYEpRw1MLVbZ6pjCGyHlK8bIZAGGXvKI q9JVS5bPcBmWU4sOCeBuLXX9pILv8VpToxNQlTzeQwmGZAJqJ35QpTJLWsmyhuxO/jngdAGK3mEOv YfTEgngab1/m10Wi6IKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qZsl8-006txt-1l; Sat, 26 Aug 2023 12:51:22 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qZsl4-006tww-2O for linux-arm-kernel@lists.infradead.org; Sat, 26 Aug 2023 12:51:20 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 945471FB; Sat, 26 Aug 2023 05:51:50 -0700 (PDT) Received: from pluto (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5692A3F64C; Sat, 26 Aug 2023 05:51:08 -0700 (PDT) Date: Sat, 26 Aug 2023 13:50:58 +0100 From: Cristian Marussi To: Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, etienne.carriere@linaro.org, peng.fan@oss.nxp.com, chuck.cannon@nxp.com, souvik.chakravarty@arm.com, nicola.mazzucato@arm.com, Michael Turquette , linux-clk@vger.kernel.org Subject: Re: [PATCH 1/6] firmware: arm_scmi: Simplify enable/disable Clock operations Message-ID: References: <20230811161446.636253-1-cristian.marussi@arm.com> <20230811161446.636253-2-cristian.marussi@arm.com> <17bd83d833b59fd4f64eec433589fa55.sboyd@kernel.org> <4870d94375cfdf6c0ba4d4b5cb3b6dc3.sboyd@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4870d94375cfdf6c0ba4d4b5cb3b6dc3.sboyd@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230826_055118_850401_08C4AFB9 X-CRM114-Status: GOOD ( 19.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 24, 2023 at 11:43:35AM -0700, Stephen Boyd wrote: > Quoting Cristian Marussi (2023-08-24 07:25:21) > > On Wed, Aug 23, 2023 at 11:01:17AM -0700, Stephen Boyd wrote: > > > > > > Perhaps we need a local variable to make it more readable. > > > > > > static int scmi_clk_enable(struct clk_hw *hw) > > > { > > > bool can_sleep = false; > > > struct scmi_clk *clk = to_scmi_clk(hw); > > > > > > return scmi_proto_clk_ops->enable(clk->ph, clk->id, can_sleep); > > > } > > > > > > This let's the reader quickly understand what the parameter means. I'm > > > OK with adding the function parameter, but a plain 'true' or 'false' > > > doesn't help with clarity. > > > > Thanks for the suggestion, it would help definitely making it more > > readable, maybe a local define or enum could make it without even > > putting anything on the stack. > > > > Surely the compiler can optimize that so there isn't stack local > storage for a local variable used as an argument to a function call? Yes indeed the compiler will certainly drop anything at the end, but still I'd have to fill with local vars definitions all the related functions just to be able to make them more readable while I can improve the readability also by just adding a pair descriptive defines to use all over. I'll send a V2 and then you tell if it is fine for you. Thanks Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel