diff mbox

drm/edid: use false for boolean value

Message ID 20180123164607.GA25071@embeddedgus (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo A. R. Silva Jan. 23, 2018, 4:46 p.m. UTC
Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/gpu/drm/drm_edid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Vetter Jan. 30, 2018, 9:43 a.m. UTC | #1
On Tue, Jan 23, 2018 at 10:46:07AM -0600, Gustavo A. R. Silva wrote:
> Assign true or false to boolean variables instead of an integer value.
> 
> This issue was detected with the help of Coccinelle.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Thanks for your patch.

> ---
>  drivers/gpu/drm/drm_edid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index ddd5379..45a80d7 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -2767,7 +2767,7 @@ do_detailed_mode(struct detailed_timing *timing, void *c)
>  
>  		drm_mode_probed_add(closure->connector, newmode);
>  		closure->modes++;
> -		closure->preferred = 0;
> +		closure->preferred = false;

There's also

		.preferred = 1,

in add_detailed_modes. Please fix that one up too for consistency, then
I'll merge your patch.

Cheers, Daniel

>  	}
>  }
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Gustavo A. R. Silva Jan. 30, 2018, 10:02 a.m. UTC | #2
Hi Daniel,

Quoting Daniel Vetter <daniel@ffwll.ch>:

> On Tue, Jan 23, 2018 at 10:46:07AM -0600, Gustavo A. R. Silva wrote:
>> Assign true or false to boolean variables instead of an integer value.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> Thanks for your patch.
>
>> ---
>>  drivers/gpu/drm/drm_edid.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index ddd5379..45a80d7 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -2767,7 +2767,7 @@ do_detailed_mode(struct detailed_timing  
>> *timing, void *c)
>>
>>  		drm_mode_probed_add(closure->connector, newmode);
>>  		closure->modes++;
>> -		closure->preferred = 0;
>> +		closure->preferred = false;
>
> There's also
>
> 		.preferred = 1,
>
> in add_detailed_modes. Please fix that one up too for consistency, then
> I'll merge your patch.
>

Sure. I'll send a new patch shortly.

I also need to update the Coccinelle script to catch those cases.

Thanks for the feedback.
--
Gustavo
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index ddd5379..45a80d7 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2767,7 +2767,7 @@  do_detailed_mode(struct detailed_timing *timing, void *c)
 
 		drm_mode_probed_add(closure->connector, newmode);
 		closure->modes++;
-		closure->preferred = 0;
+		closure->preferred = false;
 	}
 }