diff mbox

[5/7] mwifiex: scan: replace pointer arithmetic with array access

Message ID 1456358932-23114-6-git-send-email-afenkart@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Andreas Fenkart Feb. 25, 2016, 12:08 a.m. UTC
improves readability

Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
 drivers/net/wireless/marvell/mwifiex/scan.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

Comments

Julian Calaby Feb. 25, 2016, 1:07 a.m. UTC | #1
Hi,

On Thu, Feb 25, 2016 at 11:08 AM, Andreas Fenkart <afenkart@gmail.com> wrote:
> improves readability
>
> Signed-off-by: Andreas Fenkart <afenkart@gmail.com>

Looks correct to me.

Reviewed-by: Julian Calaby <julian.calaby@gmail.com>

> ---
>  drivers/net/wireless/marvell/mwifiex/scan.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
> index 5588750..6ddc98b 100644
> --- a/drivers/net/wireless/marvell/mwifiex/scan.c
> +++ b/drivers/net/wireless/marvell/mwifiex/scan.c
> @@ -999,27 +999,24 @@ mwifiex_config_scan(struct mwifiex_private *priv,
>                      chan_idx++) {
>
>                         channel = user_scan_in->chan_list[chan_idx].chan_number;
> -                       (scan_chan_list + chan_idx)->chan_number = channel;
> +                       scan_chan_list[chan_idx].chan_number = channel;
>
>                         radio_type =
>                                 user_scan_in->chan_list[chan_idx].radio_type;
> -                       (scan_chan_list + chan_idx)->radio_type = radio_type;
> +                       scan_chan_list[chan_idx].radio_type = radio_type;
>
>                         scan_type = user_scan_in->chan_list[chan_idx].scan_type;
>
>                         if (scan_type == MWIFIEX_SCAN_TYPE_PASSIVE)
> -                               (scan_chan_list +
> -                                chan_idx)->chan_scan_mode_bitmap
> +                               scan_chan_list[chan_idx].chan_scan_mode_bitmap
>                                         |= (MWIFIEX_PASSIVE_SCAN |
>                                             MWIFIEX_HIDDEN_SSID_REPORT);
>                         else
> -                               (scan_chan_list +
> -                                chan_idx)->chan_scan_mode_bitmap
> +                               scan_chan_list[chan_idx].chan_scan_mode_bitmap
>                                         &= ~MWIFIEX_PASSIVE_SCAN;
>
>                         if (*filtered_scan)
> -                               (scan_chan_list +
> -                                chan_idx)->chan_scan_mode_bitmap
> +                               scan_chan_list[chan_idx].chan_scan_mode_bitmap
>                                         |= MWIFIEX_DISABLE_CHAN_FILT;
>
>                         if (user_scan_in->chan_list[chan_idx].scan_time) {
> @@ -1034,9 +1031,9 @@ mwifiex_config_scan(struct mwifiex_private *priv,
>                                         scan_dur = adapter->active_scan_time;
>                         }
>
> -                       (scan_chan_list + chan_idx)->min_scan_time =
> +                       scan_chan_list[chan_idx].min_scan_time =
>                                 cpu_to_le16(scan_dur);
> -                       (scan_chan_list + chan_idx)->max_scan_time =
> +                       scan_chan_list[chan_idx].max_scan_time =
>                                 cpu_to_le16(scan_dur);
>                 }
>
> --
> 2.7.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Thanks,
diff mbox

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index 5588750..6ddc98b 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -999,27 +999,24 @@  mwifiex_config_scan(struct mwifiex_private *priv,
 		     chan_idx++) {
 
 			channel = user_scan_in->chan_list[chan_idx].chan_number;
-			(scan_chan_list + chan_idx)->chan_number = channel;
+			scan_chan_list[chan_idx].chan_number = channel;
 
 			radio_type =
 				user_scan_in->chan_list[chan_idx].radio_type;
-			(scan_chan_list + chan_idx)->radio_type = radio_type;
+			scan_chan_list[chan_idx].radio_type = radio_type;
 
 			scan_type = user_scan_in->chan_list[chan_idx].scan_type;
 
 			if (scan_type == MWIFIEX_SCAN_TYPE_PASSIVE)
-				(scan_chan_list +
-				 chan_idx)->chan_scan_mode_bitmap
+				scan_chan_list[chan_idx].chan_scan_mode_bitmap
 					|= (MWIFIEX_PASSIVE_SCAN |
 					    MWIFIEX_HIDDEN_SSID_REPORT);
 			else
-				(scan_chan_list +
-				 chan_idx)->chan_scan_mode_bitmap
+				scan_chan_list[chan_idx].chan_scan_mode_bitmap
 					&= ~MWIFIEX_PASSIVE_SCAN;
 
 			if (*filtered_scan)
-				(scan_chan_list +
-				 chan_idx)->chan_scan_mode_bitmap
+				scan_chan_list[chan_idx].chan_scan_mode_bitmap
 					|= MWIFIEX_DISABLE_CHAN_FILT;
 
 			if (user_scan_in->chan_list[chan_idx].scan_time) {
@@ -1034,9 +1031,9 @@  mwifiex_config_scan(struct mwifiex_private *priv,
 					scan_dur = adapter->active_scan_time;
 			}
 
-			(scan_chan_list + chan_idx)->min_scan_time =
+			scan_chan_list[chan_idx].min_scan_time =
 				cpu_to_le16(scan_dur);
-			(scan_chan_list + chan_idx)->max_scan_time =
+			scan_chan_list[chan_idx].max_scan_time =
 				cpu_to_le16(scan_dur);
 		}