lkml.org 
[lkml]   [2016]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net-next v2 4/5] net: l2tp: cleanup: remove redundant condition
From
From: Asbjoern Sloth Toennesen <asbjorn@asbjorn.st>
Date: Mon, 7 Nov 2016 20:39:27 +0000

> These assignments follow this pattern:
>
> unsigned int foo:1;
> struct nlattr *nla = info->attrs[bar];
>
> if (nla)
> foo = nla_get_flag(nla); /* expands to: foo = !!nla */
>
> This could be simplified to: if (nla) foo = 1;
> but lets just remove the condition and use the macro,
>
> foo = nla_get_flag(nla);
>
> Signed-off-by: Asbjoern Sloth Toennesen <asbjorn@asbjorn.st>

Applied.

\
 
 \ /
  Last update: 2016-11-10 00:58    [W:0.090 / U:1.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site