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=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 23C1EC433DF for ; Thu, 9 Jul 2020 09:51:02 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 DF05E20708 for ; Thu, 9 Jul 2020 09:51:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aJhWqBzJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF05E20708 Authentication-Results: mail.kernel.org; dmarc=none (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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=c6qzGccn1eVBxKHxqcs+4Bz484vG4hggHU5rGFZXH1Q=; b=aJhWqBzJftTHSeME2sMQKFTQY D7NsMLAcS0fmEXGrgppxcN1FPhkK9X1jpfmA29F8n/NEJYDeY7TQxYCgw0IDZY8RRUCcG81hQ2fFO JZ82nAmb/mCBgzVU2pwHMAsWIa8SfAlgrYsBywxTDLhudTzdLRE/5b05kDnJWxcm+i74VQFIRXQH8 jidjjY8MgShA1Nn7JSw9zI/ZWO6Ry9UKuQw5TTFnvjM85KR2yQmu0DLQlBlYZ4N2Rz+A48NG2zbAI 7I4t70uM/cYVVpTYFzGBMFtckKfq9WX/WX6ymVeb2/Dl9ExE+LeSK+ZEIybNlXTf8+cYj1jTmFChh eNJjsEcIw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtT9J-0000mj-Rs; Thu, 09 Jul 2020 09:47:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtT9H-0000m9-Vg for linux-arm-kernel@lists.infradead.org; Thu, 09 Jul 2020 09:47:24 +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 8CD3231B; Thu, 9 Jul 2020 02:47:18 -0700 (PDT) Received: from bogus (unknown [10.37.8.63]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8885D3F887; Thu, 9 Jul 2020 02:47:16 -0700 (PDT) Date: Thu, 9 Jul 2020 10:47:13 +0100 From: Sudeep Holla To: Dien Pham Subject: Re: [PATCH 1/2] firmware: arm_scmi: Keep the discrete clock rates sorted Message-ID: <20200709094713.GD31544@bogus> References: <20200708110725.18017-1-sudeep.holla@arm.com> <20200709083808.GB31544@bogus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-20200709_054724_076572_74557732 X-CRM114-Status: GOOD ( 16.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Boyd , Michael Turquette , "linux-kernel@vger.kernel.org" , Sudeep Holla , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" 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, Jul 09, 2020 at 08:53:44AM +0000, Dien Pham wrote: > Dear Sudeep-san, > > > > >+} > > > >+ > > > > static int > > > > scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id, > > > > struct scmi_clock_info *clk) @@ -184,8 +193,10 @@ > > > >scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id, > > > > */ > > > > } while (num_returned && num_remaining); > > > > > > > >- if (rate_discrete) > > > >+ if (rate_discrete) { > > > > clk->list.num_rates = tot_rate_cnt; > > > >+ sort(rate, tot_rate_cnt, sizeof(*rate), rate_cmp_func, NULL); > > > > > > About warning of above line, I think it relates to below snip of code: > > > if (tot_rate_cnt + num_returned > SCMI_MAX_NUM_RATES) { > > > dev_err(handle->dev, "No. of rates > MAX_NUM_RATES"); > > > break; > > > } > > > > > > > I don't understand your comment and relation to above warning. > > I'd like to mention about below warning. > > >drivers/firmware/arm_scmi/clock.c: In function 'scmi_clock_protocol_init': > >drivers/firmware/arm_scmi/clock.c:197:3: warning: 'rate' may be used uninitialized in this function [-Wmaybe-uninitialized] Ah ok, sorry I didn't see this one. I am unable to observe this in the default build, I will check with W=1. Thanks for that. > > sort(rate, tot_rate_cnt, sizeof(*rate), rate_cmp_func, NULL); > > The warning for line > > > >+ sort(rate, tot_rate_cnt, sizeof(*rate), rate_cmp_func, NULL); > > But, I think that it is affected by 'break' of below line. And for fixing > this warning, I think we should fix inside this 'if' block. OK will take a look. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel