* [PATCH v3] Staging: rtl8188eu: Reindent code to reduce line size
@ 2015-02-23 9:44 Vatika Harlalka
2015-02-23 20:07 ` [Outreachy kernel] " Jes Sorensen
2015-02-23 20:10 ` Jes Sorensen
0 siblings, 2 replies; 4+ messages in thread
From: Vatika Harlalka @ 2015-02-23 9:44 UTC (permalink / raw)
To: outreachy-kernel
Reindent code to reduce line size and increase readability.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
Changes in v3: Fixed spelling error in commit message.
Changes in v2: Changed subject line to imperative form ( "Reindented" to "Reindent" ).
drivers/staging/rtl8188eu/hal/bb_cfg.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c
index e1b5437..5ad080a 100644
--- a/drivers/staging/rtl8188eu/hal/bb_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c
@@ -508,7 +508,8 @@ static u32 array_phy_reg_pg_8188e[] = {
};
-static void store_pwrindex_offset(struct adapter *Adapter, u32 regaddr, u32 bitmask, u32 data)
+static void store_pwrindex_offset(struct adapter *Adapter,
+ u32 regaddr, u32 bitmask, u32 data)
{
struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
u8 pwrGrpCnt = hal_data->pwrGroupCnt;
@@ -553,7 +554,8 @@ static void store_pwrindex_offset(struct adapter *Adapter, u32 regaddr, u32 bitm
}
}
-static void rtl_addr_delay(struct adapter *adapt, u32 addr, u32 bit_mask, u32 data)
+static void rtl_addr_delay(struct adapter *adapt,
+ u32 addr, u32 bit_mask, u32 data)
{
if (addr == 0xfe)
msleep(50);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Outreachy kernel] [PATCH v3] Staging: rtl8188eu: Reindent code to reduce line size
2015-02-23 9:44 [PATCH v3] Staging: rtl8188eu: Reindent code to reduce line size Vatika Harlalka
@ 2015-02-23 20:07 ` Jes Sorensen
2015-02-23 20:10 ` Jes Sorensen
1 sibling, 0 replies; 4+ messages in thread
From: Jes Sorensen @ 2015-02-23 20:07 UTC (permalink / raw)
To: Vatika Harlalka, outreachy-kernel
On 02/23/15 04:44, Vatika Harlalka wrote:
> Reindent code to reduce line size and increase readability.
>
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
> Changes in v3: Fixed spelling error in commit message.
> Changes in v2: Changed subject line to imperative form ( "Reindented" to "Reindent" ).
>
> drivers/staging/rtl8188eu/hal/bb_cfg.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c
> index e1b5437..5ad080a 100644
> --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c
> +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c
> @@ -508,7 +508,8 @@ static u32 array_phy_reg_pg_8188e[] = {
>
> };
>
> -static void store_pwrindex_offset(struct adapter *Adapter, u32 regaddr, u32 bitmask, u32 data)
> +static void store_pwrindex_offset(struct adapter *Adapter,
> + u32 regaddr, u32 bitmask, u32 data)
You need to get the alignment right of you break up lines - the second
line function arguments need to line up with the opening bracket of the
function. This goes for both functions.
Once broken up, the above should look like this:
static void store_pwrindex_offset(struct adapter *Adapter,
u32 regaddr, u32 bitmask, u32 data)
Jes
> {
> struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
> u8 pwrGrpCnt = hal_data->pwrGroupCnt;
> @@ -553,7 +554,8 @@ static void store_pwrindex_offset(struct adapter *Adapter, u32 regaddr, u32 bitm
> }
> }
>
> -static void rtl_addr_delay(struct adapter *adapt, u32 addr, u32 bit_mask, u32 data)
> +static void rtl_addr_delay(struct adapter *adapt,
> + u32 addr, u32 bit_mask, u32 data)
> {
> if (addr == 0xfe)
> msleep(50);
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Outreachy kernel] [PATCH v3] Staging: rtl8188eu: Reindent code to reduce line size
2015-02-23 9:44 [PATCH v3] Staging: rtl8188eu: Reindent code to reduce line size Vatika Harlalka
2015-02-23 20:07 ` [Outreachy kernel] " Jes Sorensen
@ 2015-02-23 20:10 ` Jes Sorensen
2015-02-26 12:53 ` Vatika Harlalka
1 sibling, 1 reply; 4+ messages in thread
From: Jes Sorensen @ 2015-02-23 20:10 UTC (permalink / raw)
To: Vatika Harlalka, outreachy-kernel
On 02/23/15 04:44, Vatika Harlalka wrote:
> Reindent code to reduce line size and increase readability.
>
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
> Changes in v3: Fixed spelling error in commit message.
> Changes in v2: Changed subject line to imperative form ( "Reindented" to "Reindent" ).
>
> drivers/staging/rtl8188eu/hal/bb_cfg.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c
> index e1b5437..5ad080a 100644
> --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c
> +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c
> @@ -508,7 +508,8 @@ static u32 array_phy_reg_pg_8188e[] = {
>
> };
>
> -static void store_pwrindex_offset(struct adapter *Adapter, u32 regaddr, u32 bitmask, u32 data)
> +static void store_pwrindex_offset(struct adapter *Adapter,
> + u32 regaddr, u32 bitmask, u32 data)
> {
> struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
> u8 pwrGrpCnt = hal_data->pwrGroupCnt;
It looks like you already started addressing the follow-on issue that I
wanted to raise, but you didn't specify that this patch should go on top
of another patch.
You shouldn't really use u8 for an index, it is better to use int, and
if you pick a shorter name it will help breaking down the lines in the
follow-on code. I would recommend doing something like this:
int idx = hal_data->pwrGroupCnt;
if (regaddr == rTxAGC_A_Rate18_06)
hal_data->MCSTxPowerLevelOriginalOffset[idx][0] = data;
..... do this for all users of hal_data->pwrGroupCnt in this function.
Cheers,
Jes
> @@ -553,7 +554,8 @@ static void store_pwrindex_offset(struct adapter *Adapter, u32 regaddr, u32 bitm
> }
> }
>
> -static void rtl_addr_delay(struct adapter *adapt, u32 addr, u32 bit_mask, u32 data)
> +static void rtl_addr_delay(struct adapter *adapt,
> + u32 addr, u32 bit_mask, u32 data)
> {
> if (addr == 0xfe)
> msleep(50);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-26 12:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23 9:44 [PATCH v3] Staging: rtl8188eu: Reindent code to reduce line size Vatika Harlalka
2015-02-23 20:07 ` [Outreachy kernel] " Jes Sorensen
2015-02-23 20:10 ` Jes Sorensen
2015-02-26 12:53 ` 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.