[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <2513b1520d533c9f487903fc2c97f4637fe5f6da.1649288226.git.remckee0@gmail.com>
Date: Wed, 6 Apr 2022 19:09:43 -0500
From: Rebecca Mckeever <remckee0@...il.com>
To: outreachy@...ts.linux.dev
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Rebecca Mckeever <remckee0@...il.com>
Subject: [PATCH 1/2] staging: rtl8192u: use max macro instead of ternary operator
Replace ternary operator with max macro to increase readability
and conform to Linux kernel coding style.
Found with minmax coccinelle script.
Signed-off-by: Rebecca Mckeever <remckee0@...il.com>
---
drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index 78cc8f357bbc..a10c1303695b 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -470,7 +470,7 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
return 0;
}
len = crypt->ops->get_key(keybuf, SCM_KEY_LEN, NULL, crypt->priv);
- erq->length = (len >= 0 ? len : 0);
+ erq->length = max(len, 0);
erq->flags |= IW_ENCODE_ENABLED;
--
2.32.0
Powered by blists - more mailing lists