From: You Kangren <youkangren@vivo.com>
To: Johannes Berg <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-wireless@vger.kernel.org (open list:MAC80211),
netdev@vger.kernel.org (open list:NETWORKING [GENERAL]),
linux-kernel@vger.kernel.org (open list)
Cc: opensource.kernel@vivo.com, youkangren@vivo.com
Subject: [PATCH v4] wifi:mac80211: Replace the ternary conditional operator with conditional-statements
Date: Mon, 3 Jul 2023 11:02:00 +0800 [thread overview]
Message-ID: <20230703030200.1067-1-youkangren@vivo.com> (raw)
Replacing ternary conditional operators with conditional statements
ensures proper expression of meaning while making it easier for
the compiler to generate code.
Signed-off-by: You Kangren <youkangren@vivo.com>
---
net/mac80211/tdls.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index a4af3b7675ef..41176491965d 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -946,7 +946,8 @@ 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;
+ if (link_id < 0)
+ link_id = 0;
rcu_read_lock();
link = rcu_dereference(sdata->link[link_id]);
if (WARN_ON(!link))
--
2.39.0
next reply other threads:[~2023-07-03 3:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-03 3:02 You Kangren [this message]
2023-07-03 8:01 ` [PATCH v4] wifi:mac80211: Replace the ternary conditional operator with conditional-statements Xi Ruoyao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230703030200.1067-1-youkangren@vivo.com \
--to=youkangren@vivo.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=opensource.kernel@vivo.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).