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]
Message-ID: <f1ff7e95-c177-09dd-9393-d0156ce81387@molgen.mpg.de>
Date:   Fri, 18 Mar 2022 06:58:25 +0100
From:   Paul Menzel <pmenzel@...gen.mpg.de>
To:     Aashish Sharma <shraash@...gle.com>,
        Harry Wentland <harry.wentland@....com>,
        Leo Li <sunpeng.li@....com>,
        Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Pan Xinhui <Xinhui.Pan@....com>,
        David Airlie <airlied@...ux.ie>,
        Nicholas Kazlauskas <nicholas.kazlauskas@....com>,
        Meenakshikumar Somasundaram <meenakshikumar.somasundaram@....com>,
        Jake Wang <haonan.wang2@....com>,
        Anson Jacob <Anson.Jacob@....com>,
        Guenter Roeck <groeck@...omium.org>
Cc:     linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        amd-gfx@...ts.freedesktop.org, Daniel Vetter <daniel@...ll.ch>,
        Wayne Lin <wayne.lin@....com>,
        Anthony Koo <Anthony.Koo@....com>
Subject: Re: [PATCH] drm/amd/display: Fixed the unused-but-set-variable
 warning

Dear Aashish,


Am 17.03.22 um 15:01 schrieb Aashish Sharma:

Thank you for your patch. If you are going to send a v2, please use 
imperative mood. Maybe:

drm/amd/display: Fix unused-but-set-variable warning


> Fixed this kernel test robot warning:

Maybe:

Fix the kernel test robot warning below:

> drivers/gpu/drm/amd/amdgpu/../display/dmub/inc/dmub_cmd.h:2893:12:
> warning: variable 'temp' set but not used [-Wunused-but-set-variable]
> 
> Replaced the assignment to the unused temp variable with READ_ONCE()
> macro to flush the writes.

Replace …

Excuse my ignorance regarding `READ_ONCE()`, but is that the reason you 
remove the volatile qualifier?

Some robots ask in their report to add a Found-by tag. If so, please add 
one.

> Signed-off-by: Aashish Sharma <shraash@...gle.com>
> ---
>   drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
> index 873ecd04e01d..b7981a781701 100644
> --- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
> +++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
> @@ -2913,13 +2913,12 @@ static inline void dmub_rb_flush_pending(const struct dmub_rb *rb)
>   	uint32_t wptr = rb->wrpt;
>   
>   	while (rptr != wptr) {
> -		uint64_t volatile *data = (uint64_t volatile *)((uint8_t *)(rb->base_address) + rptr);
> +		uint64_t *data = (uint64_t volatile *)((uint8_t *)(rb->base_address) + rptr);
>   		//uint64_t volatile *p = (uint64_t volatile *)data;
> -		uint64_t temp;
>   		uint8_t i;
>   
>   		for (i = 0; i < DMUB_RB_CMD_SIZE / sizeof(uint64_t); i++)
> -			temp = *data++;
> +			(void)READ_ONCE(*data++);

Did you verify, that the generated code is the same now, or what the 
differences are. If it’s different from before, you should document in 
the commit message, that it’s wanted, as otherwise, it’s an invasive 
change just to fix a warning.

>   		rptr += DMUB_RB_CMD_SIZE;
>   		if (rptr >= rb->capacity)


Kind regards,

Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ