Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2963377rdb; Tue, 13 Feb 2024 02:44:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2J1XdsWXIHZagV7NtcW8HMwU+G56Y1cuLm5VlewuvY/fzd8eP/vBYX0AhVIjlnmEnRdxd X-Received: by 2002:a54:481a:0:b0:3bf:d85c:b39b with SMTP id j26-20020a54481a000000b003bfd85cb39bmr10764178oij.15.1707821044457; Tue, 13 Feb 2024 02:44:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707821044; cv=pass; d=google.com; s=arc-20160816; b=VF1SWMTOG4nNQgLflY/a7EfKyQ9KCYCTwt7YGxTe6j2byndvf06GyNbUg2W2Gvzvhe 45MkafOemePh8A1LhhdlRhfHQbSoVOpTkqOP6XXQETjLHCkSqojdwcV+yQh/I+7JW3f6 Th8WLIC18xhjbSjSiCH3q/CJ1hfShfl1KsRY5WTy2ry3U83UBWSM1t/m3DUNjF6UOqdM t8ix5mpgeqBwBjYzLUDcDbG2HElfv+qZSB83wSMIx3WhaByLgghB2QlfrDYBe6k0t5Gf PI1uMHviyhR2w7H3jbkhza6sCOaQZC0A4yV+cIMOiO07HwcydL2vkUX2Y67aBpoaYDmV Xq/w== 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=H4k9vuG5RjRY47pnMol/sXGB7f0rKI4F7Ucbd5IbKOU=; b=iPJg28Aw7BvQkCeqg2GqXh1JfQoby0QgjesNRrabbQFoIhe7O7wt6/Vq4xHlGyiPKg L+OyiKIw7YpZwH7aL7ZoymTo1HSVTXrn+6Ggl14IadmaMkE22fmD9d11oElepStQO6dt GxEgw5T0l5eL7s/qTDiju1ZoCcaDKmTSnirxx1J0vmxBOwByafD2rv1zRUSgY6tIw9KY 7MQh7XnnGxUOq/qui4bLVmH63Vwg5K/Dptq0YjWnuaX/5whYG1KbqMKmhOaAoc/kxyxU W/sXr/5rfhApO4gKLIyTSeMehi8BM44Ai6wtVXsdrn/ZSJWaYxBBodG5LNOYcQAc4Eqh AekA==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63328-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVEb7H6MgoInQkY4rX+bytpmJFOrDvuNQQJ9t+ypqgs4zs3oPX0SbjDVXXokX/YVzvckwJy12mPC0SLEucoHBmYQEV1EZk4j0fKkJ2R8g== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w16-20020a639350000000b005dc42fd8c40si1748344pgm.404.2024.02.13.02.44.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:44:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63328-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63328-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 79812B27158 for ; Tue, 13 Feb 2024 10:17:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BC4A23774; Tue, 13 Feb 2024 10:17:01 +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 Content-Transfer-Encoding: 8bit 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); -- 2.39.2