diff mbox series

[1/9] regulator: lp872x: Mark OF related data as maybe unused

Message ID 20230310214553.275450-1-krzysztof.kozlowski@linaro.org (mailing list archive)
State Not Applicable
Headers show
Series [1/9] regulator: lp872x: Mark OF related data as maybe unused | expand

Commit Message

Krzysztof Kozlowski March 10, 2023, 9:45 p.m. UTC
The driver can be compile tested with !CONFIG_OF making certain data
unused:

  drivers/regulator/lp872x.c:931:34: error: ‘lp872x_dt_ids’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/regulator/lp872x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown March 13, 2023, 1:58 p.m. UTC | #1
On Fri, Mar 10, 2023 at 10:45:45PM +0100, Krzysztof Kozlowski wrote:
> The driver can be compile tested with !CONFIG_OF making certain data
> unused:
> 
>   drivers/regulator/lp872x.c:931:34: error: ‘lp872x_dt_ids’ defined but not used [-Werror=unused-const-variable=]

Here you're using maybe unused instead of removing the of_match_ptr()
(which does seem like a better approach).  This really feels very
random, there's obviously a usability problem here.
Mark Brown March 13, 2023, 7:07 p.m. UTC | #2
On Fri, 10 Mar 2023 22:45:45 +0100, Krzysztof Kozlowski wrote:
> The driver can be compile tested with !CONFIG_OF making certain data
> unused:
> 
>   drivers/regulator/lp872x.c:931:34: error: ‘lp872x_dt_ids’ defined but not used [-Werror=unused-const-variable=]
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/9] regulator: lp872x: Mark OF related data as maybe unused
      commit: 70b26bb55f719e2900404459128d41c8425c8dde
[2/9] regulator: max20086: Mark OF related data as maybe unused
      commit: 4a5850865641d0b83caaad81ca0bbd722ac514fb
[3/9] regulator: mp8859: Mark OF related data as maybe unused
      commit: 334e6b85a348a79bb018003f09e1cc94accd53a2
[4/9] regulator: mt6397-regulator: Mark OF related data as maybe unused
      commit: 38cc873cb1cf27965dacbbc5957a7a8aee89679c

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
index c576894c3d52..c3a6e77db4d0 100644
--- a/drivers/regulator/lp872x.c
+++ b/drivers/regulator/lp872x.c
@@ -928,7 +928,7 @@  static int lp872x_probe(struct i2c_client *cl)
 	return lp872x_regulator_register(lp);
 }
 
-static const struct of_device_id lp872x_dt_ids[] = {
+static const struct of_device_id lp872x_dt_ids[] __maybe_unused = {
 	{ .compatible = "ti,lp8720", },
 	{ .compatible = "ti,lp8725", },
 	{ }