lkml.org 
[lkml]   [2012]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] checkpatch: Suggest using min_t or max_t
From
On 5/27/11, Joe Perches <joe@perches.com> wrote:
> A common issue with min() or max() is using a cast on
> one or both of the arguments when using min_t/max_t could
> be better.
>
> Add cast detection to uses of min/max and suggest an
> appropriate use of min_t or max_t instead.
>
> Caveat: This only works for min() or max() on a single line.
> It does not find min() or max() split across multiple lines.
>
> This does find:
> min((u32)foo, bar);
> But it does not find:
> max((unsigned long)foo,
> bar);
>
> Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>
> v2: Make $match_balanced_parentheses work in perl 5.8

Has this been applied ?

v3.3 version of checkpatch.pl works for me, but v3.4, v3.5 & v3.6rc2 say:
Nested quantifiers in regex; marked by <-- HERE in m/(\((?:[^\(\)]++
<-- HERE |(?-1))*\))/ at scripts/checkpatch.pl line 340.

and my perl is :

perl --version

This is perl, v5.8.8 built for i586-linux-thread-multi

Philippe


\
 
 \ /
  Last update: 2012-09-05 14:03    [W:0.059 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site