Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1667291pxb; Fri, 20 Aug 2021 10:51:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTaA1cZvmnh62niKk3TtS/rry9eIke7Qsec/uyE/TbMlWRe7WhkksGcCzFENarQy8T0Sqi X-Received: by 2002:a02:9484:: with SMTP id x4mr18780402jah.68.1629481887118; Fri, 20 Aug 2021 10:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629481887; cv=none; d=google.com; s=arc-20160816; b=ltplG2O+Y7t8WcLz5w2SSS4j6vP5TqCxNtUkj/D7xAVsFAf06KS8tIx9BgLMknq7en H17I11R2GYxmcEgWlSTfQuInIgnGCjhc5sKHZsag7+zdxB/IPrhabvs3nyHzs06dIMaI gmb1q4ECaW80wV+KU6thrlXEH/Hd+txLwjVn5dLWKOgp2gYcvw2rRDiMN1qVC+jEFzht MUAVnNgkATbE4lSELy2P4z1D89tUVxAyCCHCY3mOcI1KJdDiQ7J4QewnFLT8A6anO0i9 NWmZVWb18nIAAXTab/VINtGziA6/7S05/11UYUv0nlZNm8LoNC0VI/SgifrOZgTWoRpw dWMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8g5gWRCq88/BlPvTxGIh0QRE5pCHUL6wXTt7OaVUmGY=; b=ss0yigK6aCSDM1GE5vYSAwg5w7AanQeHVbh2S45G3rk7q3kb/rdsOxnBermFV+BM7i ZxeCkedY+TSBjk6VnpL/RvqsgHUuMKkcSlEKyNIZ6p3ur2N+WK5kWy4hjpXOyi+vV/1F v3VmV5C750gdJGJUfLFZlidJs7+HjQbevquLzGWE3oec6g5QRThOvHtKAJ8+Qv+h/oXL NpVTU6EGT+H8Eo5l/eDlnOabTGhJp4k3yTvSp/QSP7+jfHExkqyFVjMLxgDEaTwm35DZ CbfSX1FtZaxsiMKZwJrHWGeYD+T0WxncZ1GMVwl/PoM7CIE5ttWsVcy2Mv22z38Z/ANU MikQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nYhayd58; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si7516442jat.46.2021.08.20.10.51.15; Fri, 20 Aug 2021 10:51:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nYhayd58; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234942AbhHTRuE (ORCPT + 99 others); Fri, 20 Aug 2021 13:50:04 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:41084 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234160AbhHTRuD (ORCPT ); Fri, 20 Aug 2021 13:50:03 -0400 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-Type: text/plain; charset="us-ascii" 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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