[alsa-devel] [PATCH 18/19] ALSA: ymu831: add hwdep ioctl

Takashi Iwai tiwai at suse.de
Wed Jan 16 12:53:59 CET 2013


At Wed, 16 Jan 2013 17:44:29 +0900,
Yoichi Yuasa wrote:
> 
> 
> +#define MC_ASOC_MAGIC			'N'
> +#define MC_ASOC_IOCTL_SET_CTRL		1
> +#define MC_ASOC_IOCTL_NOTIFY_HOLD	4
> +
> +struct ymc_ctrl_args {
> +	void *param;
> +	unsigned long size;
> +	unsigned long option;
> +};

Using a pointer in an ioctl data struct is a very bad idea in
general.  Don't do it unless you really really need it.  Otherwise
you'd have to provide a 32/64 bit conversion for compat_ioctl.

Ditto for using long type there.  They need conversions as well.
For ioctl structs, use only types with strict size definitions.


Takashi


More information about the Alsa-devel mailing list