uapi: fix linux/usb/audio.h userspace compilation error
PATCH 1/1 uapi: fix linux/usb/audio.h userspace compilation error
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;
--- include/uapi/linux/usb/audio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/usb/audio.h +1 -1
@@ -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 ; } }
Signature · 1 line
ldv
Quoted 11 lines · Dmitry V. Levin
Replace NULL with 0 in
uac_mixer_unit_bmControls()to fix the followinglinux/usb/audio.huserspace 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 <[email protected]> # v4.18Signed-off-by Dmitry V. Levin <[email protected]>
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
Quoted 20 lines
--- include/uapi/linux/usb/audio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/uapi/linux/usb/audio.h +1
-1@@ -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 ; } }Signature · 1 line
ldv
Quoted 9 lines · Takashi Iwai
Quoted 8 lines · Dmitry V. Levin
Replace NULL with 0 in
uac_mixer_unit_bmControls()to fix the followinglinux/usb/audio.huserspace 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;
Quoted 6 lines
Quoted 3 lines
Fixes 6cfd839ae78e ("ALSA: usb-audio: UAC3. Add support for mixer unit.")Cc <[email protected]> # v4.18Signed-off-by Dmitry V. Levin <[email protected]>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,
Signature · 1 line
ldv
Quoted 11 lines · Dmitry V. Levin
Quoted 9 lines · Takashi Iwai
Quoted 8 lines · Dmitry V. Levin
Replace NULL with 0 in
uac_mixer_unit_bmControls()to fix the followinglinux/usb/audio.huserspace 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;
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Fixes 6cfd839ae78e ("ALSA: usb-audio: UAC3. Add support for mixer unit.")Cc <[email protected]> # v4.18Signed-off-by Dmitry V. Levin <[email protected]>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.
Quoted 3 lines
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