diff mbox series

ASoC: ti: ams-delta: Fix cx81801_receive() argument types

Message ID 20231007213820.376360-1-jmkrzyszt@gmail.com
State Accepted
Commit b3fa3cf02e3ce92d32bfdeedd5a6bd0825f55a14
Headers show
Series ASoC: ti: ams-delta: Fix cx81801_receive() argument types | expand

Commit Message

Janusz Krzysztofik Oct. 7, 2023, 9:38 p.m. UTC
Since types of arguments accepted by tty_ldis_ops::receive_buf() have
changed, the driver no longer builds.

.../linux/sound/soc/ti/ams-delta.c:403:24: error: initialization of 'void (*)(struct tty_struct *, const u8 *, const u8 *, size_t)' {aka 'void (*)(struct tty_struct *, const unsigned char *, const unsigned char *, unsigned int)'} from incompatible pointer type 'void (*)(struct tty_struct *, const u8 *, const char *, int)' {aka 'void (*)(struct tty_struct *, const unsigned char *, const char *, int)'} [-Werror=incompatible-pointer-types]
  403 |         .receive_buf = cx81801_receive,

Fix it.

Fixes: e8161447bb0c ("tty: make tty_ldisc_ops::*buf*() hooks operate on size_t")
Fixes: 892bc209f250 ("tty: use u8 for flags")
Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
---
 sound/soc/ti/ams-delta.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Greg Kroah-Hartman Oct. 8, 2023, 5:04 a.m. UTC | #1
On Sat, Oct 07, 2023 at 11:38:18PM +0200, Janusz Krzysztofik wrote:
> Since types of arguments accepted by tty_ldis_ops::receive_buf() have
> changed, the driver no longer builds.
> 
> .../linux/sound/soc/ti/ams-delta.c:403:24: error: initialization of 'void (*)(struct tty_struct *, const u8 *, const u8 *, size_t)' {aka 'void (*)(struct tty_struct *, const unsigned char *, const unsigned char *, unsigned int)'} from incompatible pointer type 'void (*)(struct tty_struct *, const u8 *, const char *, int)' {aka 'void (*)(struct tty_struct *, const unsigned char *, const char *, int)'} [-Werror=incompatible-pointer-types]
>   403 |         .receive_buf = cx81801_receive,
> 
> Fix it.
> 
> Fixes: e8161447bb0c ("tty: make tty_ldisc_ops::*buf*() hooks operate on size_t")
> Fixes: 892bc209f250 ("tty: use u8 for flags")
> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
> ---
>  sound/soc/ti/ams-delta.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Odd no built-bots caught this, maybe no one normally builds this file?
Anyway, I'll pick this up in my tty tree now, thanks!

greg k-h
Janusz Krzysztofik Oct. 8, 2023, 9:42 a.m. UTC | #2
Dnia niedziela, 8 października 2023 07:04:39 CEST Greg Kroah-Hartman pisze:
> On Sat, Oct 07, 2023 at 11:38:18PM +0200, Janusz Krzysztofik wrote:
> > Since types of arguments accepted by tty_ldis_ops::receive_buf() have
> > changed, the driver no longer builds.
> > 
> > .../linux/sound/soc/ti/ams-delta.c:403:24: error: initialization of 'void (*)(struct tty_struct *, const u8 *, const u8 *, size_t)' {aka 'void (*)(struct tty_struct *, const unsigned char *, const unsigned char *, unsigned int)'} from incompatible pointer type 'void (*)(struct tty_struct *, const u8 *, const char *, int)' {aka 'void (*)(struct tty_struct *, const unsigned char *, const char *, int)'} [-Werror=incompatible-pointer-types]
> >   403 |         .receive_buf = cx81801_receive,
> > 
> > Fix it.
> > 
> > Fixes: e8161447bb0c ("tty: make tty_ldisc_ops::*buf*() hooks operate on size_t")
> > Fixes: 892bc209f250 ("tty: use u8 for flags")
> > Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
> > ---
> >  sound/soc/ti/ams-delta.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Odd no built-bots caught this, maybe no one normally builds this file?

The driver depends on SND, SND_SOC and TTY, but can't be selected 
individually, only via its user.  Then, it usually builds when 
CONFIG_SND_SOC_OMAP_AMS_DELTA=y, and that's probably uncommon due to 
specific dependencies.  However, cx20442 can also be selected and built 
with CONFIG_COMPILE_TEST=y and CONFIG_SND_SOC_ALL_CODECS=y.  Since similar 
approach seems to apply to quite a number of ASoC CODECs, maybe build-bots 
should pay special attention to select SND_SOC_ALL_CODECS more frequently, 
like they probably do with COMPILE_TEST.

Thanks,
Janusz

> Anyway, I'll pick this up in my tty tree now, thanks!
> 
> greg k-h
>
Mark Brown Oct. 9, 2023, 12:05 p.m. UTC | #3
On Sat, Oct 07, 2023 at 11:38:18PM +0200, Janusz Krzysztofik wrote:
> Since types of arguments accepted by tty_ldis_ops::receive_buf() have
> changed, the driver no longer builds.

Acked-by: Mark Brown <broonie@kernel.org>
diff mbox series

Patch

diff --git a/sound/soc/ti/ams-delta.c b/sound/soc/ti/ams-delta.c
index 371943350fdf..666057d50ea0 100644
--- a/sound/soc/ti/ams-delta.c
+++ b/sound/soc/ti/ams-delta.c
@@ -336,8 +336,8 @@  static void cx81801_hangup(struct tty_struct *tty)
 }
 
 /* Line discipline .receive_buf() */
-static void cx81801_receive(struct tty_struct *tty, const u8 *cp,
-		const char *fp, int count)
+static void cx81801_receive(struct tty_struct *tty, const u8 *cp, const u8 *fp,
+			    size_t count)
 {
 	struct snd_soc_component *component = tty->disc_data;
 	const unsigned char *c;