Received: by 2002:a05:7412:1492:b0:e2:908c:2ebd with SMTP id s18csp383174rdh; Wed, 23 Aug 2023 02:55:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQ3C2/IeYUfsVYoMJ764BeY3dR9V9Yx4RAG7rNbW9vtZhz3uo61uqUZUyu61+D5vkAMmta X-Received: by 2002:a05:6a20:729b:b0:13f:8e94:965e with SMTP id o27-20020a056a20729b00b0013f8e94965emr12035118pzk.5.1692784519376; Wed, 23 Aug 2023 02:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692784519; cv=none; d=google.com; s=arc-20160816; b=krSW3nW0Rax7OauNneXqQaQXwGF+VazVQDaOUV0pTdIaiQ/mnZBcPQjshuWE4cIayJ b7+MYFAigJUyRzbskc87JHDru/RQfiIXpGEnXukB5lgdjPJHkJA9TlvLP9PiTov9aVL8 ymkfhqIMnce3E03z2nRE08Rx7hNP8loZKml0ZdlzYM3QQcQf97oN+sHel96vchkU3CSF EN4lth63oThhDL281hnOjTPlwLn9dGphAFiOZozM6Lduf3IhRL8ZpbhidPiOTcjIhiW8 p5Ief7X7gnTYt4OEjgVYvU5bLJUXlYbplsVe+Uj2ocdazxAB6Gkpyuk4FFght+eUu5kT EUtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=WBunr8669Q7/gF+h2SolRg7arLeyRKZNroxX/UNRziQ=; fh=oAKfM4LcEmx89c1Yfn+qenaUKvScnrybYXgK0WWYkx0=; b=mkXXsvRg3SvacT93sctAYKTAC69W9VAkZvts/drqKvOuFjekHngDpFv7lzEkUfbJcs 5x96emO8pkAb9idDva/1gUDtPr+/I5ZpPbMp8+4FJ9zFaKg1TIOxgSqN5r+SXPuxttWB 10dVdVDgg/Y1HjV14PBLud6vbtEFBjKakWoQOiZ5i49Z6lGBGZGlVRz7Y25coHn5eQxC jMdn2C1PbIhgxGciQ+pvlY1VjXOv6NLGXHMTEW6XGaJgMWpbtRKRkbJ7CDhRDnpkD/Lx vXk9LM3FsLnaL8YEx55EJ6yx+13HCjv5kzTBkCg33pbF/DuQQicsEp/5t2jr91gJRGFm vnIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kFfl8kbg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a170902e54800b001b82da85c5asi11431644plf.336.2023.08.23.02.55.07; Wed, 23 Aug 2023 02:55:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kFfl8kbg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231603AbjHVXBu (ORCPT + 99 others); Tue, 22 Aug 2023 19:01:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbjHVXBt (ORCPT ); Tue, 22 Aug 2023 19:01:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C409E45; Tue, 22 Aug 2023 16:01:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EF30E638D1; Tue, 22 Aug 2023 23:01:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6F8AC433D9; Tue, 22 Aug 2023 23:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692745306; bh=5nZO/EA7xNC0zbfhm7E3kKtBi2sQs7kn8lqJX9i1moQ=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=kFfl8kbg4KZrdf2pK6oqno0lo1RVgBYPaJ1Ry7rEJ9uMjKXAx9MB/UJjCxwjzJALQ +TJR+zwHTTmUxWnGdWIT4ef8SdHbpRLYrck6r7+hRLfGlbLe0A7HxHMk+ZCbTw4QZm J6cauK3lLaooPguYa79+YfdehebtYPe1lBj9ViSkx55KLHcUsrJt+JUZhXr+fDtB2Y fCrldC8dH8GeFYAS0JVNlgYsevE/DxAV8A5OhwJ9kC7wt5SQO0KLPGWbYOBr/XUXwO MNi9GHujl40bkvfxlwevKlKa/zu70Frt82S8JiZBE4BXi8RHL4wXiAf+Xv6bBi/7E1 F60zLZ3oI2A6Q== Message-ID: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <8cfd376d48d63670882b8079c411d605@208suo.com> References: <20230721011303.4303-1-xujianghui@cdjrlc.com> <8cfd376d48d63670882b8079c411d605@208suo.com> Subject: Re: [PATCH] clk: keystone: sci-clk: fix application of sizeof to pointer From: Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org To: kristo@kernel.org, mturquette@baylibre.com, nm@ti.com, ssantosh@kernel.org, sunran001@208suo.com Date: Tue, 22 Aug 2023 16:01:43 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting sunran001@208suo.com (2023-07-20 18:14:19) > ./drivers/clk/keystone/sci-clk.c:390:8-14: ERROR: application of sizeof > to pointer >=20 > Signed-off-by: Ran Sun > --- > drivers/clk/keystone/sci-clk.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/clk/keystone/sci-clk.c=20 > b/drivers/clk/keystone/sci-clk.c > index 6c1df4f11536..2c68c1e09d1f 100644 > --- a/drivers/clk/keystone/sci-clk.c > +++ b/drivers/clk/keystone/sci-clk.c > @@ -389,7 +389,7 @@ static struct clk_hw *sci_clk_get(struct=20 > of_phandle_args *clkspec, void *data) > key.clk_id =3D clkspec->args[1]; >=20 > clk =3D bsearch(&key, provider->clocks, provider->num_clocks, Huh? I see 'provider->clocks' is struct sci_clk_provider::clocks which is of type 'struct sci_clk **'. It looks like each element in the array is a 'struct sci_clk *', so if we want to silence the coccinelle warning perhaps this should change to sizeof(*clk). Certainly we don't want to change it to be the sizeof(struct sci_clk) though. Does changing the sizeof() to deref the pointer work to silence the error? > - sizeof(clk), _cmp_sci_clk); > + sizeof(**clk), _cmp_sci_clk);