From patchwork Tue Feb 13 10:16:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 200344 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp442335dyb; Tue, 13 Feb 2024 02:20:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbr0cTO3a6dup0thX31HCDLMG5jKGq0zFr2ghl46GjNHdoGpK+Bl3dBmmislnUhwGU92ad X-Received: by 2002:aa7:d8c7:0:b0:561:4460:6726 with SMTP id k7-20020aa7d8c7000000b0056144606726mr6216265eds.26.1707819641146; Tue, 13 Feb 2024 02:20:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707819641; cv=pass; d=google.com; s=arc-20160816; b=L9zNhOhOkqA1etZbuCRwRafD6qboqy+EkVAXOi6sdk/fhJ0aKS6LX/3293bvzLmqAV ih1XmS47luZ91Ch/98GAftSXLEdibz5ADxwTyNM13l+d71n8GgUiVZ4ULM7VJCCDNc9X knCTgscN4Q1wMG9AvjeiQfnPlw9+RPVqbc4N75rpqVbzjaTK51C+wjOWP2Cc5kF5dNRi VMA8npXO2GEyX6HCiM60CiMVnC+3NL1cr6vk2GfPrF7RQrh4IndGCWRuUFGQwcfCIj/s 023yCTQltrGqYhETkGbRRgAWbvEqTTOu1dYcLyyLNBFznDtvyzEeaZ+WPvxDPuYAoUdw R8WA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=4Hnthac/vGlK15vnVWDZGA2N+gFwYvijHtIFn3lu5OQ=; fh=kadiW9vkAXY7c06Re/DcqP86dCkoSehv/1aNAs1ARvg=; b=tW77M/RYRPegIyH2etWXztaqJyu6zdf953pg4vqyKm2LYffXhYx0sL6kWpT/sMLwUW SrKLkVcLqVsgqMdVWEIPl/zbHF31Rhr57xA09dQF8OtJplNVSDLb89CjdX2q6eXZSwqI BPloPnUPWbSzEwDNWVnGbuCyriie7vCK5pSS/xpLOcBID4foChcjmhop2cjYNCcZRF2I FWwuwfPDZWxUrdx3FozdxFW5DUKqxqOsFuCdPpme6jZMtCWlUNOKc/QwoNXTbkFh+9nJ N6h11kJolhMX2q+MS/UxOdD0lIghX76q9efkxsOQm9UX//+31U1ECMAzRk+YVW7EITd8 87ow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="F9c36Lc/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63328-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63328-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWd9rT3rOOc0RPJpc/YXFS91HK1mBBF0R9rvSQa0ficA6hkTqAEZ44SMGbiEXn5YgLww8eRoDac+q+nAnx6t5TBA4WTYA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u27-20020a50951b000000b0056101f41c6asi3587009eda.223.2024.02.13.02.20.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:20:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63328-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="F9c36Lc/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63328-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63328-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7FB201F261CC for ; Tue, 13 Feb 2024 10:17:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 740CE286B3; Tue, 13 Feb 2024 10:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F9c36Lc/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5348225D2; Tue, 13 Feb 2024 10:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707819420; cv=none; b=KneNTzM/MMK8nliixpi5HKl2d+AOGHwGPgF5LN/bqAmEDkVkF5C0nIzeSZl98GGvhYZx/Z3al2B8tyy0RI553dvnO0SplcO2+TeHkI22e6fE5dIYqEb2k1glAQEeRZRVm5/xlma+PCX05DYD1dxwreF1BCLBQ34vr7BT49kg3U4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707819420; c=relaxed/simple; bh=yq5HRU9Pb5q1jpmq7XT0U6aYcsw7enTeYRI+zhtoGRc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=R40dHwNtvEE8JdtCQjZ8yiZQYngdWnHIbyGlSjzbo8J3WjeR1s/Q0WeOSpopfsqmqz337untMQb1tW+OoOVxhy0PnGoTViiI5Egz4UJaKHtq1rNrM5hApxgbJWP/uwzBmKBxOooGQsJYyvlr16WqujnILis40Y9lEHwkjoQIUm0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F9c36Lc/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A845AC433C7; Tue, 13 Feb 2024 10:16:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707819420; bh=yq5HRU9Pb5q1jpmq7XT0U6aYcsw7enTeYRI+zhtoGRc=; h=From:To:Cc:Subject:Date:From; b=F9c36Lc/aQZfkBHmvKiejC1gWtzinZ/3+iAc9eR/J3h9zI7g/op8lFYtle0wExOkN RJw8fXTS/mteuLyEN/8ak2sqqeDAhiIBPGPGvyI3TfycTQcxzNXpOWfGeD8FzLk6j6 TfFGLAaE1fqd1i0qCOF7/K8Gdm72ruNKcLlBZTjWPRWK+2TkyWoucZNe/362p7EGBm TkrqAfkKafMv0T63/i57Moh3QtBZtul11a8tjxcv+AI2lr1mNsG+LIN6tRnofxC2rq CweR/tfAOKkm3u1RpSETMEOjjeMsc/Xxmf3h/Ahd2Esi+i9OUgw9dANaSWoRkVaq5I Y3m2lGbgJLcKQ== From: Arnd Bergmann To: Jakub Kicinski Cc: Arnd Bergmann , "David S. Miller" , Eric Dumazet , Paolo Abeni , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Richard Cochran , Grygorii Strashko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] ethernet: cpts: fix function pointer cast warnings Date: Tue, 13 Feb 2024 11:16:34 +0100 Message-Id: <20240213101654.461239-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790778688220958297 X-GMAIL-MSGID: 1790778688220958297 From: Arnd Bergmann clang-16 warns about the mismatched prototypes for the devm_* callbacks: drivers/net/ethernet/ti/cpts.c:691:12: error: cast from 'void (*)(struct clk_hw *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 691 | (void(*)(void *))clk_hw_unregister_mux, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/device.h:406:34: note: expanded from macro 'devm_add_action_or_reset' 406 | __devm_add_action_or_reset(dev, action, data, #action) | ^~~~~~ drivers/net/ethernet/ti/cpts.c:703:12: error: cast from 'void (*)(struct device_node *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 703 | (void(*)(void *))of_clk_del_provider, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/device.h:406:34: note: expanded from macro 'devm_add_action_or_reset' 406 | __devm_add_action_or_reset(dev, action, data, #action) Use separate helper functions for this instead, using the expected prototypes with a void* argument. Fixes: a3047a81ba13 ("net: ethernet: ti: cpts: add support for ext rftclk selection") Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/ti/cpts.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c index bcccf43d368b..dbbea9146040 100644 --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c @@ -638,6 +638,16 @@ static void cpts_calc_mult_shift(struct cpts *cpts) freq, cpts->cc.mult, cpts->cc.shift, (ns - NSEC_PER_SEC)); } +static void cpts_clk_unregister(void *clk) +{ + clk_hw_unregister_mux(clk); +} + +static void cpts_clk_del_provider(void *np) +{ + of_clk_del_provider(np); +} + static int cpts_of_mux_clk_setup(struct cpts *cpts, struct device_node *node) { struct device_node *refclk_np; @@ -687,9 +697,7 @@ static int cpts_of_mux_clk_setup(struct cpts *cpts, struct device_node *node) goto mux_fail; } - ret = devm_add_action_or_reset(cpts->dev, - (void(*)(void *))clk_hw_unregister_mux, - clk_hw); + ret = devm_add_action_or_reset(cpts->dev, cpts_clk_unregister, clk_hw); if (ret) { dev_err(cpts->dev, "add clkmux unreg action %d", ret); goto mux_fail; @@ -699,8 +707,7 @@ static int cpts_of_mux_clk_setup(struct cpts *cpts, struct device_node *node) if (ret) goto mux_fail; - ret = devm_add_action_or_reset(cpts->dev, - (void(*)(void *))of_clk_del_provider, + ret = devm_add_action_or_reset(cpts->dev, cpts_clk_del_provider, refclk_np); if (ret) { dev_err(cpts->dev, "add clkmux provider unreg action %d", ret);