lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 6 Nov 2020 08:49:04 +0000
From:   Lee Jones <lee.jones@...aro.org>
To:     Ahmad Fatoum <a.fatoum@...gutronix.de>
Cc:     Philipp Zabel <p.zabel@...gutronix.de>,
        David Airlie <airlied@...ux.ie>,
        Fabio Estevam <festevam@...il.com>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        NXP Linux Team <linux-imx@....com>,
        Daniel Vetter <daniel@...ll.ch>,
        Shawn Guo <shawnguo@...nel.org>,
        Pengutronix Kernel Team <kernel@...gutronix.de>
Subject: Re: [PATCH 03/19] gpu: drm: imx: ipuv3-plane: Mark 'crtc_state' as
 __always_unused

On Fri, 06 Nov 2020, Ahmad Fatoum wrote:

> On 11/6/20 8:41 AM, Lee Jones wrote:
> > On Thu, 05 Nov 2020, Ahmad Fatoum wrote:
> > 
> >> Hello Lee,
> >>
> >> On 11/5/20 3:45 PM, Lee Jones wrote:
> >>> In the macro for_each_oldnew_crtc_in_state() 'crtc_state' is provided
> >>> as a container for state->crtcs[i].new_state, but is not utilised in
> >>> this use-case.  We cannot simply delete the variable, so here we tell
> >>> the compiler that we're intentionally discarding the read value.
> >>
> >> for_each_oldnew_crtc_in_state already (void) casts the drm_crtc and the old
> >> drm_crtc_state to silence unused-but-set-variable warning. Should we maybe
> >> (void) cast the new crtc_state as well?
> > 
> > From what I saw, it only void casts the ones which aren't assigned.
> 
> How do you mean? I wonder if
> 
>  #define for_each_oldnew_crtc_in_state(__state, crtc, old_crtc_state, new_crtc_state, __i) \
>         for ((__i) = 0;                                                 \
>              (__i) < (__state)->dev->mode_config.num_crtc;              \
>              (__i)++)                                                   \
>                 for_each_if ((__state)->crtcs[__i].ptr &&               \
>                              ((crtc) = (__state)->crtcs[__i].ptr,       \
>                               (void)(crtc) /* Only to avoid unused-but-set-variable warning */, \
>                              (old_crtc_state) = (__state)->crtcs[__i].old_state, \
>                              (void)(old_crtc_state) /* Only to avoid unused-but-set-variable warning */, \
> -                            (new_crtc_state) = (__state)->crtcs[__i].new_state, 1))
> +                            (new_crtc_state) = (__state)->crtcs[__i].new_state, \
> +                            (void)(new_crtc_state), 1))
> 
> wouldn't be better.

That also works for me.  I can fix this up.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ