Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5814301rwe; Tue, 18 Apr 2023 11:57:30 -0700 (PDT) X-Google-Smtp-Source: AKy350YOte+XLKTin6vsyA9BKBZXW0puZHZCKSx30ibSUmFHYTBhURgmq0893esZjORY3OVqjCu+ X-Received: by 2002:a05:6a00:2487:b0:63a:cefa:9d44 with SMTP id c7-20020a056a00248700b0063acefa9d44mr880295pfv.14.1681844249987; Tue, 18 Apr 2023 11:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681844249; cv=none; d=google.com; s=arc-20160816; b=Gy/rBxDMgadbJKLyzpV1kXm2mNdm4TfXkPkNBCDvIQvS6Zt5DMUajjdzo5ykskFcfH HKTURSf2fSbeCq30AB7X9gz2+s2o7XOnnLjA4dfLsPDK80qNSY3HVr7bDulMKa0Gb8Y4 /SWBVBMhh1rrSoErgYxDIUuxnWoZQ1jD2s515Kmd1iyMqbm4NJSkxyDJtitOaLPntSMo lScGFvFZR4zO0GMN2LXnC4VB4Vl0CCv2ZwnVO7wHFxxjGhJoIGVebbwudA+KnUjuCAhq JS1Ik+qUd3ZeE2cuQzPZwTdAzta/E9q05a8ifLLzRk4lNnIdo819Qx8hpy78TVPXcTZ6 iuSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/h0Ye4YzfuTyVJhc3KWw9FhoYxdOlS0tgXzf1S8Y6JY=; b=U1AAZh2mF7QKoYG4EMFAx5hIBxz7UxRrGD7tT2XuR2CKja2kprjSiAloq3iKNIU50/ DMbzND1iaZbXQiV/FAEIePbnPUJFQt03RBXujyj8o67rt+jpP5HWXO6j5ojI9p11NbqE 2qD88k84iUBFunihYnRZD6uT/XqZ8gJ+QxgyNR5J6NoOJIn8CNKc9w9F+oBKIv6A1Jpp Nu/nZdiYmn8dVeR/uCPFzGHZRmoD0PSUGIWCmi6atXHLrOijmcBEjBbIdqaW0nBF0oiN UUTbUXyH+uavVP1oToud//g0fSLJ5sUH1EoVaqbsLfWSjGYwwQAYpcURvMSmdE2J+RGt pKcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=hwr4DfGl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m63-20020a625842000000b0063b1fbbb8c5si13681774pfb.131.2023.04.18.11.57.16; Tue, 18 Apr 2023 11:57:29 -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=@google.com header.s=20221208 header.b=hwr4DfGl; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232149AbjDRSoo (ORCPT + 99 others); Tue, 18 Apr 2023 14:44:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232608AbjDRSom (ORCPT ); Tue, 18 Apr 2023 14:44:42 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67A4E93D7 for ; Tue, 18 Apr 2023 11:44:40 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-63b57c49c4cso2123015b3a.3 for ; Tue, 18 Apr 2023 11:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681843480; x=1684435480; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/h0Ye4YzfuTyVJhc3KWw9FhoYxdOlS0tgXzf1S8Y6JY=; b=hwr4DfGlA0LVFdLW955zFp7mTAHAENcrEHsi6IwXYBYqhH5DmANidRKqkGi/i4e6Z5 mQpOvJYJup+h6qXClSv+sncQdafdVcwTQH8HqTiwZ63gZOrFVOLgP2iv6DSHeFNcmhZf J4ItVEF7/OPio/GHJS3thEifa2RDAmJKdin63BzsME6o7Xaqk0Bwr68waO+IGxSxPDEZ OHPWWAUT443n7YLma2AAKHk5DVl8I6/202vfBbucgg26uvKcsqhBNe38ChlO0N2UPRFW q8fH0Tkjoiqu5yPrfp2IAg2a3uVELg4ZJnRh5+XYvndU40DEQEQrE5lehVLU0p+VOp32 5mWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681843480; x=1684435480; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/h0Ye4YzfuTyVJhc3KWw9FhoYxdOlS0tgXzf1S8Y6JY=; b=EiUgL4M2yiVlBN964FkABH8a+a699DOxOyfnE5Er4gdTdwdu/iv3aF6XRwxiHJOguT F70Y6A0fZMhYt3kQOlnccqlvfzKYkJCNI7x2TzlhM+RYyGUJZRx0r257rLxujcIA4WXJ 06nvhomS+yVPfgVK2SvXclad+iiJrOI9WzGg2V/48UJ1MACWmQcQKVLEiQN1i81XrTrc /lHf4vwNzN5lHOWeVjm8eb3Vf0+kss5hq18XelCtq9/PpFlDS6WskV8YAG47eRjKV9aU sQwg+giRKtwIVtRyvm4h3uVmYSP1QOmA+FXthyrRcUJaguh8KFgjMrzpyZq9YvpWV5fj hxpw== X-Gm-Message-State: AAQBX9cDAyMIAzIgoHU2Z4cHwo2/Lz1FVPnjlagRWm8qw3UprAn9U1SP RVZr0skVd8xaoY3uWl8hp5sNSgEAntqLqHzXRC4Z1Q== X-Received: by 2002:a17:902:eccf:b0:1a6:9671:253e with SMTP id a15-20020a170902eccf00b001a69671253emr3279751plh.47.1681843479724; Tue, 18 Apr 2023 11:44:39 -0700 (PDT) MIME-Version: 1.0 References: <20230418-pruss-clk-cb-v1-1-549a7e7febe4@kernel.org> In-Reply-To: <20230418-pruss-clk-cb-v1-1-549a7e7febe4@kernel.org> From: Nick Desaulniers Date: Tue, 18 Apr 2023 11:44:28 -0700 Message-ID: Subject: Re: [PATCH] soc: ti: pruss: Avoid cast to incompatible function type To: Simon Horman Cc: Nishanth Menon , Santosh Shilimkar , Nathan Chancellor , Tom Rix , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Tue, Apr 18, 2023 at 4:41=E2=80=AFAM Simon Horman wro= te: > > Rather than casting clk_unregister_mux to an incompatible function > type provide a trivial wrapper with the correct signature for the > use-case. > > Reported by clang-16 with W=3D1: > > drivers/soc/ti/pruss.c:158:38: error: cast from 'void (*)(struct clk *)'= to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wca= st-function-type-strict] > ret =3D devm_add_action_or_reset(dev, (void(*)(void *))clk_unreg= ister_mux, > > No functional change intended. > Compile tested only. Thanks for the patch! Reviewed-by: Nick Desaulniers Here's some more suspects to look at, if you have cycles: drivers/base/devres.c:734:int __devm_add_action(struct device *dev, void (*action)(void *), void *data, const char *name) drivers/i2c/busses/i2c-mchp-pci1xxxx.c:1159: ret =3D devm_add_action(dev, (void (*)(void *))pci1xxxx_i2c_shutdown, i2c); drivers/soc/ti/pruss.c:96: ret =3D devm_add_action_or_reset(dev, (void(*)(void *))clk_unregister_mux, drivers/mmc/host/meson-mx-sdhc-mmc.c:791: ret =3D devm_add_action_or_reset(dev, (void(*)(void *))mmc_free_host, drivers/pci/controller/pcie-microchip-host.c:866: devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare, > > Signed-off-by: Simon Horman > --- > drivers/soc/ti/pruss.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c > index 6882c86b3ce5..e68441bd7b30 100644 > --- a/drivers/soc/ti/pruss.c > +++ b/drivers/soc/ti/pruss.c > @@ -38,6 +38,11 @@ static void pruss_of_free_clk_provider(void *data) > of_node_put(clk_mux_np); > } > > +static void pruss_clk_unregister_mux(void *data) > +{ > + clk_unregister_mux(data); > +} > + > static int pruss_clk_mux_setup(struct pruss *pruss, struct clk *clk_mux, > char *mux_name, struct device_node *clks_n= p) > { > @@ -93,8 +98,7 @@ static int pruss_clk_mux_setup(struct pruss *pruss, str= uct clk *clk_mux, > goto put_clk_mux_np; > } > > - ret =3D devm_add_action_or_reset(dev, (void(*)(void *))clk_unregi= ster_mux, > - clk_mux); > + ret =3D devm_add_action_or_reset(dev, pruss_clk_unregister_mux, c= lk_mux); > if (ret) { > dev_err(dev, "failed to add clkmux unregister action %d",= ret); > goto put_clk_mux_np; > --=20 Thanks, ~Nick Desaulniers