[PATCH v2 1/2] pwm: rcar: drop of_match_ptr for ID table

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Sun Mar 12 08:42:10 PDT 2023


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 at linaro.org>

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 at 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 at 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 at 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/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20230312/7bcfa41b/attachment.sig>


More information about the linux-arm-kernel mailing list