* [PATCH 2/3] [Outreachy kernel] staging: sm750fb: avoid camelcase structure fields
@ 2019-03-21 11:11 Payal Kshirsagar
2019-03-21 19:05 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Payal Kshirsagar @ 2019-03-21 11:11 UTC (permalink / raw)
To: outreachy-kernel; +Cc: Payal Kshirsagar
Eliminate camelcase structure fields to fix the style issue – ‘avoid
camelcase’.
Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
---
drivers/staging/sm750fb/ddk750_mode.c | 52 +++++++++++++++++------------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c
index 5e35fec..b55cd96 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -13,13 +13,13 @@
* HW only supports 7 predefined pixel clocks, and clock select is
* in bit 29:27 of Display Control register.
*/
-static unsigned long display_control_adjust_SM750LE(struct mode_parameter *pModeParam,
+static unsigned long display_control_adjust_SM750LE(struct mode_parameter *p_mode_param,
unsigned long dispcontrol)
{
unsigned long x, y;
- x = pModeParam->horizontal_display_end;
- y = pModeParam->vertical_display_end;
+ x = p_mode_param->horizontal_display_end;
+ y = p_mode_param->vertical_display_end;
/*
* SM750LE has to set up the top-left and bottom-right
@@ -74,7 +74,7 @@ static unsigned long display_control_adjust_SM750LE(struct mode_parameter *pMode
}
/* only timing related registers will be programed */
-static int program_mode_registers(struct mode_parameter *pModeParam,
+static int program_mode_registers(struct mode_parameter *p_mode_param,
struct pll_value *pll)
{
int ret = 0;
@@ -85,46 +85,46 @@ static int program_mode_registers(struct mode_parameter *pModeParam,
/* programe secondary pixel clock */
poke32(CRT_PLL_CTRL, sm750_format_pll_reg(pll));
- tmp = ((pModeParam->horizontal_total - 1) <<
+ tmp = ((p_mode_param->horizontal_total - 1) <<
CRT_HORIZONTAL_TOTAL_TOTAL_SHIFT) &
CRT_HORIZONTAL_TOTAL_TOTAL_MASK;
- tmp |= (pModeParam->horizontal_display_end - 1) &
+ tmp |= (p_mode_param->horizontal_display_end - 1) &
CRT_HORIZONTAL_TOTAL_DISPLAY_END_MASK;
poke32(CRT_HORIZONTAL_TOTAL, tmp);
- tmp = (pModeParam->horizontal_sync_width <<
+ tmp = (p_mode_param->horizontal_sync_width <<
CRT_HORIZONTAL_SYNC_WIDTH_SHIFT) &
CRT_HORIZONTAL_SYNC_WIDTH_MASK;
- tmp |= (pModeParam->horizontal_sync_start - 1) &
+ tmp |= (p_mode_param->horizontal_sync_start - 1) &
CRT_HORIZONTAL_SYNC_START_MASK;
poke32(CRT_HORIZONTAL_SYNC, tmp);
- tmp = ((pModeParam->vertical_total - 1) <<
+ tmp = ((p_mode_param->vertical_total - 1) <<
CRT_VERTICAL_TOTAL_TOTAL_SHIFT) &
CRT_VERTICAL_TOTAL_TOTAL_MASK;
- tmp |= (pModeParam->vertical_display_end - 1) &
+ tmp |= (p_mode_param->vertical_display_end - 1) &
CRT_VERTICAL_TOTAL_DISPLAY_END_MASK;
poke32(CRT_VERTICAL_TOTAL, tmp);
- tmp = ((pModeParam->vertical_sync_height <<
+ tmp = ((p_mode_param->vertical_sync_height <<
CRT_VERTICAL_SYNC_HEIGHT_SHIFT)) &
CRT_VERTICAL_SYNC_HEIGHT_MASK;
- tmp |= (pModeParam->vertical_sync_start - 1) &
+ tmp |= (p_mode_param->vertical_sync_start - 1) &
CRT_VERTICAL_SYNC_START_MASK;
poke32(CRT_VERTICAL_SYNC, tmp);
tmp = DISPLAY_CTRL_TIMING | DISPLAY_CTRL_PLANE;
- if (pModeParam->vertical_sync_polarity)
+ if (p_mode_param->vertical_sync_polarity)
tmp |= DISPLAY_CTRL_VSYNC_PHASE;
- if (pModeParam->horizontal_sync_polarity)
+ if (p_mode_param->horizontal_sync_polarity)
tmp |= DISPLAY_CTRL_HSYNC_PHASE;
if (sm750_get_chip_type() == SM750LE) {
- display_control_adjust_SM750LE(pModeParam, tmp);
+ display_control_adjust_SM750LE(p_mode_param, tmp);
} else {
reg = peek32(CRT_DISPLAY_CTRL) &
~(DISPLAY_CTRL_VSYNC_PHASE |
@@ -139,40 +139,40 @@ static int program_mode_registers(struct mode_parameter *pModeParam,
poke32(PANEL_PLL_CTRL, sm750_format_pll_reg(pll));
- reg = ((pModeParam->horizontal_total - 1) <<
+ reg = ((p_mode_param->horizontal_total - 1) <<
PANEL_HORIZONTAL_TOTAL_TOTAL_SHIFT) &
PANEL_HORIZONTAL_TOTAL_TOTAL_MASK;
- reg |= ((pModeParam->horizontal_display_end - 1) &
+ reg |= ((p_mode_param->horizontal_display_end - 1) &
PANEL_HORIZONTAL_TOTAL_DISPLAY_END_MASK);
poke32(PANEL_HORIZONTAL_TOTAL, reg);
poke32(PANEL_HORIZONTAL_SYNC,
- ((pModeParam->horizontal_sync_width <<
+ ((p_mode_param->horizontal_sync_width <<
PANEL_HORIZONTAL_SYNC_WIDTH_SHIFT) &
PANEL_HORIZONTAL_SYNC_WIDTH_MASK) |
- ((pModeParam->horizontal_sync_start - 1) &
+ ((p_mode_param->horizontal_sync_start - 1) &
PANEL_HORIZONTAL_SYNC_START_MASK));
poke32(PANEL_VERTICAL_TOTAL,
- (((pModeParam->vertical_total - 1) <<
+ (((p_mode_param->vertical_total - 1) <<
PANEL_VERTICAL_TOTAL_TOTAL_SHIFT) &
PANEL_VERTICAL_TOTAL_TOTAL_MASK) |
- ((pModeParam->vertical_display_end - 1) &
+ ((p_mode_param->vertical_display_end - 1) &
PANEL_VERTICAL_TOTAL_DISPLAY_END_MASK));
poke32(PANEL_VERTICAL_SYNC,
- ((pModeParam->vertical_sync_height <<
+ ((p_mode_param->vertical_sync_height <<
PANEL_VERTICAL_SYNC_HEIGHT_SHIFT) &
PANEL_VERTICAL_SYNC_HEIGHT_MASK) |
- ((pModeParam->vertical_sync_start - 1) &
+ ((p_mode_param->vertical_sync_start - 1) &
PANEL_VERTICAL_SYNC_START_MASK));
tmp = DISPLAY_CTRL_TIMING | DISPLAY_CTRL_PLANE;
- if (pModeParam->vertical_sync_polarity)
+ if (p_mode_param->vertical_sync_polarity)
tmp |= DISPLAY_CTRL_VSYNC_PHASE;
- if (pModeParam->horizontal_sync_polarity)
+ if (p_mode_param->horizontal_sync_polarity)
tmp |= DISPLAY_CTRL_HSYNC_PHASE;
- if (pModeParam->clock_phase_polarity)
+ if (p_mode_param->clock_phase_polarity)
tmp |= DISPLAY_CTRL_CLOCK_PHASE;
reserved = PANEL_DISPLAY_CTRL_RESERVED_MASK |
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 2/3] [Outreachy kernel] staging: sm750fb: avoid camelcase structure fields
2019-03-21 11:11 [PATCH 2/3] [Outreachy kernel] staging: sm750fb: avoid camelcase structure fields Payal Kshirsagar
@ 2019-03-21 19:05 ` Greg KH
2019-03-22 2:54 ` Payal Kshirsagar
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2019-03-21 19:05 UTC (permalink / raw)
To: Payal Kshirsagar; +Cc: outreachy-kernel
On Thu, Mar 21, 2019 at 04:41:49PM +0530, Payal Kshirsagar wrote:
> Eliminate camelcase structure fields to fix the style issue – ‘avoid
> camelcase’.
>
> Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
> ---
> drivers/staging/sm750fb/ddk750_mode.c | 52 +++++++++++++++++------------------
> 1 file changed, 26 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c
> index 5e35fec..b55cd96 100644
> --- a/drivers/staging/sm750fb/ddk750_mode.c
> +++ b/drivers/staging/sm750fb/ddk750_mode.c
> @@ -13,13 +13,13 @@
> * HW only supports 7 predefined pixel clocks, and clock select is
> * in bit 29:27 of Display Control register.
> */
> -static unsigned long display_control_adjust_SM750LE(struct mode_parameter *pModeParam,
> +static unsigned long display_control_adjust_SM750LE(struct mode_parameter *p_mode_param,
Why did you put "p_" as the prefix here?
The original code is trying to use the horrible Hungarian Notation way
of naming variables (and doing a bad job of it), which is not needed in
the kernel at all. No need to keep following that, this should just be
"mode_param", right? We "know" it is a pointer by virtue that the
compiler will tell us if we get it wrong.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/3] [Outreachy kernel] staging: sm750fb: avoid camelcase structure fields
2019-03-21 19:05 ` Greg KH
@ 2019-03-22 2:54 ` Payal Kshirsagar
0 siblings, 0 replies; 3+ messages in thread
From: Payal Kshirsagar @ 2019-03-22 2:54 UTC (permalink / raw)
To: Greg KH; +Cc: outreachy-kernel
[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]
On Fri, Mar 22, 2019, 12:35 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, Mar 21, 2019 at 04:41:49PM +0530, Payal Kshirsagar wrote:
> > Eliminate camelcase structure fields to fix the style issue – ‘avoid
> > camelcase’.
> >
> > Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
> > ---
> > drivers/staging/sm750fb/ddk750_mode.c | 52
> +++++++++++++++++------------------
> > 1 file changed, 26 insertions(+), 26 deletions(-)
> >
> > diff --git a/drivers/staging/sm750fb/ddk750_mode.c
> b/drivers/staging/sm750fb/ddk750_mode.c
> > index 5e35fec..b55cd96 100644
> > --- a/drivers/staging/sm750fb/ddk750_mode.c
> > +++ b/drivers/staging/sm750fb/ddk750_mode.c
> > @@ -13,13 +13,13 @@
> > * HW only supports 7 predefined pixel clocks, and clock select is
> > * in bit 29:27 of Display Control register.
> > */
> > -static unsigned long display_control_adjust_SM750LE(struct
> mode_parameter *pModeParam,
> > +static unsigned long display_control_adjust_SM750LE(struct
> mode_parameter *p_mode_param,
>
> Why did you put "p_" as the prefix here?
>
> The original code is trying to use the horrible Hungarian Notation way
> of naming variables (and doing a bad job of it), which is not needed in
> the kernel at all. No need to keep following that, this should just be
> "mode_param", right? We "know" it is a pointer by virtue that the
> compiler will tell us if we get it wrong.
>
I will do corrections and will resend it in v2.
Thanks,
Payal
thanks,
>
> greg k-h
>
[-- Attachment #2: Type: text/html, Size: 2326 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-22 2:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-21 11:11 [PATCH 2/3] [Outreachy kernel] staging: sm750fb: avoid camelcase structure fields Payal Kshirsagar
2019-03-21 19:05 ` Greg KH
2019-03-22 2:54 ` Payal Kshirsagar
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.