[Nouveau] [PATCH] fix a wrong use of a logical operator in drmmode_output_dpms()

Tobias Klausmann tobias.johannes.klausmann at mni.thm.de
Wed May 20 10:11:50 PDT 2015


looks good to me! :)

Feel free to add my R-b.

On 20.05.2015 17:08, Samuel Pitoiset wrote:
> This is probably a typo error which has been introduced in 2009...
> This fixes the following warning detected by Clang :
>
> drmmode_display.c:907:30: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
>      if (props && (props->flags && DRM_MODE_PROP_ENUM)) {
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>   src/drmmode_display.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 7c1d2bb..161bccd 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -904,7 +904,7 @@ drmmode_output_dpms(xf86OutputPtr output, int mode)
>   
>   	for (i = 0; i < koutput->count_props; i++) {
>   		props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
> -		if (props && (props->flags && DRM_MODE_PROP_ENUM)) {
> +		if (props && (props->flags & DRM_MODE_PROP_ENUM)) {
>   			if (!strcmp(props->name, "DPMS")) {
>   				mode_id = koutput->props[i];
>   				drmModeFreeProperty(props);



More information about the Nouveau mailing list