On 11/14/22 13:41, kernel test robot wrote: > sound/core/hwdep.c:243:24: sparse: expected int [noderef] __user *__ptr_clean > sound/core/hwdep.c:243:24: sparse: got int * > sound/core/hwdep.c:273:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@ > sound/core/hwdep.c:273:29: sparse: expected int [noderef] __user *__ptr_clean > sound/core/hwdep.c:273:29: sparse: got int * > sound/core/hwdep.c:292:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected int [noderef] __user *__ptr_clean @@ got int * @@ > sound/core/hwdep.c:292:29: sparse: expected int [noderef] __user *__ptr_clean > sound/core/hwdep.c:292:29: sparse: got int * I think the sparse ends up throwing away all of its annotations once it dereferences a pointer. So, '*(int __user *)' boils down to a plain 'int'. Confusingly, a '*(int __user *) *' boils down to an 'int *'. That's what happened here. A __user-annotated point got dereferenced down to an 'int' and then turned into a pointer again. I think the trick in this case is to avoid dereferencing the pointer too early by just moving the dereference outside of the casting, like the attached patch. But, it also feels kinda wrong. I'd love a second opinion on this one.