Re: [PATCH v2 1/2] pwm: rcar: drop of_match_ptr for ID table
From: Uwe Kleine-König
Date: Sun Mar 12 2023 - 11:42:26 EST
Hello,
On Sun, Mar 12, 2023 at 02:51:19PM +0100, Krzysztof Kozlowski wrote:
> The driver can match only via the DT table so the table should be always
> used and the of_match_ptr does not have any sense (this also allows ACPI
> matching via PRP0001, even though it might not be relevant here). This
> also fixes !CONFIG_OF error:
>
> drivers/pwm/pwm-rcar.c:252:34: error: ‘rcar_pwm_of_table’ defined but not used [-Werror=unused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
Hmm, I wonder what else is required here to trigger that warning. On
amd64 I also disabled CONFIG_MODULES as otherwise rcar_pwm_of_table is
used by
MODULE_DEVICE_TABLE(of, rcar_pwm_of_table);
With that I have:
uwe@taurus:~/work/kbuild/amd64$ make drivers/pwm/pwm-rcar.o
GEN Makefile
CALL /home/uwe/gsrc/linux/scripts/checksyscalls.sh
DESCEND objtool
INSTALL libsubcmd_headers
CC drivers/pwm/pwm-rcar.o
uwe@taurus:~/work/kbuild/amd64$ make drivers/pwm/pwm-rcar.i
GEN Makefile
CALL /home/uwe/gsrc/linux/scripts/checksyscalls.sh
DESCEND objtool
INSTALL libsubcmd_headers
CPP drivers/pwm/pwm-rcar.i
uwe@taurus:~/work/kbuild/amd64$ grep rcar_pwm_of_table drivers/pwm/pwm-rcar.i
static const struct of_device_id rcar_pwm_of_table[] = {
... some time later ...
ah, you also need W=1 to get that warning because of
# These warnings generated too much noise in a regular build.
# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
in the toplevel Makefile.
I guess that explains why there is no previous report by one of the
build bots about this issue.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Attachment:
signature.asc
Description: PGP signature