mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
To: gregkh@linuxfoundation.org
Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 7/8] staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtllib_parse_info_param()
Date: Wed,  8 Apr 2015 01:08:56 +0200	[thread overview]
Message-ID: <1428448137-26768-8-git-send-email-mateusz.kulikowski@gmail.com> (raw)
In-Reply-To: <1428448137-26768-1-git-send-email-mateusz.kulikowski@gmail.com>

- Replace ?: with min_t
- Remove condition that is always true

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
---
 drivers/staging/rtl8192e/rtllib_rx.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 95cd17e..bb789cc 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1924,13 +1924,12 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
 				   info_element->data[2] == 0x4c &&
 				   info_element->data[3] == 0x033) {
 
-						tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN);
-						if (tmp_htcap_len != 0) {
-							network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC;
-							network->bssht.bdHTCapLen = tmp_htcap_len > sizeof(network->bssht.bdHTCapBuf) ?
-								sizeof(network->bssht.bdHTCapBuf) : tmp_htcap_len;
-							memcpy(network->bssht.bdHTCapBuf, info_element->data, network->bssht.bdHTCapLen);
-						}
+					tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN);
+					if (tmp_htcap_len != 0) {
+						network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC;
+						network->bssht.bdHTCapLen = min_t(u16, tmp_htcap_len, sizeof(network->bssht.bdHTCapBuf));
+						memcpy(network->bssht.bdHTCapBuf, info_element->data, network->bssht.bdHTCapLen);
+					}
 				}
 				if (tmp_htcap_len != 0) {
 					network->bssht.bdSupportHT = true;
@@ -1951,12 +1950,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
 					tmp_htinfo_len = min_t(u8, info_element->len, MAX_IE_LEN);
 					if (tmp_htinfo_len != 0) {
 						network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC;
-						if (tmp_htinfo_len) {
-							network->bssht.bdHTInfoLen = tmp_htinfo_len > sizeof(network->bssht.bdHTInfoBuf) ?
-								sizeof(network->bssht.bdHTInfoBuf) : tmp_htinfo_len;
-							memcpy(network->bssht.bdHTInfoBuf, info_element->data, network->bssht.bdHTInfoLen);
-						}
-
+						network->bssht.bdHTInfoLen = min_t(u16, tmp_htinfo_len, sizeof(network->bssht.bdHTInfoBuf));
+						memcpy(network->bssht.bdHTInfoBuf, info_element->data, network->bssht.bdHTInfoLen);
 					}
 
 				}
-- 
1.8.4.1


  parent reply	other threads:[~2015-04-07 23:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07 23:08 [PATCH 0/8] staging: rtl8192e: Fix more checkpatch.pl warnings Mateusz Kulikowski
2015-04-07 23:08 ` [PATCH 1/8] staging: rtl8192e: Fix SPACE_BEFORE_TAB warnings Mateusz Kulikowski
2015-04-07 23:08 ` [PATCH 2/8] staging: rtl8192e: Copy comments from r819XE_phyreg.h to r8192E_phyreg.h Mateusz Kulikowski
2015-04-07 23:08 ` [PATCH 3/8] staging: rtl8192e: remove r819xE_phyreg.h Mateusz Kulikowski
2015-04-07 23:08 ` [PATCH 4/8] staging: rtl8192e: Fix SPACING errors Mateusz Kulikowski
2015-04-07 23:08 ` [PATCH 5/8] staging: rtl8192e: Remove bb tx gains from r8192_priv Mateusz Kulikowski
2015-04-07 23:08 ` [PATCH 6/8] staging: rtl8192e: Fix LINE_SPACING warning Mateusz Kulikowski
2015-04-07 23:08 ` Mateusz Kulikowski [this message]
2015-04-07 23:08 ` [PATCH 8/8] staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtl_dm.c Mateusz Kulikowski
2015-04-13 22:37 ` [PATCH 0/8] staging: rtl8192e: Fix more checkpatch.pl warnings Mateusz Kulikowski

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=1428448137-26768-8-git-send-email-mateusz.kulikowski@gmail.com \
    --to=mateusz.kulikowski@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®