On Sun, 17 Aug 2025 at 08:29, David Laight <david.laight.linux@xxxxxxxxx> wrote: > > Just requiring the caller pass &user_ptr would make it more obvious. > The generated code (with 'src' -> *&src) will be the same. I personally absolutely detest passing pointers in and then hoping the compiler will fix it up and not make the assembler do the stupid thing that the source code does. That's actually true in general - I strive to make the source code and the generated code line up fairly closely, rather than "compilers fix up the mistakes in the source code". > > We've done this before, and I have done it myself. The classic example > > is the whole "do_div()" macro that everybody hated because it did > > exactly the same thing > > Divide is (well was, I think my zen5 has a fast divide) also slow enough that > I doubt it would have mattered. It mattered for code generation quality and smaller simpler code to look at. I still look at the generated asm (not for do_div(), but other things), and having compiler-generated code that makes sense and matches the source is a big plus in my book. Linus