public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] r_du_lvdsenc.c : Check return value of devm_ioremap_resource with IS_ERR
@ 2013-12-08  2:41 ethan.zhao
  2013-12-10  2:24 ` Laurent Pinchart
  0 siblings, 1 reply; 3+ messages in thread
From: ethan.zhao @ 2013-12-08  2:41 UTC (permalink / raw)
  To: laurent.pinchart; +Cc: linux-kernel, ethan.zhao

function devm_ioremap_resource() doesn't return NULL, should check its return
value with helper IS_ERR().

Signed-off-by: ethan.zhao <ethan.kernel@gmail.com>
---
 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
index a0f6a17..93190ab 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
@@ -151,7 +151,7 @@ static int rcar_du_lvdsenc_get_resources(struct rcar_du_lvdsenc *lvds,
 	}
 
 	lvds->mmio = devm_ioremap_resource(&pdev->dev, mem);
-	if (lvds->mmio == NULL) {
+	if (IS_ERR(lvds->mmio)) {
 		dev_err(&pdev->dev, "failed to remap memory resource for %s\n",
 			name);
 		return -ENOMEM;
-- 
1.8.3.4 (Apple Git-47)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] r_du_lvdsenc.c : Check return value of devm_ioremap_resource with IS_ERR
  2013-12-08  2:41 [PATCH] r_du_lvdsenc.c : Check return value of devm_ioremap_resource with IS_ERR ethan.zhao
@ 2013-12-10  2:24 ` Laurent Pinchart
  2013-12-10  6:59   ` Ethan Zhao
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2013-12-10  2:24 UTC (permalink / raw)
  To: ethan.zhao; +Cc: linux-kernel, Wei Yongjun, dri-devel

Hi Ethan,

Thank you for the patch.

On Sunday 08 December 2013 10:41:46 ethan.zhao wrote:
> function devm_ioremap_resource() doesn't return NULL, should check its
> return value with helper IS_ERR().
> 
> Signed-off-by: ethan.zhao <ethan.kernel@gmail.com>

This issue has already been addressed by a patch sent to the dri-devel mailing 
list by Wei Yongjun (https://lkml.org/lkml/2013/8/22/637).

I've asked for a v2 to be submitted but haven't received any reply. I'll fix 
the problem myself and send the patch now.

> ---
>  drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
> b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c index a0f6a17..93190ab 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
> @@ -151,7 +151,7 @@ static int rcar_du_lvdsenc_get_resources(struct
> rcar_du_lvdsenc *lvds, }
> 
>  	lvds->mmio = devm_ioremap_resource(&pdev->dev, mem);
> -	if (lvds->mmio == NULL) {
> +	if (IS_ERR(lvds->mmio)) {
>  		dev_err(&pdev->dev, "failed to remap memory resource for %s\n",
>  			name);
>  		return -ENOMEM;

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] r_du_lvdsenc.c : Check return value of devm_ioremap_resource with IS_ERR
  2013-12-10  2:24 ` Laurent Pinchart
@ 2013-12-10  6:59   ` Ethan Zhao
  0 siblings, 0 replies; 3+ messages in thread
From: Ethan Zhao @ 2013-12-10  6:59 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: LKML, Wei Yongjun, dri-devel

Laurent,

    Next time I scan the NULL check, if hit your driver again, I will resend it.

Thanks,
Ethan

On Tue, Dec 10, 2013 at 10:24 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Ethan,
>
> Thank you for the patch.
>
> On Sunday 08 December 2013 10:41:46 ethan.zhao wrote:
>> function devm_ioremap_resource() doesn't return NULL, should check its
>> return value with helper IS_ERR().
>>
>> Signed-off-by: ethan.zhao <ethan.kernel@gmail.com>
>
> This issue has already been addressed by a patch sent to the dri-devel mailing
> list by Wei Yongjun (https://lkml.org/lkml/2013/8/22/637).
>
> I've asked for a v2 to be submitted but haven't received any reply. I'll fix
> the problem myself and send the patch now.
>
>> ---
>>  drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
>> b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c index a0f6a17..93190ab 100644
>> --- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
>> +++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
>> @@ -151,7 +151,7 @@ static int rcar_du_lvdsenc_get_resources(struct
>> rcar_du_lvdsenc *lvds, }
>>
>>       lvds->mmio = devm_ioremap_resource(&pdev->dev, mem);
>> -     if (lvds->mmio == NULL) {
>> +     if (IS_ERR(lvds->mmio)) {
>>               dev_err(&pdev->dev, "failed to remap memory resource for %s\n",
>>                       name);
>>               return -ENOMEM;
>
> --
> Regards,
>
> Laurent Pinchart
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-10  6:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-08  2:41 [PATCH] r_du_lvdsenc.c : Check return value of devm_ioremap_resource with IS_ERR ethan.zhao
2013-12-10  2:24 ` Laurent Pinchart
2013-12-10  6:59   ` Ethan Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox