All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/ttm: fix the type mismatch error on sparc64
@ 2021-09-07 10:03 Huang Rui
  2021-09-07 10:24 ` Christian König
  0 siblings, 1 reply; 7+ messages in thread
From: Huang Rui @ 2021-09-07 10:03 UTC (permalink / raw)
  To: Christian König, Daniel Vetter, dri-devel
  Cc: Linus Torvalds, Guenter Roeck, linux-kernel, sparclinux, Huang Rui

__fls() on sparc64 return "int", but here it is expected as "unsigned
long" (x86). It will cause the build errors because the warning becomes
fatal while it is using sparc configuration. As suggested by Linus, it
can use min_t instead of min to force the type as "unsigned int".

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Cc: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_pool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
index af1b41369626..c961a788b519 100644
--- a/drivers/gpu/drm/ttm/ttm_pool.c
+++ b/drivers/gpu/drm/ttm/ttm_pool.c
@@ -382,7 +382,8 @@ int ttm_pool_alloc(struct ttm_pool *pool, struct ttm_tt *tt,
 	else
 		gfp_flags |= GFP_HIGHUSER;
 
-	for (order = min(MAX_ORDER - 1UL, __fls(num_pages)); num_pages;
+	for (order = min_t(unsigned int, MAX_ORDER - 1, __fls(num_pages));
+	     num_pages;
 	     order = min_t(unsigned int, order, __fls(num_pages))) {
 		bool apply_caching = false;
 		struct ttm_pool_type *pt;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/ttm: fix the type mismatch error on sparc64
  2021-09-07 10:03 [PATCH] drm/ttm: fix the type mismatch error on sparc64 Huang Rui
@ 2021-09-07 10:24 ` Christian König
  2021-09-14 19:48     ` Alex Deucher
  0 siblings, 1 reply; 7+ messages in thread
From: Christian König @ 2021-09-07 10:24 UTC (permalink / raw)
  To: Huang Rui, Daniel Vetter, dri-devel
  Cc: Linus Torvalds, Guenter Roeck, linux-kernel, sparclinux

Am 07.09.21 um 12:03 schrieb Huang Rui:
> __fls() on sparc64 return "int", but here it is expected as "unsigned
> long" (x86). It will cause the build errors because the warning becomes
> fatal while it is using sparc configuration. As suggested by Linus, it
> can use min_t instead of min to force the type as "unsigned int".
>
> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> Cc: Christian König <christian.koenig@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/ttm/ttm_pool.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> index af1b41369626..c961a788b519 100644
> --- a/drivers/gpu/drm/ttm/ttm_pool.c
> +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> @@ -382,7 +382,8 @@ int ttm_pool_alloc(struct ttm_pool *pool, struct ttm_tt *tt,
>   	else
>   		gfp_flags |= GFP_HIGHUSER;
>   
> -	for (order = min(MAX_ORDER - 1UL, __fls(num_pages)); num_pages;
> +	for (order = min_t(unsigned int, MAX_ORDER - 1, __fls(num_pages));
> +	     num_pages;
>   	     order = min_t(unsigned int, order, __fls(num_pages))) {
>   		bool apply_caching = false;
>   		struct ttm_pool_type *pt;


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/ttm: fix the type mismatch error on sparc64
  2021-09-07 10:24 ` Christian König
@ 2021-09-14 19:48     ` Alex Deucher
  0 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2021-09-14 19:48 UTC (permalink / raw)
  To: Christian König
  Cc: Huang Rui, Daniel Vetter, Maling list - DRI developers,
	Linus Torvalds, Guenter Roeck, LKML, sparclinux

On Tue, Sep 7, 2021 at 6:25 AM Christian König <christian.koenig@amd.com> wrote:
>
> Am 07.09.21 um 12:03 schrieb Huang Rui:
> > __fls() on sparc64 return "int", but here it is expected as "unsigned
> > long" (x86). It will cause the build errors because the warning becomes
> > fatal while it is using sparc configuration. As suggested by Linus, it
> > can use min_t instead of min to force the type as "unsigned int".
> >
> > Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
> > Signed-off-by: Huang Rui <ray.huang@amd.com>
> > Cc: Christian König <christian.koenig@amd.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>

Is one of you going to push this to drm-misc?

Alex

>
> > ---
> >   drivers/gpu/drm/ttm/ttm_pool.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> > index af1b41369626..c961a788b519 100644
> > --- a/drivers/gpu/drm/ttm/ttm_pool.c
> > +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> > @@ -382,7 +382,8 @@ int ttm_pool_alloc(struct ttm_pool *pool, struct ttm_tt *tt,
> >       else
> >               gfp_flags |= GFP_HIGHUSER;
> >
> > -     for (order = min(MAX_ORDER - 1UL, __fls(num_pages)); num_pages;
> > +     for (order = min_t(unsigned int, MAX_ORDER - 1, __fls(num_pages));
> > +          num_pages;
> >            order = min_t(unsigned int, order, __fls(num_pages))) {
> >               bool apply_caching = false;
> >               struct ttm_pool_type *pt;
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/ttm: fix the type mismatch error on sparc64
@ 2021-09-14 19:48     ` Alex Deucher
  0 siblings, 0 replies; 7+ messages in thread
From: Alex Deucher @ 2021-09-14 19:48 UTC (permalink / raw)
  To: Christian König
  Cc: Huang Rui, Daniel Vetter, Maling list - DRI developers,
	Linus Torvalds, Guenter Roeck, LKML, sparclinux

On Tue, Sep 7, 2021 at 6:25 AM Christian König <christian.koenig@amd.com> wrote:
>
> Am 07.09.21 um 12:03 schrieb Huang Rui:
> > __fls() on sparc64 return "int", but here it is expected as "unsigned
> > long" (x86). It will cause the build errors because the warning becomes
> > fatal while it is using sparc configuration. As suggested by Linus, it
> > can use min_t instead of min to force the type as "unsigned int".
> >
> > Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
> > Signed-off-by: Huang Rui <ray.huang@amd.com>
> > Cc: Christian König <christian.koenig@amd.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>

Is one of you going to push this to drm-misc?

Alex

>
> > ---
> >   drivers/gpu/drm/ttm/ttm_pool.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c
> > index af1b41369626..c961a788b519 100644
> > --- a/drivers/gpu/drm/ttm/ttm_pool.c
> > +++ b/drivers/gpu/drm/ttm/ttm_pool.c
> > @@ -382,7 +382,8 @@ int ttm_pool_alloc(struct ttm_pool *pool, struct ttm_tt *tt,
> >       else
> >               gfp_flags |= GFP_HIGHUSER;
> >
> > -     for (order = min(MAX_ORDER - 1UL, __fls(num_pages)); num_pages;
> > +     for (order = min_t(unsigned int, MAX_ORDER - 1, __fls(num_pages));
> > +          num_pages;
> >            order = min_t(unsigned int, order, __fls(num_pages))) {
> >               bool apply_caching = false;
> >               struct ttm_pool_type *pt;
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/ttm: fix the type mismatch error on sparc64
  2021-09-14 19:48     ` Alex Deucher
  (?)
@ 2021-09-14 20:03     ` Linus Torvalds
  2021-09-15  8:20         ` Christian König
  -1 siblings, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2021-09-14 20:03 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Christian König, Huang Rui, Daniel Vetter,
	Maling list - DRI developers, Guenter Roeck, LKML, linux-sparc

On Tue, Sep 14, 2021 at 12:48 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Tue, Sep 7, 2021 at 6:25 AM Christian König <christian.koenig@amd.com> wrote:
> >
> >
> > Reviewed-by: Christian König <christian.koenig@amd.com>
>
> Is one of you going to push this to drm-misc?

I was assuming it was there already.

I guess I'll just apply it directly.

         Linus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/ttm: fix the type mismatch error on sparc64
  2021-09-14 20:03     ` Linus Torvalds
@ 2021-09-15  8:20         ` Christian König
  0 siblings, 0 replies; 7+ messages in thread
From: Christian König @ 2021-09-15  8:20 UTC (permalink / raw)
  To: Linus Torvalds, Alex Deucher
  Cc: Huang Rui, Daniel Vetter, Maling list - DRI developers,
	Guenter Roeck, LKML, linux-sparc



Am 14.09.21 um 22:03 schrieb Linus Torvalds:
> On Tue, Sep 14, 2021 at 12:48 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>> On Tue, Sep 7, 2021 at 6:25 AM Christian König <christian.koenig@amd.com> wrote:
>>>
>>> Reviewed-by: Christian König <christian.koenig@amd.com>
>> Is one of you going to push this to drm-misc?
> I was assuming it was there already.
>
> I guess I'll just apply it directly.

I had it already prepared and just forgot to push it.

Just did so a few minutes ago before reading this mail.

Sorry for the noise,
Christian.

>
>           Linus


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/ttm: fix the type mismatch error on sparc64
@ 2021-09-15  8:20         ` Christian König
  0 siblings, 0 replies; 7+ messages in thread
From: Christian König @ 2021-09-15  8:20 UTC (permalink / raw)
  To: Linus Torvalds, Alex Deucher
  Cc: Huang Rui, Daniel Vetter, Maling list - DRI developers,
	Guenter Roeck, LKML, linux-sparc



Am 14.09.21 um 22:03 schrieb Linus Torvalds:
> On Tue, Sep 14, 2021 at 12:48 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>> On Tue, Sep 7, 2021 at 6:25 AM Christian König <christian.koenig@amd.com> wrote:
>>>
>>> Reviewed-by: Christian König <christian.koenig@amd.com>
>> Is one of you going to push this to drm-misc?
> I was assuming it was there already.
>
> I guess I'll just apply it directly.

I had it already prepared and just forgot to push it.

Just did so a few minutes ago before reading this mail.

Sorry for the noise,
Christian.

>
>           Linus


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-15  8:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07 10:03 [PATCH] drm/ttm: fix the type mismatch error on sparc64 Huang Rui
2021-09-07 10:24 ` Christian König
2021-09-14 19:48   ` Alex Deucher
2021-09-14 19:48     ` Alex Deucher
2021-09-14 20:03     ` Linus Torvalds
2021-09-15  8:20       ` Christian König
2021-09-15  8:20         ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.