Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Serge Semin <fancer.lancer@gmail.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	Stephen Rothwell <sfr@rothwell.id.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mips@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] tty: mips_ejtag_fdc: Fix passing incompatible pointer type warning
Date: Fri, 16 Feb 2024 06:51:01 +0100	[thread overview]
Message-ID: <4971bda5-e337-4c40-b7bd-5da4b7dae5d7@kernel.org> (raw)
In-Reply-To: <20240215171740.14550-5-fancer.lancer@gmail.com>

On 15. 02. 24, 18:17, Serge Semin wrote:
> mips_ejtag_fdc_encode() method expects having a first argument passed of
> the "u8 **" type, meanwhile the driver passes the "const char **" type.
> That causes the next build-warning:
> 
> drivers/tty/mips_ejtag_fdc.c: In function ‘mips_ejtag_fdc_console_write’:
> drivers/tty/mips_ejtag_fdc.c:343:32: error: passing argument 1 of ‘mips_ejtag_fdc_encode’ from incompatible pointer type [-Werror=incompatible-pointer-types]
>     word = mips_ejtag_fdc_encode(&buf_ptr, &buf_len, 1);
>                                  ^
> drivers/tty/mips_ejtag_fdc.c:216:24: note: expected ‘const u8 ** {aka const unsigned char **}’ but argument is of type ‘const char **’
>   static struct fdc_word mips_ejtag_fdc_encode(const u8 **ptrs,
>                          ^~~~~~~~~~~~~~~~~~~~~

It's a correct change. But why the compiler complains, given
KBUILD_CFLAGS += -funsigned-char
?

> Fix it by altering the type of the pointer which is passed to the
> mips_ejtag_fdc_encode() method.
> 
> Fixes: ce7cbd9a6c81 ("tty: mips_ejtag_fdc: use u8 for character pointers")
> Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
> ---
>   drivers/tty/mips_ejtag_fdc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/mips_ejtag_fdc.c b/drivers/tty/mips_ejtag_fdc.c
> index aac80b69a069..afbf7738c7c4 100644
> --- a/drivers/tty/mips_ejtag_fdc.c
> +++ b/drivers/tty/mips_ejtag_fdc.c
> @@ -309,7 +309,7 @@ static void mips_ejtag_fdc_console_write(struct console *c, const char *s,
>   	unsigned int i, buf_len, cpu;
>   	bool done_cr = false;
>   	char buf[4];
> -	const char *buf_ptr = buf;
> +	const u8 *buf_ptr = buf;
>   	/* Number of bytes of input data encoded up to each byte in buf */
>   	u8 inc[4];
>   

thanks,
-- 
js
suse labs


  reply	other threads:[~2024-02-16  5:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 17:17 [PATCH 0/4] MIPS: Fix missing proto and passing arg warnings Serge Semin
2024-02-15 17:17 ` [PATCH 1/4] mips: cm: Add __mips_cm_l2sync_phys_base prototype declaration Serge Semin
2024-03-11 22:26   ` Andy Shevchenko
2024-02-15 17:17 ` [PATCH 2/4] mips: cm: Add CM GCR and L2-sync base address getters declarations Serge Semin
2024-02-20 17:24   ` Thomas Bogendoerfer
2024-02-21 18:39     ` Serge Semin
2024-02-23  9:06       ` Thomas Bogendoerfer
2024-02-23 10:38         ` Serge Semin
2024-02-15 17:17 ` [PATCH 3/4] mips: zboot: Fix "no previous prototype" build warning Serge Semin
2024-02-23  9:18   ` Thomas Bogendoerfer
2024-02-15 17:17 ` [PATCH 4/4] tty: mips_ejtag_fdc: Fix passing incompatible pointer type warning Serge Semin
2024-02-16  5:51   ` Jiri Slaby [this message]
2024-02-16 14:12     ` Serge Semin
2024-02-23  9:18   ` Thomas Bogendoerfer

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=4971bda5-e337-4c40-b7bd-5da4b7dae5d7@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=fancer.lancer@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sfr@rothwell.id.au \
    --cc=tsbogend@alpha.franken.de \
    /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