From: Yu-Chun Lin <eleanor15x@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: jirislaby@kernel.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org, jserv@ccns.ncku.edu.tw,
visitorckw@gmail.com, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] serial: pic32: Fix build warning when CONFIG_OF is disabled
Date: Mon, 27 Jan 2025 16:29:24 +0800 [thread overview]
Message-ID: <Z5dD5Fz2vf-nnjvg@eleanor-wkdl> (raw)
In-Reply-To: <2025012604-undamaged-earring-d16c@gregkh>
On Sun, Jan 26, 2025 at 08:30:33PM +0100, Greg KH wrote:
> On Mon, Jan 27, 2025 at 12:31:15AM +0800, Yu-Chun Lin wrote:
> > As reported by the kernel test robot, the following warning occurs:
> >
> > >> drivers/tty/serial/pic32_uart.c:904:34: warning: 'pic32_serial_dt_ids' defined but not used [-Wunused-const-variable=]
> > 904 | static const struct of_device_id pic32_serial_dt_ids[] = {
> > | ^~~~~~~~~~~~~~~~~~~
> >
> > The 'pic32_serial_dt_ids' array is only used when CONFIG_OF is enabled.
> > Wrapping its definition and 'MODULE_DEVICE_TABLE' in '#ifdef CONFIG_OF'
> > prevents a compiler warning when OF is disabled.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202501260006.ecUsBidz-lkp@intel.com/
> > Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
> > ---
> > drivers/tty/serial/pic32_uart.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c
> > index 14d50bd7f1bd..a228a55102c6 100644
> > --- a/drivers/tty/serial/pic32_uart.c
> > +++ b/drivers/tty/serial/pic32_uart.c
> > @@ -948,11 +948,13 @@ static void pic32_uart_remove(struct platform_device *pdev)
> > pic32_sports[sport->idx] = NULL;
> > }
> >
> > +#ifdef CONFIG_OF
> > static const struct of_device_id pic32_serial_dt_ids[] = {
> > { .compatible = "microchip,pic32mzda-uart" },
> > { /* sentinel */ }
> > };
> > MODULE_DEVICE_TABLE(of, pic32_serial_dt_ids);
> > +#endif
>
> That should not be needed, no other bus requires this, please fix up the
> use of the OF macros instead.
So I should remove of_match_ptr and add the CONFIG_OF as a dependency
for the configuration. Correct?
Yu-Chun Lin
next prev parent reply other threads:[~2025-01-27 8:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-26 16:31 [PATCH] serial: pic32: Fix build warning when CONFIG_OF is disabled Yu-Chun Lin
2025-01-26 19:30 ` Greg KH
2025-01-27 8:29 ` Yu-Chun Lin [this message]
2025-01-27 9:12 ` Greg KH
2025-01-27 10:07 ` Yu-Chun Lin
2025-01-27 10:21 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z5dD5Fz2vf-nnjvg@eleanor-wkdl \
--to=eleanor15x@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=jserv@ccns.ncku.edu.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=lkp@intel.com \
--cc=visitorckw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox