lkml.org 
[lkml]   [2023]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [RFC PATCH] iov_iter: Convert iterate*() to inline funcs
    Date
    Linus Torvalds <torvalds@linux-foundation.org> 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

    \
     
     \ /
      Last update: 2023-08-14 15:14    [W:7.404 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site