lkml.org 
[lkml]   [2022]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] RDMA: replace ternary operator with min()
On Thu, May 12, 2022 at 09:58:37PM +0800, Guo Zhengkui wrote:
> Fix the following coccicheck warnings:
>
> drivers/infiniband/sw/siw/siw_cm.c:1326:11-12: WARNING opportunity for min()
> drivers/infiniband/sw/siw/siw_cm.c:488:11-12: WARNING opportunity for min()
> drivers/infiniband/hw/cxgb4/cm.c:217:14-15: WARNING opportunity for min()
> drivers/infiniband/hw/cxgb4/cm.c:232:14-15: WARNING opportunity for min()
>
> min() macro is defined in include/linux/minmax.h. It avoids multiple
> evaluations of the arguments when non-constant and performs strict
> type-checking.

no, these are all error return patterns, if you want to change them to
something change them to

if (error < 0)
return error;
return 0;

Jason

\
 
 \ /
  Last update: 2022-05-12 16:11    [W:0.059 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site