diff mbox

drm/nouveau/disp: Use NULL for pointers

Message ID 1405944178-3500-1-git-send-email-thierry.reding@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thierry Reding July 21, 2014, 12:02 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

The return type of exec_lookup() is struct nvkm_output *, so it should
return NULL rather than 0.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thierry Reding Oct. 13, 2014, 11:47 a.m. UTC | #1
On Mon, Jul 21, 2014 at 02:02:58PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> The return type of exec_lookup() is struct nvkm_output *, so it should
> return NULL rather than 0.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
> index fa30d8196f35..ebf64e1d0a70 100644
> --- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
> +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
> @@ -939,7 +939,7 @@ exec_lookup(struct nv50_disp_priv *priv, int head, int or, u32 ctrl,
>  		case 0x00000900: type = DCB_OUTPUT_DP; mask = 2; break;
>  		default:
>  			nv_error(priv, "unknown SOR mc 0x%08x\n", ctrl);
> -			return 0x0000;
> +			return NULL;
>  		}
>  	}
>  

Ping?

Thierry
Emil Velikov Oct. 13, 2014, 7:16 p.m. UTC | #2
On 13/10/14 12:47, Thierry Reding wrote:
> On Mon, Jul 21, 2014 at 02:02:58PM +0200, Thierry Reding wrote:
>> From: Thierry Reding <treding@nvidia.com>
>>
>> The return type of exec_lookup() is struct nvkm_output *, so it should
>> return NULL rather than 0.
>>
>> Signed-off-by: Thierry Reding <treding@nvidia.com>
>> ---
>>  drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
>> index fa30d8196f35..ebf64e1d0a70 100644
>> --- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
>> +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
>> @@ -939,7 +939,7 @@ exec_lookup(struct nv50_disp_priv *priv, int head, int or, u32 ctrl,
>>  		case 0x00000900: type = DCB_OUTPUT_DP; mask = 2; break;
>>  		default:
>>  			nv_error(priv, "unknown SOR mc 0x%08x\n", ctrl);
>> -			return 0x0000;
>> +			return NULL;
>>  		}
>>  	}
>>  
> 
> Ping?
> 
> Thierry
> 
I have an identical patch in a local branch, but with worse commit
message :) Fwiw the patch is

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

-Emil
Thierry Reding June 5, 2015, 11:33 a.m. UTC | #3
On Mon, Oct 13, 2014 at 08:16:57PM +0100, Emil Velikov wrote:
> On 13/10/14 12:47, Thierry Reding wrote:
> > On Mon, Jul 21, 2014 at 02:02:58PM +0200, Thierry Reding wrote:
> >> From: Thierry Reding <treding@nvidia.com>
> >>
> >> The return type of exec_lookup() is struct nvkm_output *, so it should
> >> return NULL rather than 0.
> >>
> >> Signed-off-by: Thierry Reding <treding@nvidia.com>
> >> ---
> >>  drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
> >> index fa30d8196f35..ebf64e1d0a70 100644
> >> --- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
> >> +++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
> >> @@ -939,7 +939,7 @@ exec_lookup(struct nv50_disp_priv *priv, int head, int or, u32 ctrl,
> >>  		case 0x00000900: type = DCB_OUTPUT_DP; mask = 2; break;
> >>  		default:
> >>  			nv_error(priv, "unknown SOR mc 0x%08x\n", ctrl);
> >> -			return 0x0000;
> >> +			return NULL;
> >>  		}
> >>  	}
> >>  
> > 
> > Ping?
> > 
> > Thierry
> > 
> I have an identical patch in a local branch, but with worse commit
> message :) Fwiw the patch is
> 
> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

Ben, any chance you could pick this up? It should still apply as-is on
recent trees, but I can resend if you prefer.

Thierry
diff mbox

Patch

diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
index fa30d8196f35..ebf64e1d0a70 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
@@ -939,7 +939,7 @@  exec_lookup(struct nv50_disp_priv *priv, int head, int or, u32 ctrl,
 		case 0x00000900: type = DCB_OUTPUT_DP; mask = 2; break;
 		default:
 			nv_error(priv, "unknown SOR mc 0x%08x\n", ctrl);
-			return 0x0000;
+			return NULL;
 		}
 	}