mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hamza Mahfooz <hamza.mahfooz@amd.com>
To: "GONG, Ruiqi" <gongruiqi@huaweicloud.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Pan Xinhui <Xinhui.Pan@amd.com>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>
Cc: Xiu Jianfeng <xiujianfeng@huawei.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Wang Weiyang <wangweiyang2@huawei.com>,
	amd-gfx@lists.freedesktop.org, gongruiqi1@huawei.com
Subject: Re: [PATCH] drm/amd/display: fix compilation error due to shifting negative value
Date: Fri, 2 Jun 2023 10:28:38 -0400	[thread overview]
Message-ID: <53e9b63f-06da-ff0f-8776-0c5032d58aff@amd.com> (raw)
In-Reply-To: <20230602101233.1255276-1-gongruiqi@huaweicloud.com>

On 6/2/23 06:12, GONG, Ruiqi wrote:
> Currently compiling linux-next with allmodconfig triggers the following
> error:
> 
> ./drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h: In function ‘dc_fixpt_truncate’:
> ./drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:528:22: error: left shift of negative value [-Werror=shift-negative-value]
>    528 |  arg.value &= (~0LL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - frac_bits);
>        |                      ^~
> 
> Use `unsigned long long` instead.
> 
> Signed-off-by: GONG, Ruiqi <gongruiqi@huaweicloud.com>

Applied, thanks!

> ---
>   drivers/gpu/drm/amd/display/include/fixed31_32.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/include/fixed31_32.h b/drivers/gpu/drm/amd/display/include/fixed31_32.h
> index ece97ae0e826..d4cf7ead1d87 100644
> --- a/drivers/gpu/drm/amd/display/include/fixed31_32.h
> +++ b/drivers/gpu/drm/amd/display/include/fixed31_32.h
> @@ -525,7 +525,7 @@ static inline struct fixed31_32 dc_fixpt_truncate(struct fixed31_32 arg, unsigne
>   
>   	if (negative)
>   		arg.value = -arg.value;
> -	arg.value &= (~0LL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - frac_bits);
> +	arg.value &= (~0ULL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - frac_bits);
>   	if (negative)
>   		arg.value = -arg.value;
>   	return arg;
-- 
Hamza


      reply	other threads:[~2023-06-02 14:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02 10:12 GONG, Ruiqi
2023-06-02 14:28 ` Hamza Mahfooz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53e9b63f-06da-ff0f-8776-0c5032d58aff@amd.com \
    --to=hamza.mahfooz@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gongruiqi1@huawei.com \
    --cc=gongruiqi@huaweicloud.com \
    --cc=harry.wentland@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sunpeng.li@amd.com \
    --cc=wangweiyang2@huawei.com \
    --cc=xiujianfeng@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®