* [PATCH v4] Staging: rtl8188eu: Remove redundant if condition
@ 2015-02-23 19:46 Vatika Harlalka
2015-02-23 19:51 ` [Outreachy kernel] " Jes Sorensen
0 siblings, 1 reply; 3+ messages in thread
From: Vatika Harlalka @ 2015-02-23 19:46 UTC (permalink / raw)
To: outreachy-kernel
Remove redundant if condition as !result is always false.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
Changes in v4: Added "Staging: rtl8188eu" to commit message.
Changes in v3: Removed unneeded newline after if condition to
follow kernel coding conventions.
Changes in v2: Removed {} around the outer if condition as
it has single statement.
drivers/staging/rtl8188eu/hal/phy.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 3f663fe..e005150 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -386,19 +386,18 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
static u8 get_right_chnl_for_iqk(u8 chnl)
{
+ u8 place;
u8 channel_all[ODM_TARGET_CHNL_NUM_2G_5G] = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64,
100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122,
124, 126, 128, 130, 132, 134, 136, 138, 140, 149, 151, 153,
155, 157, 159, 161, 163, 165
};
- u8 place = chnl;
if (chnl > 14) {
- for (place = 14; place < sizeof(channel_all); place++) {
+ for (place = 0; place < sizeof(channel_all); place++) {
if (channel_all[place] == chnl)
- return place-13;
+ return ++place;
}
}
return 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Outreachy kernel] [PATCH v4] Staging: rtl8188eu: Remove redundant if condition
2015-02-23 19:46 [PATCH v4] Staging: rtl8188eu: Remove redundant if condition Vatika Harlalka
@ 2015-02-23 19:51 ` Jes Sorensen
0 siblings, 0 replies; 3+ messages in thread
From: Jes Sorensen @ 2015-02-23 19:51 UTC (permalink / raw)
To: Vatika Harlalka, outreachy-kernel
On 02/23/15 14:46, Vatika Harlalka wrote:
> Remove redundant if condition as !result is always false.
>
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
> Changes in v4: Added "Staging: rtl8188eu" to commit message.
> Changes in v3: Removed unneeded newline after if condition to
> follow kernel coding conventions.
> Changes in v2: Removed {} around the outer if condition as
> it has single statement.
>
> drivers/staging/rtl8188eu/hal/phy.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
The patch description here does not match the code.
Jes
> diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
> index 3f663fe..e005150 100644
> --- a/drivers/staging/rtl8188eu/hal/phy.c
> +++ b/drivers/staging/rtl8188eu/hal/phy.c
> @@ -386,19 +386,18 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
>
> static u8 get_right_chnl_for_iqk(u8 chnl)
> {
> + u8 place;
> u8 channel_all[ODM_TARGET_CHNL_NUM_2G_5G] = {
> - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
> 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64,
> 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122,
> 124, 126, 128, 130, 132, 134, 136, 138, 140, 149, 151, 153,
> 155, 157, 159, 161, 163, 165
> };
> - u8 place = chnl;
>
> if (chnl > 14) {
> - for (place = 14; place < sizeof(channel_all); place++) {
> + for (place = 0; place < sizeof(channel_all); place++) {
> if (channel_all[place] == chnl)
> - return place-13;
> + return ++place;
> }
> }
> return 0;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v4] Staging: rtl8188eu: Remove redundant if condition
@ 2015-02-26 13:01 Vatika Harlalka
0 siblings, 0 replies; 3+ messages in thread
From: Vatika Harlalka @ 2015-02-26 13:01 UTC (permalink / raw)
To: outreachy-kernel
Remove redundant if condition as !result is always false.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
Changes in v4: Added "Staging: rtl8188eu" to commit message.
Changes in v3: Removed unneeded newline after if condition to
follow kernel coding conventions.
Changes in v2: Removed {} around the outer if condition as
it has single statement.
drivers/staging/rtl8188eu/hal/phy.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index a91bc6d..a708ff9 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -361,7 +361,6 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
{
struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt);
u8 tmpchannel = hal_data->CurrentChannel;
- bool result = true;
if (hal_data->rf_chip == RF_PSEUDO_11N)
return;
@@ -371,15 +370,10 @@ void phy_sw_chnl(struct adapter *adapt, u8 channel)
hal_data->CurrentChannel = channel;
- if ((!adapt->bDriverStopped) && (!adapt->bSurpriseRemoved)) {
+ if ((!adapt->bDriverStopped) && (!adapt->bSurpriseRemoved))
phy_sw_chnl_callback(adapt, channel);
-
- if (!result)
- hal_data->CurrentChannel = tmpchannel;
-
- } else {
+ else
hal_data->CurrentChannel = tmpchannel;
- }
}
#define ODM_TXPWRTRACK_MAX_IDX_88E 6
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-26 13:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23 19:46 [PATCH v4] Staging: rtl8188eu: Remove redundant if condition Vatika Harlalka
2015-02-23 19:51 ` [Outreachy kernel] " Jes Sorensen
-- strict thread matches above, loose matches on Subject: below --
2015-02-26 13:01 Vatika Harlalka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.