Re: [PATCH] uapi: fix linux/usb/audio.h userspace compilation error

From: Takashi Iwai
Date: Mon Aug 13 2018 - 11:55:30 EST


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@xxxxxxxxxxxxxxx> # v4.18
> Signed-off-by: Dmitry V. Levin <ldv@xxxxxxxxxxxx>

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
>