Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-11-02 Thread Gwan-gyeong Mun
On 11/2/22 8:32 AM, Joonas Lahtinen wrote: Quoting Jani Nikula (2022-10-28 11:46:21) On Fri, 28 Oct 2022, Gwan-gyeong Mun wrote: Resend, because some content was accidentally omitted from the previous reply. Please ignore the previous email. Hi all, I should have written the original comm

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-11-01 Thread Joonas Lahtinen
Quoting Jani Nikula (2022-10-28 11:46:21) > On Fri, 28 Oct 2022, Gwan-gyeong Mun wrote: > > Resend, because some content was accidentally omitted from the previous > > reply. > > Please ignore the previous email. > > > > Hi all, > > > > I should have written the original commit message more accur

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-28 Thread Jani Nikula
On Fri, 28 Oct 2022, Gwan-gyeong Mun wrote: > Resend, because some content was accidentally omitted from the previous > reply. > Please ignore the previous email. > > Hi all, > > I should have written the original commit message more accurately, but > it seems that it was written inaccurately. >

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-27 Thread Gwan-gyeong Mun
Resend, because some content was accidentally omitted from the previous reply. Please ignore the previous email. Hi all, I should have written the original commit message more accurately, but it seems that it was written inaccurately. If the FIELD_PREP macro is expanded, the following macros

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-27 Thread Gwan-gyeong Mun
Hi all, I should have written the commit message more accurately, but it seems that it was written inaccurately. If the FIELD_PREP macro is expanded, the following macros are used. #define FIELD_PREP(_mask, _val) \ ({

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-27 Thread Dixit, Ashutosh
On Thu, 27 Oct 2022 10:16:47 -0700, Nick Desaulniers wrote: > Hi Nick, > Thanks, I can repro now. > > I haven't detangled the macro soup, but I noticed: > > 1. FIELD_PREP is defined in include/linux/bitfield.h which has the > following comment: > 18 * Mask must be a compilation time constant.

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-27 Thread Nick Desaulniers
On Thu, Oct 27, 2022 at 9:53 AM Dixit, Ashutosh wrote: > > On Thu, 27 Oct 2022 09:35:24 -0700, Nick Desaulniers wrote: > > > > Hi Nick, > > > On Tue, Oct 25, 2022 at 5:18 PM Andi Shyti > > wrote: > > > > > > Hi Ashutosh, > > > > > > > But I'd wait to hear from clang/llvm folks first. > > > > > >

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-27 Thread Dixit, Ashutosh
On Thu, 27 Oct 2022 09:35:24 -0700, Nick Desaulniers wrote: > Hi Nick, > On Tue, Oct 25, 2022 at 5:18 PM Andi Shyti wrote: > > > > Hi Ashutosh, > > > > > But I'd wait to hear from clang/llvm folks first. > > > > Yeah! Looking forward to getting some ideas :) > > Gwan-gyeong, which tree and set o

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-27 Thread Nick Desaulniers
On Tue, Oct 25, 2022 at 5:18 PM Andi Shyti wrote: > > Hi Ashutosh, > > > But I'd wait to hear from clang/llvm folks first. > > Yeah! Looking forward to getting some ideas :) Gwan-gyeong, which tree and set of configs are necessary to reproduce the observed warning? Warnings are treated as errors

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-25 Thread Andi Shyti
Hi Ashutosh, > On Tue, 25 Oct 2022 02:25:06 -0700, Andi Shyti wrote: > > > > Hi Ashutosh, > > Hi Andi :) > > > > > If a non-constant variable is used as the first argument of the > > > > FIELD_PREP > > > > macro, a build error occurs when using the clang compiler. > > A "non-constant variable"

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-25 Thread Dixit, Ashutosh
On Tue, 25 Oct 2022 07:30:49 -0700, Jani Nikula wrote: > > On Tue, 25 Oct 2022, Jani Nikula wrote: > > On Tue, 25 Oct 2022, Gwan-gyeong Mun wrote: > >> If a non-constant variable is used as the first argument of the FIELD_PREP > >> macro, a build error occurs when using the clang compiler. > >> >

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-25 Thread Dixit, Ashutosh
On Tue, 25 Oct 2022 02:25:06 -0700, Andi Shyti wrote: > > Hi Ashutosh, Hi Andi :) > > > If a non-constant variable is used as the first argument of the FIELD_PREP > > > macro, a build error occurs when using the clang compiler. A "non-constant variable" does not seem to be the cause of the compi

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-25 Thread Nick Desaulniers
Start of lore thread for context: https://lore.kernel.org/intel-gfx/20221024210953.1572998-1-gwan-gyeong@intel.com/ On Tue, Oct 25, 2022 at 2:25 AM Andi Shyti wrote: > > Hi Ashutosh, > > > > drivers/gpu/drm/i915/i915_hwmon.c:115:16: error: result of comparison of > > > constant 1844674407370

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-25 Thread Jani Nikula
On Tue, 25 Oct 2022, Jani Nikula wrote: > On Tue, 25 Oct 2022, Gwan-gyeong Mun wrote: >> If a non-constant variable is used as the first argument of the FIELD_PREP >> macro, a build error occurs when using the clang compiler. >> >> Fix the following build error used with clang compiler: >> >> dri

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-25 Thread Jani Nikula
On Tue, 25 Oct 2022, Gwan-gyeong Mun wrote: > If a non-constant variable is used as the first argument of the FIELD_PREP > macro, a build error occurs when using the clang compiler. > > Fix the following build error used with clang compiler: > > drivers/gpu/drm/i915/i915_hwmon.c:115:16: error: res

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-25 Thread Andi Shyti
Hi Ashutosh, > > drivers/gpu/drm/i915/i915_hwmon.c:115:16: error: result of comparison of > > constant 18446744073709551615 with expression of type 'typeof > > (_Generic((field_msk), char: (unsigned char)0, unsigned char: (unsigned > > char)0, signed char: (unsigned char)0, unsigned short: (uns

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-25 Thread Andi Shyti
On Tue, Oct 25, 2022 at 12:09:53AM +0300, Gwan-gyeong Mun wrote: > If a non-constant variable is used as the first argument of the FIELD_PREP > macro, a build error occurs when using the clang compiler. good catch! FIELD_PREP wants indeed a constant as a first paramenter, also for gcc. Reviewed-b

Re: [Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-24 Thread Dixit, Ashutosh
On Mon, 24 Oct 2022 14:09:53 -0700, Gwan-gyeong Mun wrote: > Hi GG, > If a non-constant variable is used as the first argument of the FIELD_PREP > macro, a build error occurs when using the clang compiler. > > Fix the following build error used with clang compiler: > > drivers/gpu/drm/i915/i915_h

[Intel-gfx] [PATCH] drm/i915/hwmon: Fix a build error used with clang compiler

2022-10-24 Thread Gwan-gyeong Mun
If a non-constant variable is used as the first argument of the FIELD_PREP macro, a build error occurs when using the clang compiler. Fix the following build error used with clang compiler: drivers/gpu/drm/i915/i915_hwmon.c:115:16: error: result of comparison of constant 18446744073709551615 wit