* Mathieu Desnoyers ([email protected]) wrote:
> * Julien Desfossez ([email protected]) wrote:
> > This patch provides the copy_from_user and memset operations for the lib
> > ringbuffer.
> > 
> > Signed-off-by: Julien Desfossez <[email protected]>
[...]
> > +#undef tp_copy_string_from_user
> > +#define tp_copy_string_from_user(dest, src, len)                   \
> > +   __assign_##dest:                                                \
> > +   if (0)                                                          \
> > +           (void) __typemap.dest;                                  \
> > +   lib_ring_buffer_align_ctx(&__ctx, ltt_alignof(__typemap.dest)); \
> > +   __chan->ops->event_write_from_user(&__ctx, src, len - 1);       \
> 
> Hrm, thinking about it, it would make sense to have the caller to:
> 
> somelen assigned from   strlen(input);
> 
> tp_copy_string_from_user(dest, src, somelen)
> 
> So the "len - 1" here could be turned into "len", but we should comment
> that tp_copy_string_from_user takes the length without the \0, and that
> we implicitly add the \0. Makes sense ?

Hi Julien,

I did the modifications and merged your patch, thanks!

Mathieu

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
ltt-dev mailing list
[email protected]
http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev

Reply via email to