Re: [PATCH -next 1/6] staging: rtl8723bs: ieee80211: remove unused variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 26, 2021 at 06:17:31PM -0600, Edmundo Carmona Antoranz wrote:
> sec_idx in rtw_get_sec_ie() is set to 0 and never changes value. Also,
> it is only used for debugging messages. Therefore the variable is
> removed and the debug messages are adjusted. Adjusting debug messages
> forced style changes. Taking the opportunity to adjust indentation
> of those sections of the code.

The re-indents are not related to the other change so you're going to
have to split this up into two different patches.

Generally you're making a whitespace change on the same line as the code
you are changing then that's fine.  But sometimes re-indenting it makes
the change harder to spot (review).  I would say that this code is
easier to review without any indenting changes:

ONE:

-				RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n rtw_get_wpa_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n", sec_idx, in_ie[cnt+1]+2));
+				RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n rtw_get_wpa_ie: in_ie[cnt+1]+2 =%d\n", in_ie[cnt+1]+2));


TWO:

-				RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n rtw_get_wpa_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n", sec_idx, in_ie[cnt+1]+2));
+			RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
+				 ("\n rtw_get_wpa_ie: in_ie[cnt+1]+2 =%d\n", in_ie[cnt + 1] + 2));

>  				memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt+1]+2);
>  
>  				for (i = 0; i < (in_ie[cnt+1]+2); i = i+8) {
> -						RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
> -									wpa_ie[i], wpa_ie[i+1], wpa_ie[i+2], wpa_ie[i+3], wpa_ie[i+4],
> -									wpa_ie[i+5], wpa_ie[i+6], wpa_ie[i+7]));
> -					}
> +					RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
> +						 ("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
> +						  wpa_ie[i], wpa_ie[i + 1], wpa_ie[i + 2],
> +						  wpa_ie[i + 3], wpa_ie[i + 4],
> +						  wpa_ie[i + 5], wpa_ie[i + 6],
> +						  wpa_ie[i + 7]));

In this case, the curly braces were fine in the original.  Multi-line
indented normally get curly braces for readability.

>  				}
> +			}
>  

regards,
dan carpenter





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux