From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH libdrm 1/2] amdgpu: Use uint32_t i in amdgpu_find_bo_by_cpu_mapping
Date: Wed, 15 Aug 2018 08:50:57 +0800 [thread overview]
Message-ID: <5B7378F1.6000701@amd.com> (raw)
In-Reply-To: <20180814095848.10981-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
On 08/14/2018 05:58 PM, Michel Dänzer wrote:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> The compiler points out that an int doesn't work as intended if
> dev->bo_handles.max_key > INT_MAX:
>
> ../../amdgpu/amdgpu_bo.c: In function ‘amdgpu_find_bo_by_cpu_mapping’:
> ../../amdgpu/amdgpu_bo.c:550:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
> for (i = 0; i < dev->bo_handles.max_key; i++) {
> ^
> ../../amdgpu/amdgpu_bo.c:558:8: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
> if (i < dev->bo_handles.max_key) {
> ^
>
> Fixes: 4d454424e1f2 ("amdgpu: add a function to find bo by cpu mapping
> (v2)")
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Thanks.
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
> ---
> amdgpu/amdgpu_bo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
> index b790e9be..86d1c143 100644
> --- a/amdgpu/amdgpu_bo.c
> +++ b/amdgpu/amdgpu_bo.c
> @@ -535,7 +535,7 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
> amdgpu_bo_handle *buf_handle,
> uint64_t *offset_in_bo)
> {
> - int i;
> + uint32_t i;
> struct amdgpu_bo *bo;
>
> if (cpu == NULL || size == 0)
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
prev parent reply other threads:[~2018-08-15 0:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 9:58 [PATCH libdrm 1/2] amdgpu: Use uint32_t i in amdgpu_find_bo_by_cpu_mapping Michel Dänzer
[not found] ` <20180814095848.10981-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-08-14 9:58 ` [PATCH libdrm 2/2] amdgpu: Use char* pointers " Michel Dänzer
[not found] ` <20180814095848.10981-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-08-15 1:07 ` Zhang, Jerry (Junwei)
[not found] ` <5B737CB6.5010207-5C7GfCeVMHo@public.gmane.org>
2018-08-16 13:54 ` [PATCH v2 libdrm] amdgpu: Eliminate void* arithmetic " Michel Dänzer
[not found] ` <20180816135429.3945-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-08-16 18:22 ` Christian König
2018-08-17 3:57 ` Zhang, Jerry
2018-08-16 13:55 ` [PATCH libdrm 2/2] amdgpu: Use char* pointers " Michel Dänzer
2018-08-15 0:50 ` Zhang, Jerry (Junwei) [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=5B7378F1.6000701@amd.com \
--to=jerry.zhang-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=michel-otUistvHUpPR7s880joybQ@public.gmane.org \
/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