Re: [RFC PATCH] iov_iter: Convert iterate*() to inline funcs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> 
> So I think you need to remove the changes you did to
> memcpy_from_iter(). The old code was an explicit conditional of direct
> calls:
> 
>         if (iov_iter_is_copy_mc(i))
>                 return (void *)copy_mc_to_kernel(to, from, size);
>         return memcpy(to, from, size);
> 
> and now you do that
> 
>                                    iov_iter_is_copy_mc(i) ?
>                                    memcpy_from_iter_mc : memcpy_from_iter);
> 
> to pass in a function pointer.
> 
> Not ok. Not ok at all. It may look clever, but function pointers are
> bad. Avoid them like the plague.

Yeah.  I was hoping that the compiler would manage to inline that, but it just
does an indirect call.  I'm trying to avoid passing the iterator as that makes
things bigger.  I think I can probably share the extra argument used for
passing checksums.

David




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux