All of lore.kernel.org
 help / color / mirror / Atom feed
* [drm-xe:drm-xe-next 989/1016] drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken
@ 2023-12-16 19:28 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2023-12-16 19:28 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: Rodrigo Vivi, llvm, intel-xe, oe-kbuild-all

tree:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
head:   c54005fdd0347a17088e7ff78070a55bf9103bc4
commit: ad7d86415578e1a5deedb0ceed5c281f7367d66d [989/1016] drm/xe: Enable W=1 warnings by default
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312170357.KPSinwPs-lkp@intel.com/

All warnings (new ones prefixed by >>):

   warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]
   warning: unknown warning option '-Wpacked-not-aligned'; did you mean '-Wpacked-non-pod'? [-Wunknown-warning-option]
   warning: unknown warning option '-Wformat-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
   warning: unknown warning option '-Wformat-truncation' [-Wunknown-warning-option]
   warning: unknown warning option '-Wstringop-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
   warning: unknown warning option '-Wstringop-truncation'; did you mean '-Wstring-concatenation'? [-Wunknown-warning-option]
>> drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
           default:
           ^~~~~~~
   drivers/gpu/drm/xe/xe_wait_user_fence.c:50:9: note: uninitialized use occurs here
           return passed ? 0 : 1;
                  ^~~~~~
   drivers/gpu/drm/xe/xe_wait_user_fence.c:21:13: note: initialize the variable 'passed' to silence this warning
           bool passed;
                      ^
                       = 0
   7 warnings generated.


vim +/passed +46 drivers/gpu/drm/xe/xe_wait_user_fence.c

dd08ebf6c3525a Matthew Brost   2023-03-30  16  
dd08ebf6c3525a Matthew Brost   2023-03-30  17  static int do_compare(u64 addr, u64 value, u64 mask, u16 op)
dd08ebf6c3525a Matthew Brost   2023-03-30  18  {
dd08ebf6c3525a Matthew Brost   2023-03-30  19  	u64 rvalue;
dd08ebf6c3525a Matthew Brost   2023-03-30  20  	int err;
dd08ebf6c3525a Matthew Brost   2023-03-30  21  	bool passed;
dd08ebf6c3525a Matthew Brost   2023-03-30  22  
dd08ebf6c3525a Matthew Brost   2023-03-30  23  	err = copy_from_user(&rvalue, u64_to_user_ptr(addr), sizeof(rvalue));
dd08ebf6c3525a Matthew Brost   2023-03-30  24  	if (err)
dd08ebf6c3525a Matthew Brost   2023-03-30  25  		return -EFAULT;
dd08ebf6c3525a Matthew Brost   2023-03-30  26  
dd08ebf6c3525a Matthew Brost   2023-03-30  27  	switch (op) {
76d52e37187b73 Rodrigo Vivi    2023-11-14  28  	case DRM_XE_UFENCE_WAIT_OP_EQ:
dd08ebf6c3525a Matthew Brost   2023-03-30  29  		passed = (rvalue & mask) == (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  30  		break;
76d52e37187b73 Rodrigo Vivi    2023-11-14  31  	case DRM_XE_UFENCE_WAIT_OP_NEQ:
dd08ebf6c3525a Matthew Brost   2023-03-30  32  		passed = (rvalue & mask) != (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  33  		break;
76d52e37187b73 Rodrigo Vivi    2023-11-14  34  	case DRM_XE_UFENCE_WAIT_OP_GT:
dd08ebf6c3525a Matthew Brost   2023-03-30  35  		passed = (rvalue & mask) > (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  36  		break;
76d52e37187b73 Rodrigo Vivi    2023-11-14  37  	case DRM_XE_UFENCE_WAIT_OP_GTE:
dd08ebf6c3525a Matthew Brost   2023-03-30  38  		passed = (rvalue & mask) >= (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  39  		break;
76d52e37187b73 Rodrigo Vivi    2023-11-14  40  	case DRM_XE_UFENCE_WAIT_OP_LT:
dd08ebf6c3525a Matthew Brost   2023-03-30  41  		passed = (rvalue & mask) < (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  42  		break;
76d52e37187b73 Rodrigo Vivi    2023-11-14  43  	case DRM_XE_UFENCE_WAIT_OP_LTE:
dd08ebf6c3525a Matthew Brost   2023-03-30  44  		passed = (rvalue & mask) <= (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  45  		break;
dd08ebf6c3525a Matthew Brost   2023-03-30 @46  	default:
5e0e3070659519 Francois Dugast 2023-07-27  47  		XE_WARN_ON("Not possible");
dd08ebf6c3525a Matthew Brost   2023-03-30  48  	}
dd08ebf6c3525a Matthew Brost   2023-03-30  49  
dd08ebf6c3525a Matthew Brost   2023-03-30  50  	return passed ? 0 : 1;
dd08ebf6c3525a Matthew Brost   2023-03-30  51  }
dd08ebf6c3525a Matthew Brost   2023-03-30  52  

:::::: The code at line 46 was first introduced by commit
:::::: dd08ebf6c3525a7ea2186e636df064ea47281987 drm/xe: Introduce a new DRM driver for Intel GPUs

:::::: TO: Matthew Brost <matthew.brost@intel.com>
:::::: CC: Rodrigo Vivi <rodrigo.vivi@intel.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* [drm-xe:drm-xe-next 989/1016] drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken
@ 2023-12-16 19:28 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2023-12-16 19:28 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: llvm, oe-kbuild-all, intel-xe, Rodrigo Vivi

tree:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
head:   c54005fdd0347a17088e7ff78070a55bf9103bc4
commit: ad7d86415578e1a5deedb0ceed5c281f7367d66d [989/1016] drm/xe: Enable W=1 warnings by default
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312170357.KPSinwPs-lkp@intel.com/

All warnings (new ones prefixed by >>):

   warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]
   warning: unknown warning option '-Wpacked-not-aligned'; did you mean '-Wpacked-non-pod'? [-Wunknown-warning-option]
   warning: unknown warning option '-Wformat-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
   warning: unknown warning option '-Wformat-truncation' [-Wunknown-warning-option]
   warning: unknown warning option '-Wstringop-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
   warning: unknown warning option '-Wstringop-truncation'; did you mean '-Wstring-concatenation'? [-Wunknown-warning-option]
>> drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
           default:
           ^~~~~~~
   drivers/gpu/drm/xe/xe_wait_user_fence.c:50:9: note: uninitialized use occurs here
           return passed ? 0 : 1;
                  ^~~~~~
   drivers/gpu/drm/xe/xe_wait_user_fence.c:21:13: note: initialize the variable 'passed' to silence this warning
           bool passed;
                      ^
                       = 0
   7 warnings generated.


vim +/passed +46 drivers/gpu/drm/xe/xe_wait_user_fence.c

dd08ebf6c3525a Matthew Brost   2023-03-30  16  
dd08ebf6c3525a Matthew Brost   2023-03-30  17  static int do_compare(u64 addr, u64 value, u64 mask, u16 op)
dd08ebf6c3525a Matthew Brost   2023-03-30  18  {
dd08ebf6c3525a Matthew Brost   2023-03-30  19  	u64 rvalue;
dd08ebf6c3525a Matthew Brost   2023-03-30  20  	int err;
dd08ebf6c3525a Matthew Brost   2023-03-30  21  	bool passed;
dd08ebf6c3525a Matthew Brost   2023-03-30  22  
dd08ebf6c3525a Matthew Brost   2023-03-30  23  	err = copy_from_user(&rvalue, u64_to_user_ptr(addr), sizeof(rvalue));
dd08ebf6c3525a Matthew Brost   2023-03-30  24  	if (err)
dd08ebf6c3525a Matthew Brost   2023-03-30  25  		return -EFAULT;
dd08ebf6c3525a Matthew Brost   2023-03-30  26  
dd08ebf6c3525a Matthew Brost   2023-03-30  27  	switch (op) {
76d52e37187b73 Rodrigo Vivi    2023-11-14  28  	case DRM_XE_UFENCE_WAIT_OP_EQ:
dd08ebf6c3525a Matthew Brost   2023-03-30  29  		passed = (rvalue & mask) == (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  30  		break;
76d52e37187b73 Rodrigo Vivi    2023-11-14  31  	case DRM_XE_UFENCE_WAIT_OP_NEQ:
dd08ebf6c3525a Matthew Brost   2023-03-30  32  		passed = (rvalue & mask) != (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  33  		break;
76d52e37187b73 Rodrigo Vivi    2023-11-14  34  	case DRM_XE_UFENCE_WAIT_OP_GT:
dd08ebf6c3525a Matthew Brost   2023-03-30  35  		passed = (rvalue & mask) > (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  36  		break;
76d52e37187b73 Rodrigo Vivi    2023-11-14  37  	case DRM_XE_UFENCE_WAIT_OP_GTE:
dd08ebf6c3525a Matthew Brost   2023-03-30  38  		passed = (rvalue & mask) >= (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  39  		break;
76d52e37187b73 Rodrigo Vivi    2023-11-14  40  	case DRM_XE_UFENCE_WAIT_OP_LT:
dd08ebf6c3525a Matthew Brost   2023-03-30  41  		passed = (rvalue & mask) < (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  42  		break;
76d52e37187b73 Rodrigo Vivi    2023-11-14  43  	case DRM_XE_UFENCE_WAIT_OP_LTE:
dd08ebf6c3525a Matthew Brost   2023-03-30  44  		passed = (rvalue & mask) <= (value & mask);
dd08ebf6c3525a Matthew Brost   2023-03-30  45  		break;
dd08ebf6c3525a Matthew Brost   2023-03-30 @46  	default:
5e0e3070659519 Francois Dugast 2023-07-27  47  		XE_WARN_ON("Not possible");
dd08ebf6c3525a Matthew Brost   2023-03-30  48  	}
dd08ebf6c3525a Matthew Brost   2023-03-30  49  
dd08ebf6c3525a Matthew Brost   2023-03-30  50  	return passed ? 0 : 1;
dd08ebf6c3525a Matthew Brost   2023-03-30  51  }
dd08ebf6c3525a Matthew Brost   2023-03-30  52  

:::::: The code at line 46 was first introduced by commit
:::::: dd08ebf6c3525a7ea2186e636df064ea47281987 drm/xe: Introduce a new DRM driver for Intel GPUs

:::::: TO: Matthew Brost <matthew.brost@intel.com>
:::::: CC: Rodrigo Vivi <rodrigo.vivi@intel.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [drm-xe:drm-xe-next 989/1016] drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken
  2023-12-16 19:28 ` kernel test robot
@ 2023-12-18 18:57   ` Nathan Chancellor
  -1 siblings, 0 replies; 8+ messages in thread
From: Nathan Chancellor @ 2023-12-18 18:57 UTC (permalink / raw)
  To: kernel test robot
  Cc: Lucas De Marchi, llvm, oe-kbuild-all, intel-xe, Rodrigo Vivi

On Sun, Dec 17, 2023 at 03:28:47AM +0800, kernel test robot wrote:
> tree:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
> head:   c54005fdd0347a17088e7ff78070a55bf9103bc4
> commit: ad7d86415578e1a5deedb0ceed5c281f7367d66d [989/1016] drm/xe: Enable W=1 warnings by default
> config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/config)
> compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202312170357.KPSinwPs-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>    warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]
>    warning: unknown warning option '-Wpacked-not-aligned'; did you mean '-Wpacked-non-pod'? [-Wunknown-warning-option]
>    warning: unknown warning option '-Wformat-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
>    warning: unknown warning option '-Wformat-truncation' [-Wunknown-warning-option]
>    warning: unknown warning option '-Wstringop-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
>    warning: unknown warning option '-Wstringop-truncation'; did you mean '-Wstring-concatenation'? [-Wunknown-warning-option]

I am not sure why these warnings are even showing up in the first place,
they are wrapped with cc-option, which should be catching that they are
not supported... Is 0day doing something funky with KCFLAGS?
Regardless...

> >> drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
>            default:
>            ^~~~~~~
>    drivers/gpu/drm/xe/xe_wait_user_fence.c:50:9: note: uninitialized use occurs here
>            return passed ? 0 : 1;
>                   ^~~~~~
>    drivers/gpu/drm/xe/xe_wait_user_fence.c:21:13: note: initialize the variable 'passed' to silence this warning
>            bool passed;
>                       ^
>                        = 0
>    7 warnings generated.

I was surprised that this was not caught sooner as
-Wsometimes-uninitialized is a part of -Wall but it looks like
drivers/gpu/drm/xe/Makefile was forked from the i915 Makefile before
commit 43192617f781 ("drm/i915: Enable -Wsometimes-uninitialized") was
added. It is good to see that the warnings are aligned now so that
trivial uninitialized warnings can be caught by clang because they are
disabled for GCC since commit 78a5255ffb6a ("Stop the ad-hoc games with
-Wno-maybe-initialized") in 5.7. Will this be fixed as a separate patch?

Cheers,
Nathan

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

* Re: [drm-xe:drm-xe-next 989/1016] drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken
@ 2023-12-18 18:57   ` Nathan Chancellor
  0 siblings, 0 replies; 8+ messages in thread
From: Nathan Chancellor @ 2023-12-18 18:57 UTC (permalink / raw)
  To: kernel test robot
  Cc: Rodrigo Vivi, llvm, Lucas De Marchi, intel-xe, oe-kbuild-all

On Sun, Dec 17, 2023 at 03:28:47AM +0800, kernel test robot wrote:
> tree:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
> head:   c54005fdd0347a17088e7ff78070a55bf9103bc4
> commit: ad7d86415578e1a5deedb0ceed5c281f7367d66d [989/1016] drm/xe: Enable W=1 warnings by default
> config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/config)
> compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202312170357.KPSinwPs-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>    warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]
>    warning: unknown warning option '-Wpacked-not-aligned'; did you mean '-Wpacked-non-pod'? [-Wunknown-warning-option]
>    warning: unknown warning option '-Wformat-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
>    warning: unknown warning option '-Wformat-truncation' [-Wunknown-warning-option]
>    warning: unknown warning option '-Wstringop-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
>    warning: unknown warning option '-Wstringop-truncation'; did you mean '-Wstring-concatenation'? [-Wunknown-warning-option]

I am not sure why these warnings are even showing up in the first place,
they are wrapped with cc-option, which should be catching that they are
not supported... Is 0day doing something funky with KCFLAGS?
Regardless...

> >> drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
>            default:
>            ^~~~~~~
>    drivers/gpu/drm/xe/xe_wait_user_fence.c:50:9: note: uninitialized use occurs here
>            return passed ? 0 : 1;
>                   ^~~~~~
>    drivers/gpu/drm/xe/xe_wait_user_fence.c:21:13: note: initialize the variable 'passed' to silence this warning
>            bool passed;
>                       ^
>                        = 0
>    7 warnings generated.

I was surprised that this was not caught sooner as
-Wsometimes-uninitialized is a part of -Wall but it looks like
drivers/gpu/drm/xe/Makefile was forked from the i915 Makefile before
commit 43192617f781 ("drm/i915: Enable -Wsometimes-uninitialized") was
added. It is good to see that the warnings are aligned now so that
trivial uninitialized warnings can be caught by clang because they are
disabled for GCC since commit 78a5255ffb6a ("Stop the ad-hoc games with
-Wno-maybe-initialized") in 5.7. Will this be fixed as a separate patch?

Cheers,
Nathan

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

* Re: [drm-xe:drm-xe-next 989/1016] drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken
  2023-12-18 18:57   ` Nathan Chancellor
@ 2023-12-18 20:28     ` Lucas De Marchi
  -1 siblings, 0 replies; 8+ messages in thread
From: Lucas De Marchi @ 2023-12-18 20:28 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Rodrigo Vivi, intel-xe, llvm, kernel test robot, oe-kbuild-all

On Mon, Dec 18, 2023 at 11:57:22AM -0700, Nathan Chancellor wrote:
>On Sun, Dec 17, 2023 at 03:28:47AM +0800, kernel test robot wrote:
>> tree:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
>> head:   c54005fdd0347a17088e7ff78070a55bf9103bc4
>> commit: ad7d86415578e1a5deedb0ceed5c281f7367d66d [989/1016] drm/xe: Enable W=1 warnings by default
>> config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/config)
>> compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202312170357.KPSinwPs-lkp@intel.com/
>>
>> All warnings (new ones prefixed by >>):
>>
>>    warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]
>>    warning: unknown warning option '-Wpacked-not-aligned'; did you mean '-Wpacked-non-pod'? [-Wunknown-warning-option]
>>    warning: unknown warning option '-Wformat-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
>>    warning: unknown warning option '-Wformat-truncation' [-Wunknown-warning-option]
>>    warning: unknown warning option '-Wstringop-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
>>    warning: unknown warning option '-Wstringop-truncation'; did you mean '-Wstring-concatenation'? [-Wunknown-warning-option]
>
>I am not sure why these warnings are even showing up in the first place,
>they are wrapped with cc-option, which should be catching that they are
>not supported... Is 0day doing something funky with KCFLAGS?
>Regardless...
>
>> >> drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
>>            default:
>>            ^~~~~~~
>>    drivers/gpu/drm/xe/xe_wait_user_fence.c:50:9: note: uninitialized use occurs here
>>            return passed ? 0 : 1;
>>                   ^~~~~~
>>    drivers/gpu/drm/xe/xe_wait_user_fence.c:21:13: note: initialize the variable 'passed' to silence this warning
>>            bool passed;
>>                       ^
>>                        = 0
>>    7 warnings generated.
>
>I was surprised that this was not caught sooner as
>-Wsometimes-uninitialized is a part of -Wall but it looks like
>drivers/gpu/drm/xe/Makefile was forked from the i915 Makefile before
>commit 43192617f781 ("drm/i915: Enable -Wsometimes-uninitialized") was
>added. It is good to see that the warnings are aligned now so that
>trivial uninitialized warnings can be caught by clang because they are
>disabled for GCC since commit 78a5255ffb6a ("Stop the ad-hoc games with
>-Wno-maybe-initialized") in 5.7. Will this be fixed as a separate patch?

https://lore.kernel.org/all/20231218163301.3453285-1-lucas.demarchi@intel.com/

Lucas De Marchi

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

* Re: [drm-xe:drm-xe-next 989/1016] drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken
@ 2023-12-18 20:28     ` Lucas De Marchi
  0 siblings, 0 replies; 8+ messages in thread
From: Lucas De Marchi @ 2023-12-18 20:28 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernel test robot, llvm, oe-kbuild-all, intel-xe, Rodrigo Vivi

On Mon, Dec 18, 2023 at 11:57:22AM -0700, Nathan Chancellor wrote:
>On Sun, Dec 17, 2023 at 03:28:47AM +0800, kernel test robot wrote:
>> tree:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
>> head:   c54005fdd0347a17088e7ff78070a55bf9103bc4
>> commit: ad7d86415578e1a5deedb0ceed5c281f7367d66d [989/1016] drm/xe: Enable W=1 warnings by default
>> config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/config)
>> compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/reproduce)
>>
>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
>> the same patch/commit), kindly add following tags
>> | Reported-by: kernel test robot <lkp@intel.com>
>> | Closes: https://lore.kernel.org/oe-kbuild-all/202312170357.KPSinwPs-lkp@intel.com/
>>
>> All warnings (new ones prefixed by >>):
>>
>>    warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]
>>    warning: unknown warning option '-Wpacked-not-aligned'; did you mean '-Wpacked-non-pod'? [-Wunknown-warning-option]
>>    warning: unknown warning option '-Wformat-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
>>    warning: unknown warning option '-Wformat-truncation' [-Wunknown-warning-option]
>>    warning: unknown warning option '-Wstringop-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
>>    warning: unknown warning option '-Wstringop-truncation'; did you mean '-Wstring-concatenation'? [-Wunknown-warning-option]
>
>I am not sure why these warnings are even showing up in the first place,
>they are wrapped with cc-option, which should be catching that they are
>not supported... Is 0day doing something funky with KCFLAGS?
>Regardless...
>
>> >> drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
>>            default:
>>            ^~~~~~~
>>    drivers/gpu/drm/xe/xe_wait_user_fence.c:50:9: note: uninitialized use occurs here
>>            return passed ? 0 : 1;
>>                   ^~~~~~
>>    drivers/gpu/drm/xe/xe_wait_user_fence.c:21:13: note: initialize the variable 'passed' to silence this warning
>>            bool passed;
>>                       ^
>>                        = 0
>>    7 warnings generated.
>
>I was surprised that this was not caught sooner as
>-Wsometimes-uninitialized is a part of -Wall but it looks like
>drivers/gpu/drm/xe/Makefile was forked from the i915 Makefile before
>commit 43192617f781 ("drm/i915: Enable -Wsometimes-uninitialized") was
>added. It is good to see that the warnings are aligned now so that
>trivial uninitialized warnings can be caught by clang because they are
>disabled for GCC since commit 78a5255ffb6a ("Stop the ad-hoc games with
>-Wno-maybe-initialized") in 5.7. Will this be fixed as a separate patch?

https://lore.kernel.org/all/20231218163301.3453285-1-lucas.demarchi@intel.com/

Lucas De Marchi

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

* Re: [drm-xe:drm-xe-next 989/1016] drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken
  2023-12-18 18:57   ` Nathan Chancellor
@ 2023-12-19  1:03     ` Philip Li
  -1 siblings, 0 replies; 8+ messages in thread
From: Philip Li @ 2023-12-19  1:03 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernel test robot, llvm, Lucas De Marchi, oe-kbuild-all,
	Rodrigo Vivi, intel-xe

On Mon, Dec 18, 2023 at 11:57:22AM -0700, Nathan Chancellor wrote:
> On Sun, Dec 17, 2023 at 03:28:47AM +0800, kernel test robot wrote:
> > tree:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
> > head:   c54005fdd0347a17088e7ff78070a55bf9103bc4
> > commit: ad7d86415578e1a5deedb0ceed5c281f7367d66d [989/1016] drm/xe: Enable W=1 warnings by default
> > config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/config)
> > compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/reproduce)
> > 
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202312170357.KPSinwPs-lkp@intel.com/
> > 
> > All warnings (new ones prefixed by >>):
> > 
> >    warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]
> >    warning: unknown warning option '-Wpacked-not-aligned'; did you mean '-Wpacked-non-pod'? [-Wunknown-warning-option]
> >    warning: unknown warning option '-Wformat-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
> >    warning: unknown warning option '-Wformat-truncation' [-Wunknown-warning-option]
> >    warning: unknown warning option '-Wstringop-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
> >    warning: unknown warning option '-Wstringop-truncation'; did you mean '-Wstring-concatenation'? [-Wunknown-warning-option]
> 
> I am not sure why these warnings are even showing up in the first place,
> they are wrapped with cc-option, which should be catching that they are
> not supported... Is 0day doing something funky with KCFLAGS?

Thanks Nathan for pointing this out, we will fix this issue to avoid showing these warnings.

And the bot does add some flags [1] to make the build more consistent and align with latest
mainline ones.

[1] https://github.com/intel/lkp-tests/blob/master/kbuild/etc/kbuild-kcflags

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

* Re: [drm-xe:drm-xe-next 989/1016] drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken
@ 2023-12-19  1:03     ` Philip Li
  0 siblings, 0 replies; 8+ messages in thread
From: Philip Li @ 2023-12-19  1:03 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernel test robot, Lucas De Marchi, llvm, oe-kbuild-all,
	intel-xe, Rodrigo Vivi

On Mon, Dec 18, 2023 at 11:57:22AM -0700, Nathan Chancellor wrote:
> On Sun, Dec 17, 2023 at 03:28:47AM +0800, kernel test robot wrote:
> > tree:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
> > head:   c54005fdd0347a17088e7ff78070a55bf9103bc4
> > commit: ad7d86415578e1a5deedb0ceed5c281f7367d66d [989/1016] drm/xe: Enable W=1 warnings by default
> > config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/config)
> > compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231217/202312170357.KPSinwPs-lkp@intel.com/reproduce)
> > 
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202312170357.KPSinwPs-lkp@intel.com/
> > 
> > All warnings (new ones prefixed by >>):
> > 
> >    warning: unknown warning option '-Wrestrict' [-Wunknown-warning-option]
> >    warning: unknown warning option '-Wpacked-not-aligned'; did you mean '-Wpacked-non-pod'? [-Wunknown-warning-option]
> >    warning: unknown warning option '-Wformat-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
> >    warning: unknown warning option '-Wformat-truncation' [-Wunknown-warning-option]
> >    warning: unknown warning option '-Wstringop-overflow'; did you mean '-Wshift-overflow'? [-Wunknown-warning-option]
> >    warning: unknown warning option '-Wstringop-truncation'; did you mean '-Wstring-concatenation'? [-Wunknown-warning-option]
> 
> I am not sure why these warnings are even showing up in the first place,
> they are wrapped with cc-option, which should be catching that they are
> not supported... Is 0day doing something funky with KCFLAGS?

Thanks Nathan for pointing this out, we will fix this issue to avoid showing these warnings.

And the bot does add some flags [1] to make the build more consistent and align with latest
mainline ones.

[1] https://github.com/intel/lkp-tests/blob/master/kbuild/etc/kbuild-kcflags

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

end of thread, other threads:[~2023-12-19  1:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-16 19:28 [drm-xe:drm-xe-next 989/1016] drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken kernel test robot
2023-12-16 19:28 ` kernel test robot
2023-12-18 18:57 ` Nathan Chancellor
2023-12-18 18:57   ` Nathan Chancellor
2023-12-18 20:28   ` Lucas De Marchi
2023-12-18 20:28     ` Lucas De Marchi
2023-12-19  1:03   ` Philip Li
2023-12-19  1:03     ` Philip Li

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.