* [PATCH] uapi: fix linux/usb/audio.h userspace compilation error
@ 2018-08-13 15:46 Dmitry V. Levin
2018-08-13 15:55 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry V. Levin @ 2018-08-13 15:46 UTC (permalink / raw)
To: Jorge Sanjuan, Takashi Iwai, Ruslan Bilovol
Cc: Greg Kroah-Hartman, linux-kernel
Replace NULL with 0 in uac_mixer_unit_bmControls() to fix the following
linux/usb/audio.h userspace compilation error:
/usr/include/linux/usb/audio.h: In function 'uac_mixer_unit_bmControls':
/usr/include/linux/usb/audio.h:304:10: error: 'NULL' undeclared (first use in this function)
return NULL;
Fixes: 6cfd839ae78e ("ALSA: usb-audio: UAC3. Add support for mixer unit.")
Cc: <stable@vger.kernel.org> # v4.18
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
include/uapi/linux/usb/audio.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/usb/audio.h b/include/uapi/linux/usb/audio.h
index 74e520fb944f..2b61fe34b2ca 100644
--- a/include/uapi/linux/usb/audio.h
+++ b/include/uapi/linux/usb/audio.h
@@ -301,7 +301,7 @@ static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *
case UAC_VERSION_3:
return &desc->baSourceID[desc->bNrInPins + 2];
default:
- return NULL;
+ return 0;
}
}
--
ldv
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] uapi: fix linux/usb/audio.h userspace compilation error
2018-08-13 15:46 [PATCH] uapi: fix linux/usb/audio.h userspace compilation error Dmitry V. Levin
@ 2018-08-13 15:55 ` Takashi Iwai
2018-08-13 16:01 ` Dmitry V. Levin
0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2018-08-13 15:55 UTC (permalink / raw)
To: Dmitry V. Levin
Cc: Jorge Sanjuan, Ruslan Bilovol, Greg Kroah-Hartman, linux-kernel
On Mon, 13 Aug 2018 17:46:51 +0200,
Dmitry V. Levin wrote:
>
> Replace NULL with 0 in uac_mixer_unit_bmControls() to fix the following
> linux/usb/audio.h userspace compilation error:
>
> /usr/include/linux/usb/audio.h: In function 'uac_mixer_unit_bmControls':
> /usr/include/linux/usb/audio.h:304:10: error: 'NULL' undeclared (first use in this function)
> return NULL;
>
> Fixes: 6cfd839ae78e ("ALSA: usb-audio: UAC3. Add support for mixer unit.")
> Cc: <stable@vger.kernel.org> # v4.18
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Hrm, can we include the standard header for definition of NULL
instead? It's way too ugly to use 0 just for that.
thanks,
Takashi
> ---
> include/uapi/linux/usb/audio.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/usb/audio.h b/include/uapi/linux/usb/audio.h
> index 74e520fb944f..2b61fe34b2ca 100644
> --- a/include/uapi/linux/usb/audio.h
> +++ b/include/uapi/linux/usb/audio.h
> @@ -301,7 +301,7 @@ static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *
> case UAC_VERSION_3:
> return &desc->baSourceID[desc->bNrInPins + 2];
> default:
> - return NULL;
> + return 0;
> }
> }
>
> --
> ldv
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] uapi: fix linux/usb/audio.h userspace compilation error
2018-08-13 15:55 ` Takashi Iwai
@ 2018-08-13 16:01 ` Dmitry V. Levin
2018-08-13 16:09 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry V. Levin @ 2018-08-13 16:01 UTC (permalink / raw)
To: Takashi Iwai
Cc: Jorge Sanjuan, Ruslan Bilovol, Greg Kroah-Hartman, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 954 bytes --]
On Mon, Aug 13, 2018 at 05:55:25PM +0200, Takashi Iwai wrote:
> On Mon, 13 Aug 2018 17:46:51 +0200, Dmitry V. Levin wrote:
> >
> > Replace NULL with 0 in uac_mixer_unit_bmControls() to fix the following
> > linux/usb/audio.h userspace compilation error:
> >
> > /usr/include/linux/usb/audio.h: In function 'uac_mixer_unit_bmControls':
> > /usr/include/linux/usb/audio.h:304:10: error: 'NULL' undeclared (first use in this function)
> > return NULL;
> >
> > Fixes: 6cfd839ae78e ("ALSA: usb-audio: UAC3. Add support for mixer unit.")
> > Cc: <stable@vger.kernel.org> # v4.18
> > Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
>
> Hrm, can we include the standard header for definition of NULL
> instead? It's way too ugly to use 0 just for that.
It's fine to return 0 as a null pointer. If you prefer NULL,
please include a header that won't break userspace,
or just move the function out of UAPI.
Thanks,
--
ldv
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] uapi: fix linux/usb/audio.h userspace compilation error
2018-08-13 16:01 ` Dmitry V. Levin
@ 2018-08-13 16:09 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2018-08-13 16:09 UTC (permalink / raw)
To: Dmitry V. Levin
Cc: Jorge Sanjuan, Ruslan Bilovol, Greg Kroah-Hartman, linux-kernel
On Mon, 13 Aug 2018 18:01:06 +0200,
Dmitry V. Levin wrote:
>
> On Mon, Aug 13, 2018 at 05:55:25PM +0200, Takashi Iwai wrote:
> > On Mon, 13 Aug 2018 17:46:51 +0200, Dmitry V. Levin wrote:
> > >
> > > Replace NULL with 0 in uac_mixer_unit_bmControls() to fix the following
> > > linux/usb/audio.h userspace compilation error:
> > >
> > > /usr/include/linux/usb/audio.h: In function 'uac_mixer_unit_bmControls':
> > > /usr/include/linux/usb/audio.h:304:10: error: 'NULL' undeclared (first use in this function)
> > > return NULL;
> > >
> > > Fixes: 6cfd839ae78e ("ALSA: usb-audio: UAC3. Add support for mixer unit.")
> > > Cc: <stable@vger.kernel.org> # v4.18
> > > Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> >
> > Hrm, can we include the standard header for definition of NULL
> > instead? It's way too ugly to use 0 just for that.
>
> It's fine to return 0 as a null pointer.
Fine from syntax POV, but not from semantic.
> If you prefer NULL,
> please include a header that won't break userspace,
> or just move the function out of UAPI.
Maybe better to remove the function from uapi, then.
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-13 16:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-13 15:46 [PATCH] uapi: fix linux/usb/audio.h userspace compilation error Dmitry V. Levin
2018-08-13 15:55 ` Takashi Iwai
2018-08-13 16:01 ` Dmitry V. Levin
2018-08-13 16:09 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.