lkml.org 
[lkml]   [2018]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] Change judgment len position
On Wed, Oct 24, 2018 at 9:54 AM Joe Perches <joe@perches.com> wrote:

> I think if the point is to test for negative numbers,
> it's clearer to do that before using min_t.and it's
> probably clearer not to use min_t at all.
>

...

>
> if (len > sizeof(int))
> len = sizeof(int);

It is a matter of taste really, I know some people (like me) sometimes
mixes min() and max()

I would suggest that if someones wants to change the current code, a
corresponding test
would be added in tools/testing/selftests/net

\
 
 \ /
  Last update: 2018-10-24 19:04    [W:0.064 / U:1.732 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site