"make C=1" returns 2 warnings in ltdc_plane_create()
("Using plain integer as NULL pointer"). This patch
fixes them.
Signed-off-by: Philippe Cornu <[email protected]>
---
drivers/gpu/drm/stm/ltdc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 616191fe98ae..d997a6014d6c 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -860,13 +860,13 @@ static struct drm_plane *ltdc_plane_create(struct drm_device *ddev,
plane = devm_kzalloc(dev, sizeof(*plane), GFP_KERNEL);
if (!plane)
- return 0;
+ return NULL;
ret = drm_universal_plane_init(ddev, plane, possible_crtcs,
<dc_plane_funcs, formats, nb_fmt,
NULL, type, NULL);
if (ret < 0)
- return 0;
+ return NULL;
drm_plane_helper_add(plane, <dc_plane_helper_funcs);
--
2.15.1
Hi Philippe,
Reviewed-by: Yannick Fertré <[email protected]>
On 04/19/2018 03:28 PM, Philippe Cornu wrote:
> "make C=1" returns 2 warnings in ltdc_plane_create()
> ("Using plain integer as NULL pointer"). This patch
> fixes them.
>
> Signed-off-by: Philippe Cornu <[email protected]>
> ---
> drivers/gpu/drm/stm/ltdc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 616191fe98ae..d997a6014d6c 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -860,13 +860,13 @@ static struct drm_plane *ltdc_plane_create(struct drm_device *ddev,
>
> plane = devm_kzalloc(dev, sizeof(*plane), GFP_KERNEL);
> if (!plane)
> - return 0;
> + return NULL;
>
> ret = drm_universal_plane_init(ddev, plane, possible_crtcs,
> <dc_plane_funcs, formats, nb_fmt,
> NULL, type, NULL);
> if (ret < 0)
> - return 0;
> + return NULL;
>
> drm_plane_helper_add(plane, <dc_plane_helper_funcs);
>
>
On 04/25/2018 09:13 AM, Yannick FERTRE wrote:
> Hi Philippe,
>
> Reviewed-by: Yannick Fertré <[email protected]>
>
Applied on drm-misc-next.
Many thanks,
Philippe :-)
>
> On 04/19/2018 03:28 PM, Philippe Cornu wrote:
>> "make C=1" returns 2 warnings in ltdc_plane_create()
>> ("Using plain integer as NULL pointer"). This patch
>> fixes them.
>>
>> Signed-off-by: Philippe Cornu <[email protected]>
>> ---
>> drivers/gpu/drm/stm/ltdc.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
>> index 616191fe98ae..d997a6014d6c 100644
>> --- a/drivers/gpu/drm/stm/ltdc.c
>> +++ b/drivers/gpu/drm/stm/ltdc.c
>> @@ -860,13 +860,13 @@ static struct drm_plane *ltdc_plane_create(struct drm_device *ddev,
>>
>> plane = devm_kzalloc(dev, sizeof(*plane), GFP_KERNEL);
>> if (!plane)
>> - return 0;
>> + return NULL;
>>
>> ret = drm_universal_plane_init(ddev, plane, possible_crtcs,
>> <dc_plane_funcs, formats, nb_fmt,
>> NULL, type, NULL);
>> if (ret < 0)
>> - return 0;
>> + return NULL;
>>
>> drm_plane_helper_add(plane, <dc_plane_helper_funcs);
>>