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.9 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 D7480C4338F for ; Fri, 20 Aug 2021 17:51:21 +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 A0C7861053 for ; Fri, 20 Aug 2021 17:51:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A0C7861053 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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=jb/x2q/CO2/pfbNAu/jbiZXl1Vz0gPuds4K/36R3xIE=; b=kbpsnfbJ2eeexE h8MBFFLxkBgpTT3W4quQQlFs/ItOh6fPNMXzkLNwMrOheDNIGZ4seuW9uhizqgz+5yn0owGpWpRL8 5MnahvWRz/2+2cbQVpoQBqTKnAVXWRBFSmLrmXiZwyN81xJUkv4ETKnIdfAH0ITVRLmKibhGDqlQd PRyDG7uwWmxfnKedKPuTO9kfB4QeSrXhfA4YESRn+EejwCFvHFANuUIVQTqc5BWYWtf5Nj3LWr5br niX5cgt3XWmHMKDjUnoWiersRmnetFmnu/LV/rcpFA599OWz1kxSOD+hFlEToqc5IXuh0SBn2noIE MVuh2crDvS0H+JpK4EnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mH8dz-00BlB0-DM; Fri, 20 Aug 2021 17:49:27 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mH8dt-00Bl9s-0u for linux-arm-kernel@lists.infradead.org; Fri, 20 Aug 2021 17:49:24 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 17KHnIMj003405; Fri, 20 Aug 2021 12:49:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1629481758; bh=8g5gWRCq88/BlPvTxGIh0QRE5pCHUL6wXTt7OaVUmGY=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=nYhayd58YsoiTk3IlGeM38CwZYtaG4h3XX+f9F664KZJQF79DXNIRCX4VvNQ8+CMg Ngd8rCnjHsAVRzipNeMFMbp9qPWZZgz5PYCiFOCrLDpMFoaFADxIudwPWWBJ+z2pLy kFKoBDYq+JdNMApOwz6DtHYSygkMOg0vmAG9D5rI= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 17KHnIQV058919 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 20 Aug 2021 12:49:18 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 20 Aug 2021 12:49:17 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Fri, 20 Aug 2021 12:49:17 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 17KHnHR8122874; Fri, 20 Aug 2021 12:49:17 -0500 Date: Fri, 20 Aug 2021 12:49:17 -0500 From: Nishanth Menon To: jing yangyang CC: Tero Kristo , Santosh Shilimkar , Michael Turquette , Stephen Boyd , , , , jing yangyang , Zeal Robot Subject: Re: [PATCH linux-next] clk/keystone: fix application of sizeof to pointer Message-ID: <20210820174917.4emwkb75i2yydm7c@expel> References: <84a6ba16686347099a3dab2e5161a930e792eb6e.1629198281.git.jing.yangyang@zte.com.cn> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <84a6ba16686347099a3dab2e5161a930e792eb6e.1629198281.git.jing.yangyang@zte.com.cn> User-Agent: NeoMutt/20171215 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210820_104921_193317_3D9A5E17 X-CRM114-Status: GOOD ( 17.43 ) 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 19:20-20210819, jing yangyang wrote: > sizeof when applied to a pointer typed expression gives the size of > the pointer. > > ./drivers/clk/keystone/sci-clk.c:398:8-14: ERROR application of sizeof to pointer > > This issue was detected with the help of Coccinelle. > > Reported-by: Zeal Robot > Signed-off-by: jing yangyang > --- > drivers/clk/keystone/sci-clk.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/clk/keystone/sci-clk.c b/drivers/clk/keystone/sci-clk.c > index 7e1b136..010a61a 100644 > --- a/drivers/clk/keystone/sci-clk.c > +++ b/drivers/clk/keystone/sci-clk.c > @@ -395,7 +395,7 @@ static struct clk_hw *sci_clk_get(struct of_phandle_args *clkspec, void *data) > key.clk_id = clkspec->args[1]; > > clk = bsearch(&key, provider->clocks, provider->num_clocks, > - sizeof(clk), _cmp_sci_clk); > + sizeof(*clk), _cmp_sci_clk); I am trying to understand this.. bsearch uses base + size to do iteration, provider is sci_clk_provider ->num_clocks is struct sci_clk ** same as clk. iteration is done on provider->clocks .. not on *clk, am I missing something? or is it one of those testing patches? -- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel