mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 15:31:14 +07:00
ALSA: control: remove compilation warning on 32-bit
This was introduced by 'ALSA: control: add support for ENUMERATED user space controls' which adds a u64 variable that gets cast to a pointer: sound/core/control.c: In function 'snd_ctl_elem_init_enum_names': sound/core/control.c:1089: warning: cast to pointer from integer of different size Cast to uintptr_t before casting to pointer to avoid the warning. Signed-off-by: Olof Johansson <olof@lixom.net> [cl: replace long with uintptr_t] Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
862a6244eb
commit
447c6f93ab
@ -1081,12 +1081,12 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue)
|
|||||||
char *names, *p;
|
char *names, *p;
|
||||||
size_t buf_len, name_len;
|
size_t buf_len, name_len;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
const uintptr_t user_ptrval = ue->info.value.enumerated.names_ptr;
|
||||||
|
|
||||||
if (ue->info.value.enumerated.names_length > 64 * 1024)
|
if (ue->info.value.enumerated.names_length > 64 * 1024)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
names = memdup_user(
|
names = memdup_user((const void __user *)user_ptrval,
|
||||||
(const void __user *)ue->info.value.enumerated.names_ptr,
|
|
||||||
ue->info.value.enumerated.names_length);
|
ue->info.value.enumerated.names_length);
|
||||||
if (IS_ERR(names))
|
if (IS_ERR(names))
|
||||||
return PTR_ERR(names);
|
return PTR_ERR(names);
|
||||||
|
Loading…
Reference in New Issue
Block a user