linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] serial: sh-sci: mark OF related data as maybe unused
@ 2023-03-10 22:29 Krzysztof Kozlowski
  2023-03-10 22:29 ` [PATCH 2/2] serial: sprd: Drop of_match_ptr for ID table Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-10 22:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Orson Zhai, Baolin Wang,
	Chunyan Zhang, linux-serial, linux-kernel
  Cc: Krzysztof Kozlowski

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  drivers/tty/serial/sh-sci.c:3144:34: error: ‘of_sci_match’ defined but not used [-Werror=unused-const-variable=]

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

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 7bd080720929..a12aa8ff2d51 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3141,7 +3141,7 @@ static int sci_remove(struct platform_device *dev)
 #define SCI_OF_TYPE(data)		((unsigned long)(data) >> 16)
 #define SCI_OF_REGTYPE(data)		((unsigned long)(data) & 0xffff)
 
-static const struct of_device_id of_sci_match[] = {
+static const struct of_device_id of_sci_match[] __maybe_unused = {
 	/* SoC-specific types */
 	{
 		.compatible = "renesas,scif-r7s72100",
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] serial: sprd: Drop of_match_ptr for ID table
  2023-03-10 22:29 [PATCH 1/2] serial: sh-sci: mark OF related data as maybe unused Krzysztof Kozlowski
@ 2023-03-10 22:29 ` Krzysztof Kozlowski
  2023-03-13  1:23   ` Baolin Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-10 22:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Orson Zhai, Baolin Wang,
	Chunyan Zhang, linux-serial, linux-kernel
  Cc: Krzysztof Kozlowski

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 is not relevant here).

  drivers/tty/serial/sprd_serial.c:1242:34: error: ‘serial_ids’ defined but not used [-Werror=unused-const-variable=]

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

diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index 492a3bdab5ba..b58f51296ace 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -1250,7 +1250,7 @@ static struct platform_driver sprd_platform_driver = {
 	.remove		= sprd_remove,
 	.driver		= {
 		.name	= "sprd_serial",
-		.of_match_table = of_match_ptr(serial_ids),
+		.of_match_table = serial_ids,
 		.pm	= &sprd_pm_ops,
 	},
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] serial: sprd: Drop of_match_ptr for ID table
  2023-03-10 22:29 ` [PATCH 2/2] serial: sprd: Drop of_match_ptr for ID table Krzysztof Kozlowski
@ 2023-03-13  1:23   ` Baolin Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Baolin Wang @ 2023-03-13  1:23 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Greg Kroah-Hartman, Jiri Slaby, Orson Zhai,
	Chunyan Zhang, linux-serial, linux-kernel



On 3/11/2023 6:29 AM, 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 is not relevant here).
> 
>    drivers/tty/serial/sprd_serial.c:1242:34: error: ‘serial_ids’ defined but not used [-Werror=unused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

LGTM. Thanks.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
>   drivers/tty/serial/sprd_serial.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
> index 492a3bdab5ba..b58f51296ace 100644
> --- a/drivers/tty/serial/sprd_serial.c
> +++ b/drivers/tty/serial/sprd_serial.c
> @@ -1250,7 +1250,7 @@ static struct platform_driver sprd_platform_driver = {
>   	.remove		= sprd_remove,
>   	.driver		= {
>   		.name	= "sprd_serial",
> -		.of_match_table = of_match_ptr(serial_ids),
> +		.of_match_table = serial_ids,
>   		.pm	= &sprd_pm_ops,
>   	},
>   };

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-13  1:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10 22:29 [PATCH 1/2] serial: sh-sci: mark OF related data as maybe unused Krzysztof Kozlowski
2023-03-10 22:29 ` [PATCH 2/2] serial: sprd: Drop of_match_ptr for ID table Krzysztof Kozlowski
2023-03-13  1:23   ` Baolin Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).