[2/2] drm/exynos: 'win' is always unsigned
diff mbox

Message ID 1430914222-3603-2-git-send-email-tjakobi@math.uni-bielefeld.de
State New
Headers show

Commit Message

Tobias Jakobi May 6, 2015, 12:10 p.m. UTC
The index for the hardware layer is always >=0. Previous
code that also used -1 as special index is now gone.

Also apply this to 'ch_enabled' (decon/fimd), since the
variable is on the same line (and is again always unsigned).

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/gpu/drm/exynos/exynos7_drm_decon.c | 2 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c   | 6 +++---
 drivers/gpu/drm/exynos/exynos_mixer.c      | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

Comments

Gustavo Padovan May 7, 2015, 6:26 p.m. UTC | #1
Hi Tobias,

2015-05-06 Tobias Jakobi <tjakobi@math.uni-bielefeld.de>:

> The index for the hardware layer is always >=0. Previous
> code that also used -1 as special index is now gone.
> 
> Also apply this to 'ch_enabled' (decon/fimd), since the
> variable is on the same line (and is again always unsigned).
> 
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c | 2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c   | 6 +++---
>  drivers/gpu/drm/exynos/exynos_mixer.c      | 6 +++---
>  3 files changed, 7 insertions(+), 7 deletions(-)

Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

	Gustavo
Inki Dae May 11, 2015, 1:26 p.m. UTC | #2
On 2015? 05? 06? 21:10, Tobias Jakobi wrote:
> The index for the hardware layer is always >=0. Previous
> code that also used -1 as special index is now gone.
> 
> Also apply this to 'ch_enabled' (decon/fimd), since the
> variable is on the same line (and is again always unsigned).

I can see below error with checkpatch.pl,

WARNING: line over 80 characters
#125: FILE: drivers/gpu/drm/exynos/exynos_drm_fimd.c:232:
+static void fimd_enable_shadow_channel_path(struct fimd_context *ctx,
unsigned int win,

WARNING: line over 80 characters
#147: FILE: drivers/gpu/drm/exynos/exynos_mixer.c:336:
+static void mixer_cfg_layer(struct mixer_context *ctx, unsigned int
win, bool enable)

Please check coding style with checkpath.pl before posting it next time.
I modified and merged them.

Thanks,
Inki Dae

> 
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c | 2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c   | 6 +++---
>  drivers/gpu/drm/exynos/exynos_mixer.c      | 6 +++---
>  3 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index 1f7e33f..5c0b2cc 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -91,7 +91,7 @@ static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
>  
>  static void decon_clear_channel(struct decon_context *ctx)
>  {
> -	int win, ch_enabled = 0;
> +	unsigned int win, ch_enabled = 0;
>  
>  	DRM_DEBUG_KMS("%s\n", __FILE__);
>  
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index 9819fa6..ee11ea6 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -216,7 +216,7 @@ static void fimd_wait_for_vblank(struct exynos_drm_crtc *crtc)
>  		DRM_DEBUG_KMS("vblank wait timed out.\n");
>  }
>  
> -static void fimd_enable_video_output(struct fimd_context *ctx, int win,
> +static void fimd_enable_video_output(struct fimd_context *ctx, unsigned int win,
>  					bool enable)
>  {
>  	u32 val = readl(ctx->regs + WINCON(win));
> @@ -229,7 +229,7 @@ static void fimd_enable_video_output(struct fimd_context *ctx, int win,
>  	writel(val, ctx->regs + WINCON(win));
>  }
>  
> -static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
> +static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, unsigned int win,
>  						bool enable)
>  {
>  	u32 val = readl(ctx->regs + SHADOWCON);
> @@ -244,7 +244,7 @@ static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
>  
>  static void fimd_clear_channel(struct fimd_context *ctx)
>  {
> -	int win, ch_enabled = 0;
> +	unsigned int win, ch_enabled = 0;
>  
>  	DRM_DEBUG_KMS("%s\n", __FILE__);
>  
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index ff15702..4a1656b 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -333,7 +333,7 @@ static void mixer_cfg_rgb_fmt(struct mixer_context *ctx, unsigned int height)
>  	mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_RGB_FMT_MASK);
>  }
>  
> -static void mixer_cfg_layer(struct mixer_context *ctx, int win, bool enable)
> +static void mixer_cfg_layer(struct mixer_context *ctx, unsigned int win, bool enable)
>  {
>  	struct mixer_resources *res = &ctx->mixer_res;
>  	u32 val = enable ? ~0 : 0;
> @@ -379,7 +379,7 @@ static void mixer_stop(struct mixer_context *ctx)
>  		usleep_range(10000, 12000);
>  }
>  
> -static void vp_video_buffer(struct mixer_context *ctx, int win)
> +static void vp_video_buffer(struct mixer_context *ctx, unsigned int win)
>  {
>  	struct mixer_resources *res = &ctx->mixer_res;
>  	unsigned long flags;
> @@ -511,7 +511,7 @@ fail:
>  	return -ENOTSUPP;
>  }
>  
> -static void mixer_graph_buffer(struct mixer_context *ctx, int win)
> +static void mixer_graph_buffer(struct mixer_context *ctx, unsigned int win)
>  {
>  	struct mixer_resources *res = &ctx->mixer_res;
>  	unsigned long flags;
>
Tobias Jakobi May 11, 2015, 6:04 p.m. UTC | #3
Hey Inki,

Inki Dae wrote:
> On 2015? 05? 06? 21:10, Tobias Jakobi wrote:
>> The index for the hardware layer is always >=0. Previous
>> code that also used -1 as special index is now gone.
>>
>> Also apply this to 'ch_enabled' (decon/fimd), since the
>> variable is on the same line (and is again always unsigned).
> 
> I can see below error with checkpatch.pl,
> 
> WARNING: line over 80 characters
> #125: FILE: drivers/gpu/drm/exynos/exynos_drm_fimd.c:232:
> +static void fimd_enable_shadow_channel_path(struct fimd_context *ctx,
> unsigned int win,
> 
> WARNING: line over 80 characters
> #147: FILE: drivers/gpu/drm/exynos/exynos_mixer.c:336:
> +static void mixer_cfg_layer(struct mixer_context *ctx, unsigned int
> win, bool enable)
> 
> Please check coding style with checkpath.pl before posting it next time.
> I modified and merged them.
sorry, I'm going to check more thoroughly next time.

Also, I think you might have missed one of my cleanup patches:
https://patchwork.kernel.org/patch/6275111/

At least I haven't seen it yet in for-next or fixes.

And if you could say a few words about the layer rework series
(http://www.spinics.net/lists/linux-samsung-soc/msg44199.html), that
would be great! :)



With best wishes,
Tobias

> 
> Thanks,
> Inki Dae
> 
>>
>> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
>> ---
>>  drivers/gpu/drm/exynos/exynos7_drm_decon.c | 2 +-
>>  drivers/gpu/drm/exynos/exynos_drm_fimd.c   | 6 +++---
>>  drivers/gpu/drm/exynos/exynos_mixer.c      | 6 +++---
>>  3 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
>> index 1f7e33f..5c0b2cc 100644
>> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
>> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
>> @@ -91,7 +91,7 @@ static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
>>  
>>  static void decon_clear_channel(struct decon_context *ctx)
>>  {
>> -	int win, ch_enabled = 0;
>> +	unsigned int win, ch_enabled = 0;
>>  
>>  	DRM_DEBUG_KMS("%s\n", __FILE__);
>>  
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> index 9819fa6..ee11ea6 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> @@ -216,7 +216,7 @@ static void fimd_wait_for_vblank(struct exynos_drm_crtc *crtc)
>>  		DRM_DEBUG_KMS("vblank wait timed out.\n");
>>  }
>>  
>> -static void fimd_enable_video_output(struct fimd_context *ctx, int win,
>> +static void fimd_enable_video_output(struct fimd_context *ctx, unsigned int win,
>>  					bool enable)
>>  {
>>  	u32 val = readl(ctx->regs + WINCON(win));
>> @@ -229,7 +229,7 @@ static void fimd_enable_video_output(struct fimd_context *ctx, int win,
>>  	writel(val, ctx->regs + WINCON(win));
>>  }
>>  
>> -static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
>> +static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, unsigned int win,
>>  						bool enable)
>>  {
>>  	u32 val = readl(ctx->regs + SHADOWCON);
>> @@ -244,7 +244,7 @@ static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
>>  
>>  static void fimd_clear_channel(struct fimd_context *ctx)
>>  {
>> -	int win, ch_enabled = 0;
>> +	unsigned int win, ch_enabled = 0;
>>  
>>  	DRM_DEBUG_KMS("%s\n", __FILE__);
>>  
>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
>> index ff15702..4a1656b 100644
>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
>> @@ -333,7 +333,7 @@ static void mixer_cfg_rgb_fmt(struct mixer_context *ctx, unsigned int height)
>>  	mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_RGB_FMT_MASK);
>>  }
>>  
>> -static void mixer_cfg_layer(struct mixer_context *ctx, int win, bool enable)
>> +static void mixer_cfg_layer(struct mixer_context *ctx, unsigned int win, bool enable)
>>  {
>>  	struct mixer_resources *res = &ctx->mixer_res;
>>  	u32 val = enable ? ~0 : 0;
>> @@ -379,7 +379,7 @@ static void mixer_stop(struct mixer_context *ctx)
>>  		usleep_range(10000, 12000);
>>  }
>>  
>> -static void vp_video_buffer(struct mixer_context *ctx, int win)
>> +static void vp_video_buffer(struct mixer_context *ctx, unsigned int win)
>>  {
>>  	struct mixer_resources *res = &ctx->mixer_res;
>>  	unsigned long flags;
>> @@ -511,7 +511,7 @@ fail:
>>  	return -ENOTSUPP;
>>  }
>>  
>> -static void mixer_graph_buffer(struct mixer_context *ctx, int win)
>> +static void mixer_graph_buffer(struct mixer_context *ctx, unsigned int win)
>>  {
>>  	struct mixer_resources *res = &ctx->mixer_res;
>>  	unsigned long flags;
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Inki Dae May 13, 2015, 4:25 a.m. UTC | #4
On 2015? 05? 12? 03:04, Tobias Jakobi wrote:
> Hey Inki,
> 
> Inki Dae wrote:
>> On 2015? 05? 06? 21:10, Tobias Jakobi wrote:
>>> The index for the hardware layer is always >=0. Previous
>>> code that also used -1 as special index is now gone.
>>>
>>> Also apply this to 'ch_enabled' (decon/fimd), since the
>>> variable is on the same line (and is again always unsigned).
>>
>> I can see below error with checkpatch.pl,
>>
>> WARNING: line over 80 characters
>> #125: FILE: drivers/gpu/drm/exynos/exynos_drm_fimd.c:232:
>> +static void fimd_enable_shadow_channel_path(struct fimd_context *ctx,
>> unsigned int win,
>>
>> WARNING: line over 80 characters
>> #147: FILE: drivers/gpu/drm/exynos/exynos_mixer.c:336:
>> +static void mixer_cfg_layer(struct mixer_context *ctx, unsigned int
>> win, bool enable)
>>
>> Please check coding style with checkpath.pl before posting it next time.
>> I modified and merged them.
> sorry, I'm going to check more thoroughly next time.
> 
> Also, I think you might have missed one of my cleanup patches:
> https://patchwork.kernel.org/patch/6275111/

Right, that is one I missed. Applied.

> 
> At least I haven't seen it yet in for-next or fixes.
> 
> And if you could say a few words about the layer rework series
> (http://www.spinics.net/lists/linux-samsung-soc/msg44199.html), that
> would be great! :)
> 

Got it. I will take a look at this patch series soon.

Thanks,
Inki Dae

> 
> 
> With best wishes,
> Tobias
> 
>>
>> Thanks,
>> Inki Dae
>>
>>>
>>> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
>>> ---
>>>  drivers/gpu/drm/exynos/exynos7_drm_decon.c | 2 +-
>>>  drivers/gpu/drm/exynos/exynos_drm_fimd.c   | 6 +++---
>>>  drivers/gpu/drm/exynos/exynos_mixer.c      | 6 +++---
>>>  3 files changed, 7 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
>>> index 1f7e33f..5c0b2cc 100644
>>> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
>>> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
>>> @@ -91,7 +91,7 @@ static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
>>>  
>>>  static void decon_clear_channel(struct decon_context *ctx)
>>>  {
>>> -	int win, ch_enabled = 0;
>>> +	unsigned int win, ch_enabled = 0;
>>>  
>>>  	DRM_DEBUG_KMS("%s\n", __FILE__);
>>>  
>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>>> index 9819fa6..ee11ea6 100644
>>> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>>> @@ -216,7 +216,7 @@ static void fimd_wait_for_vblank(struct exynos_drm_crtc *crtc)
>>>  		DRM_DEBUG_KMS("vblank wait timed out.\n");
>>>  }
>>>  
>>> -static void fimd_enable_video_output(struct fimd_context *ctx, int win,
>>> +static void fimd_enable_video_output(struct fimd_context *ctx, unsigned int win,
>>>  					bool enable)
>>>  {
>>>  	u32 val = readl(ctx->regs + WINCON(win));
>>> @@ -229,7 +229,7 @@ static void fimd_enable_video_output(struct fimd_context *ctx, int win,
>>>  	writel(val, ctx->regs + WINCON(win));
>>>  }
>>>  
>>> -static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
>>> +static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, unsigned int win,
>>>  						bool enable)
>>>  {
>>>  	u32 val = readl(ctx->regs + SHADOWCON);
>>> @@ -244,7 +244,7 @@ static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
>>>  
>>>  static void fimd_clear_channel(struct fimd_context *ctx)
>>>  {
>>> -	int win, ch_enabled = 0;
>>> +	unsigned int win, ch_enabled = 0;
>>>  
>>>  	DRM_DEBUG_KMS("%s\n", __FILE__);
>>>  
>>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
>>> index ff15702..4a1656b 100644
>>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
>>> @@ -333,7 +333,7 @@ static void mixer_cfg_rgb_fmt(struct mixer_context *ctx, unsigned int height)
>>>  	mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_RGB_FMT_MASK);
>>>  }
>>>  
>>> -static void mixer_cfg_layer(struct mixer_context *ctx, int win, bool enable)
>>> +static void mixer_cfg_layer(struct mixer_context *ctx, unsigned int win, bool enable)
>>>  {
>>>  	struct mixer_resources *res = &ctx->mixer_res;
>>>  	u32 val = enable ? ~0 : 0;
>>> @@ -379,7 +379,7 @@ static void mixer_stop(struct mixer_context *ctx)
>>>  		usleep_range(10000, 12000);
>>>  }
>>>  
>>> -static void vp_video_buffer(struct mixer_context *ctx, int win)
>>> +static void vp_video_buffer(struct mixer_context *ctx, unsigned int win)
>>>  {
>>>  	struct mixer_resources *res = &ctx->mixer_res;
>>>  	unsigned long flags;
>>> @@ -511,7 +511,7 @@ fail:
>>>  	return -ENOTSUPP;
>>>  }
>>>  
>>> -static void mixer_graph_buffer(struct mixer_context *ctx, int win)
>>> +static void mixer_graph_buffer(struct mixer_context *ctx, unsigned int win)
>>>  {
>>>  	struct mixer_resources *res = &ctx->mixer_res;
>>>  	unsigned long flags;
>>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Patch
diff mbox

diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index 1f7e33f..5c0b2cc 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -91,7 +91,7 @@  static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
 
 static void decon_clear_channel(struct decon_context *ctx)
 {
-	int win, ch_enabled = 0;
+	unsigned int win, ch_enabled = 0;
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9819fa6..ee11ea6 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -216,7 +216,7 @@  static void fimd_wait_for_vblank(struct exynos_drm_crtc *crtc)
 		DRM_DEBUG_KMS("vblank wait timed out.\n");
 }
 
-static void fimd_enable_video_output(struct fimd_context *ctx, int win,
+static void fimd_enable_video_output(struct fimd_context *ctx, unsigned int win,
 					bool enable)
 {
 	u32 val = readl(ctx->regs + WINCON(win));
@@ -229,7 +229,7 @@  static void fimd_enable_video_output(struct fimd_context *ctx, int win,
 	writel(val, ctx->regs + WINCON(win));
 }
 
-static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
+static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, unsigned int win,
 						bool enable)
 {
 	u32 val = readl(ctx->regs + SHADOWCON);
@@ -244,7 +244,7 @@  static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
 
 static void fimd_clear_channel(struct fimd_context *ctx)
 {
-	int win, ch_enabled = 0;
+	unsigned int win, ch_enabled = 0;
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index ff15702..4a1656b 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -333,7 +333,7 @@  static void mixer_cfg_rgb_fmt(struct mixer_context *ctx, unsigned int height)
 	mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_RGB_FMT_MASK);
 }
 
-static void mixer_cfg_layer(struct mixer_context *ctx, int win, bool enable)
+static void mixer_cfg_layer(struct mixer_context *ctx, unsigned int win, bool enable)
 {
 	struct mixer_resources *res = &ctx->mixer_res;
 	u32 val = enable ? ~0 : 0;
@@ -379,7 +379,7 @@  static void mixer_stop(struct mixer_context *ctx)
 		usleep_range(10000, 12000);
 }
 
-static void vp_video_buffer(struct mixer_context *ctx, int win)
+static void vp_video_buffer(struct mixer_context *ctx, unsigned int win)
 {
 	struct mixer_resources *res = &ctx->mixer_res;
 	unsigned long flags;
@@ -511,7 +511,7 @@  fail:
 	return -ENOTSUPP;
 }
 
-static void mixer_graph_buffer(struct mixer_context *ctx, int win)
+static void mixer_graph_buffer(struct mixer_context *ctx, unsigned int win)
 {
 	struct mixer_resources *res = &ctx->mixer_res;
 	unsigned long flags;