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=-15.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 0E6BAC47082 for ; Tue, 8 Jun 2021 14:57:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D2D2D61287 for ; Tue, 8 Jun 2021 14:57:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2D2D61287 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=XpqwaIaNzrOBopvzU5nbtLomeAZx5tw7Rtl7vAwK6C4=; b=O/fEl56n78tAkR CcSi41plTxzfIxm3taSBZm57f4P8GjOwKSjokH6kveXT7vBgSQYA2vNPOv9I9ypMTFWgXQuhSzRkU VcNOObft79rRd5VAW4Gd4wr8/InwUrbWo1KF0Aq7N0WN5/ziM/ll3CFZx5ED/RKNC+DIdaxlgl5NY wSylsZDuTRpGTLpZgGGO+/UgHx9QyuoPRc/XjMLcxFQ6LPuct3roj3Ss1+I+7LhL752VSfDfJ3PEW zkD3A95fawbJICMVmK24L3N1Mxl88zqGLvphubdrZscNnDv3kAZvtbAxFnffPzXeUCUrOxOVZQpgO 6N5NHbkvJqWnZ02oEXWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqd9X-0092kH-5Y; Tue, 08 Jun 2021 14:56:27 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqd9Q-0092iW-SF for linux-arm-kernel@lists.infradead.org; Tue, 08 Jun 2021 14:56:22 +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 A13906D; Tue, 8 Jun 2021 07:56:18 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 26B9B3F73D; Tue, 8 Jun 2021 07:56:18 -0700 (PDT) Date: Tue, 8 Jun 2021 15:56:11 +0100 From: Cristian Marussi To: Sudeep Holla Cc: linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] firmware: arm_scmi: Avoid multiple initialisations of hdr->protocol_id Message-ID: <20210608145611.GA35368@e120937-lin> References: <20210608140140.2042257-1-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210608140140.2042257-1-sudeep.holla@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210608_075620_986565_65B4AC41 X-CRM114-Status: GOOD ( 19.25 ) 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 Hi, On Tue, Jun 08, 2021 at 03:01:40PM +0100, Sudeep Holla wrote: > Since the hdr->protocol_id is set from the scmi_protocol_instance handle > just before the transfer, there is no need to initialise the same in > scmi_xfer_get_init. Remove the unnecessary initialisations. > > Signed-off-by: Sudeep Holla > --- > drivers/firmware/arm_scmi/driver.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c > index 80010d3f5975..1b446d076b12 100644 > --- a/drivers/firmware/arm_scmi/driver.c > +++ b/drivers/firmware/arm_scmi/driver.c > @@ -432,9 +432,9 @@ static int do_xfer(const struct scmi_protocol_handle *ph, > struct scmi_chan_info *cinfo; > > /* > - * Re-instate protocol id here from protocol handle so that cannot be > + * Initialise protocol id now from protocol handle to avoid it being > * overridden by mistake (or malice) by the protocol code mangling with > - * the scmi_xfer structure. > + * the scmi_xfer structure prior to this. > */ > xfer->hdr.protocol_id = pi->proto->id; > reinit_completion(&xfer->done); > @@ -512,8 +512,6 @@ static int do_xfer_with_response(const struct scmi_protocol_handle *ph, > const struct scmi_protocol_instance *pi = ph_to_pi(ph); This stale unused pi now causing a Warning. > DECLARE_COMPLETION_ONSTACK(async_response); > > - xfer->hdr.protocol_id = pi->proto->id; > - > xfer->async_done = &async_response; > > ret = do_xfer(ph, xfer); > @@ -569,7 +567,6 @@ static int xfer_get_init(const struct scmi_protocol_handle *ph, > xfer->tx.len = tx_size; > xfer->rx.len = rx_size ? : info->desc->max_msg_size; > xfer->hdr.id = msg_id; > - xfer->hdr.protocol_id = pi->proto->id; > xfer->hdr.poll_completion = false; > > *p = xfer; LGTM, other that the warning above, and tested fine too. Reviewed-by: Cristian Marussi Tested-by: Cristian Marussi Thanks, Cristian > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel