The volatile
helps that any pointer can be passed to the function without error or warning even if it is volatile
qualified.
But this is bogus, the driver you see seems not to be written very professionally.
First, to be complete such a pointer should also be const
qualified, only then it would capture really all pointers.
Then, there is no use case for such a function at all. In a _Bool
context (here !ptr
) pointers naturally lead to the correct answer, this is specified by the standard. Doing it differently as you see here is probably much frowned upon in the kernel community and I guess that this driver has not been reviewed properly.