Message ID | 20240213101607.460930-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-63326-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp442275dyb; Tue, 13 Feb 2024 02:20:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWOwcOfBE3m1hRh1/M4UIdJB1hM4RWOS0tTZ9FxBf/P6UwQjyPpFBLHw1ZBktZX2PC1S/lx7gG1AKQJtz2nCp/5aZW57A== X-Google-Smtp-Source: AGHT+IHpN3CF+BHkjMskwZ+wsZuRBzCewgKn0OOxYzcPhTx9hw//kHc/yfBKVw5dX2dCxODQ9gr7 X-Received: by 2002:a17:906:fa99:b0:a3c:369b:a6d6 with SMTP id lt25-20020a170906fa9900b00a3c369ba6d6mr7266321ejb.6.1707819629692; Tue, 13 Feb 2024 02:20:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707819629; cv=pass; d=google.com; s=arc-20160816; b=eNJqjvnZDBVMynM/gRS4w+8EUnv65H7cGecrTCCm0ecYYdhGqh7FcC/Ef2qrH5pM39 VxIP9uqxtaEkTNDufVX04pdg3KSUNQ7n2aNV2hdJpYck9wg4R6gPDZlt3uJgIthghzdk 7tv3hGDS4i2RcA9uBUqRAJRRajT8Pyt0Ajom4RIfXSvLLO9STGLBSSWwqddAm8fvX/vL 2xuHKjVnJWrDkzhFeVpma7X+gjZE+gp4zN0P/BRVU6ev/d4fX9+cdGiKre7uFJ9x17XJ pcuOAgRWXnpCS6YykCKW5Hio4OKwIStF71eJ7iZPMddLvifxcTFtgMTyACG5iAQ/Zwdg wkvQ== 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=a/w3zkzAE6QndihWBkM3vhfOfHV1m1ja1/T/VohBOf0=; fh=56oqe4545QOmgwvK9TRIurgKOhkpSGSTkuqTFTDU7pU=; b=Ieox5fgyVz+eX6Et5qLEfts2XdV8H/6zINq92RG482U1Ezmg5/mzefSzI82TXsBl/N MPqzfS9FHW0jWStEFN54t9RXxXcDBuoXZLTsZy5UwmhOxIrxO6AigqonDwpRGDx3xJUk p4X9qAhw3UKKnCEh8XTr+j+LCm96yPpNjrf1BSDJXRrLbmFDjaq55WkcU3ic79HQ0ith hOXxAJn8g6rURW1AXn8rcuLjWFEWzjnVbpzV+8aBJyWi2HybZi2wMnnQNaiKcyT+6FWK SIz7ydM8/N8xUA8xEt8hGfqH3BlfJGa40U7EHRR+IrbMbbnOkctcnNfNIe9WMfKd/q/2 W+0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JFhoOky3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63326-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63326-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCViKcKJ8kvbbviobV+1ioBFGvNsvcCl4oAz2ZRS2Z8BYRb69M+2q+y3mDDfsP+JET6q4+GXBLRp/wGYAvO6MO/AV9CF4w== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a6-20020a1709062b0600b00a3845364c65si1120038ejg.607.2024.02.13.02.20.29 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:20:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63326-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=JFhoOky3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63326-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63326-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 C7ACF1F23321 for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 10:16:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A4A423754; Tue, 13 Feb 2024 10:16:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JFhoOky3" 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 A072D225CE; Tue, 13 Feb 2024 10:16:14 +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=1707819374; cv=none; b=sCmnHzoDx10ulMkfks5dh64LhBNCcq4dWmnbnqb7T+QUOqyhRD1TnCGMGmqcrTMgI6aruFUqIH7jg5Edo63KaH0RAjOaJIBStRPhYVz8g2YC2DKt1EZiXNnHhgWe2NtKsqpegN0fsHw+I0WhxcLmFwyPkk0aR+JPECbjQd5l4yU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707819374; c=relaxed/simple; bh=k33CtS/Oue9+/X++3MgidqCmxeXWtvkicfBhbDgKtr0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=LS+jzF6h63LYGfJXrJmM5Wx2VQta+9UmnOZd8sDj6Af7yGt5sygl03ef/6PyoqiIXmYOktP+cNmMaLSnvHNS2Rr2sjuFzkStAam8he13JLqIOWXhbF87nuPraHYF1JTfkhWkeLQtteFoFPBHCyNS5UI/XSpG8l+Ag+UI5Ih6vvM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JFhoOky3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E59E7C433C7; Tue, 13 Feb 2024 10:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707819374; bh=k33CtS/Oue9+/X++3MgidqCmxeXWtvkicfBhbDgKtr0=; h=From:To:Cc:Subject:Date:From; b=JFhoOky3BG+Mf/sBqIr/THaRi7qZBEf2N3cS/D7dfxEInAfgUeO3VOTTkpu/um3He 1BYQgAsg+/jBAWldEkFTV9+pDw95l3iQWTmLAsrR+N6fwvkxI127MC2KzO3izhNpet G6UlIo/7n660MGaesxrt3dIwn6oqOBgy/tvFhId1bpcXGXerTLVBVRdcLgOl/iCEvu DUDCXx6cSRK24oxj9nnODLo8y2TliNZSs2Oyqr7WSJvhhqw3YEY+yaSp/VAcf3C7l5 6iUvhF0tpDcPmdUR+N9/NccYuUFb7v9YiuuDanaLoTkpEPIZQrAlZr/OfTc/Nno+og 69y0hZ5pg1oGw== From: Arnd Bergmann <arnd@kernel.org> To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Arnd Bergmann <arnd@arndb.de>, Neil Armstrong <neil.armstrong@linaro.org>, Kevin Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>, Martin Blumenstingl <martin.blumenstingl@googlemail.com>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Bill Wendling <morbo@google.com>, Justin Stitt <justinstitt@google.com>, Jernej Skrabec <jernej.skrabec@gmail.com>, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] nvmem: meson-efuse: fix function pointer type mismatch Date: Tue, 13 Feb 2024 11:15:47 +0100 Message-Id: <20240213101607.460930-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790778676041025138 X-GMAIL-MSGID: 1790778676041025138 |
Series |
nvmem: meson-efuse: fix function pointer type mismatch
|
|
Commit Message
Arnd Bergmann
Feb. 13, 2024, 10:15 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de> clang-16 warns about casting functions to incompatible types, as is done here to call clk_disable_unprepare: drivers/nvmem/meson-efuse.c:78:12: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 78 | (void(*)(void *))clk_disable_unprepare, Address this with a trivial helper function that adjusts the return code. Fixes: 611fbca1c861 ("nvmem: meson-efuse: add peripheral clock") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/nvmem/meson-efuse.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Comments
On 13/02/2024 11:15, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > clang-16 warns about casting functions to incompatible types, as is done > here to call clk_disable_unprepare: > > drivers/nvmem/meson-efuse.c:78:12: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] > 78 | (void(*)(void *))clk_disable_unprepare, > > Address this with a trivial helper function that adjusts the return code. > > Fixes: 611fbca1c861 ("nvmem: meson-efuse: add peripheral clock") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/nvmem/meson-efuse.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c > index b922df99f9bc..3b9e31d7d073 100644 > --- a/drivers/nvmem/meson-efuse.c > +++ b/drivers/nvmem/meson-efuse.c > @@ -38,6 +38,11 @@ static const struct of_device_id meson_efuse_match[] = { > }; > MODULE_DEVICE_TABLE(of, meson_efuse_match); > > +static void meson_efuse_clk_disable(void *clk) > +{ > + clk_disable_unprepare(clk); > +} > + > static int meson_efuse_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > @@ -74,9 +79,7 @@ static int meson_efuse_probe(struct platform_device *pdev) > return ret; > } > > - ret = devm_add_action_or_reset(dev, > - (void(*)(void *))clk_disable_unprepare, > - clk); > + ret = devm_add_action_or_reset(dev, meson_efuse_clk_disable, clk); > if (ret) { > dev_err(dev, "failed to add disable callback"); > return ret; Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c index b922df99f9bc..3b9e31d7d073 100644 --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c @@ -38,6 +38,11 @@ static const struct of_device_id meson_efuse_match[] = { }; MODULE_DEVICE_TABLE(of, meson_efuse_match); +static void meson_efuse_clk_disable(void *clk) +{ + clk_disable_unprepare(clk); +} + static int meson_efuse_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -74,9 +79,7 @@ static int meson_efuse_probe(struct platform_device *pdev) return ret; } - ret = devm_add_action_or_reset(dev, - (void(*)(void *))clk_disable_unprepare, - clk); + ret = devm_add_action_or_reset(dev, meson_efuse_clk_disable, clk); if (ret) { dev_err(dev, "failed to add disable callback"); return ret;