lkml.org 
[lkml]   [2023]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] wifi:mac80211: Replace the ternar y conditional operator with max()
Date
Replace the ternary conditional operator with max() to make the code clean

Signed-off-by: You Kangren <youkangren@vivo.com>
---
net/mac80211/tdls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index a4af3b7675ef..9f8b0842a616 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -946,7 +946,7 @@ ieee80211_tdls_build_mgmt_packet_data(struct ieee80211_sub_if_data *sdata,
int ret;
struct ieee80211_link_data *link;

- link_id = link_id >= 0 ? link_id : 0;
+ link_id = max(link_id, 0);
rcu_read_lock();
link = rcu_dereference(sdata->link[link_id]);
if (WARN_ON(!link))
--
2.39.0
\
 
 \ /
  Last update: 2023-06-26 12:50    [W:0.053 / U:2.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site