* [litex-hub:litex-rebase 14/15] drivers/clk/clk-litex.c:539:21: warning: use of logical '&&' with constant operand
@ 2025-02-01 14:55 kernel test robot
2025-02-04 14:59 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2025-02-01 14:55 UTC (permalink / raw)
To: Pawel Czarnecki
Cc: llvm, oe-kbuild-all, Gabriel Somlo, Mateusz Holenko,
Geert Uytterhoeven
tree: https://github.com/litex-hub/linux litex-rebase
head: d063b9bfd84d4ae32eaa664cd7b8906d1e5a4265
commit: b3db33d374f80bc6db7c611301e3290cec95fee2 [14/15] LiteX: driver for MMCM
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250201/202502012258.KCOVEE5t-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250201/202502012258.KCOVEE5t-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/202502012258.KCOVEE5t-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/clk/clk-litex.c:11:
In file included from include/linux/platform_device.h:13:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:19:
In file included from include/linux/elf.h:6:
In file included from arch/s390/include/asm/elf.h:181:
In file included from arch/s390/include/asm/mmu_context.h:11:
In file included from arch/s390/include/asm/pgalloc.h:18:
In file included from include/linux/mm.h:2224:
include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
505 | item];
| ~~~~
include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
512 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
525 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/clk/clk-litex.c:539:21: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
539 | mul = GLOB_MUL_VAL && HL_TIME_MASK;
| ^ ~~~~~~~~~~~~
drivers/clk/clk-litex.c:539:21: note: use '&' for a bitwise operation
539 | mul = GLOB_MUL_VAL && HL_TIME_MASK;
| ^~
| &
drivers/clk/clk-litex.c:539:21: note: remove constant to silence this warning
539 | mul = GLOB_MUL_VAL && HL_TIME_MASK;
| ^~~~~~~~~~~~~~~
drivers/clk/clk-litex.c:540:41: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
540 | mul += (GLOB_MUL_VAL >> HIGH_TIME_POS) && HL_TIME_MASK;
| ^ ~~~~~~~~~~~~
drivers/clk/clk-litex.c:540:41: note: use '&' for a bitwise operation
540 | mul += (GLOB_MUL_VAL >> HIGH_TIME_POS) && HL_TIME_MASK;
| ^~
| &
drivers/clk/clk-litex.c:540:41: note: remove constant to silence this warning
540 | mul += (GLOB_MUL_VAL >> HIGH_TIME_POS) && HL_TIME_MASK;
| ^~~~~~~~~~~~~~~
drivers/clk/clk-litex.c:558:21: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
558 | mul = GLOB_MUL_VAL && HL_TIME_MASK;
| ^ ~~~~~~~~~~~~
drivers/clk/clk-litex.c:558:21: note: use '&' for a bitwise operation
558 | mul = GLOB_MUL_VAL && HL_TIME_MASK;
| ^~
| &
drivers/clk/clk-litex.c:558:21: note: remove constant to silence this warning
558 | mul = GLOB_MUL_VAL && HL_TIME_MASK;
| ^~~~~~~~~~~~~~~
drivers/clk/clk-litex.c:559:41: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
559 | mul += (GLOB_MUL_VAL >> HIGH_TIME_POS) && HL_TIME_MASK;
| ^ ~~~~~~~~~~~~
drivers/clk/clk-litex.c:559:41: note: use '&' for a bitwise operation
559 | mul += (GLOB_MUL_VAL >> HIGH_TIME_POS) && HL_TIME_MASK;
| ^~
| &
drivers/clk/clk-litex.c:559:41: note: remove constant to silence this warning
559 | mul += (GLOB_MUL_VAL >> HIGH_TIME_POS) && HL_TIME_MASK;
| ^~~~~~~~~~~~~~~
drivers/clk/clk-litex.c:728:19: warning: unused function 'litex_clk_calc_duty_high_time' [-Wunused-function]
728 | static inline int litex_clk_calc_duty_high_time(struct clk_hw *hw,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 warnings generated.
vim +539 drivers/clk/clk-litex.c
533
534 static int litex_clk_set_filt(struct clk_hw *hw)
535 {
536 u32 filt, mul;
537 int ret;
538
> 539 mul = GLOB_MUL_VAL && HL_TIME_MASK;
540 mul += (GLOB_MUL_VAL >> HIGH_TIME_POS) && HL_TIME_MASK;
541
542 filt = litex_clk_lookup_filter(mul - 1);
543
544 ret = litex_clk_change_value(hw, FILT_MASK, filt >> 16, FILT_REG1);
545 if (ret != 0)
546 return ret;
547 ret = litex_clk_change_value(hw, FILT_MASK, filt, FILT_REG2);
548 if (ret != 0)
549 return ret;
550 return 0;
551 }
552
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [litex-hub:litex-rebase 14/15] drivers/clk/clk-litex.c:539:21: warning: use of logical '&&' with constant operand
2025-02-01 14:55 [litex-hub:litex-rebase 14/15] drivers/clk/clk-litex.c:539:21: warning: use of logical '&&' with constant operand kernel test robot
@ 2025-02-04 14:59 ` Geert Uytterhoeven
2025-02-04 15:26 ` Gabriel L. Somlo
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2025-02-04 14:59 UTC (permalink / raw)
To: kernel test robot
Cc: Pawel Czarnecki, llvm, oe-kbuild-all, Gabriel Somlo,
Mateusz Holenko
Hi Kernel Test Robot,
On Sat, 1 Feb 2025 at 15:55, kernel test robot <lkp@intel.com> wrote:
> tree: https://github.com/litex-hub/linux litex-rebase
> head: d063b9bfd84d4ae32eaa664cd7b8906d1e5a4265
> commit: b3db33d374f80bc6db7c611301e3290cec95fee2 [14/15] LiteX: driver for MMCM
> config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250201/202502012258.KCOVEE5t-lkp@intel.com/config)
> compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250201/202502012258.KCOVEE5t-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/202502012258.KCOVEE5t-lkp@intel.com/
Thanks for your report!
> >> drivers/clk/clk-litex.c:539:21: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
> 539 | mul = GLOB_MUL_VAL && HL_TIME_MASK;
> | ^ ~~~~~~~~~~~~
> drivers/clk/clk-litex.c:539:21: note: use '&' for a bitwise operation
> 539 | mul = GLOB_MUL_VAL && HL_TIME_MASK;
> | ^~
> | &
Nice catch!
All four "&& HL_TIME_MASK" should be changed to "& HL_TIME_MASK".
Gabriel: I guess you don't need me to send a patch? ;-)
Thanks!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [litex-hub:litex-rebase 14/15] drivers/clk/clk-litex.c:539:21: warning: use of logical '&&' with constant operand
2025-02-04 14:59 ` Geert Uytterhoeven
@ 2025-02-04 15:26 ` Gabriel L. Somlo
0 siblings, 0 replies; 3+ messages in thread
From: Gabriel L. Somlo @ 2025-02-04 15:26 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: kernel test robot, Pawel Czarnecki, llvm, oe-kbuild-all,
Mateusz Holenko
On Tue, Feb 04, 2025 at 03:59:56PM +0100, Geert Uytterhoeven wrote:
> Nice catch!
>
> All four "&& HL_TIME_MASK" should be changed to "& HL_TIME_MASK".
> Gabriel: I guess you don't need me to send a patch? ;-)
Done -- applied, rebased, and force-pushed.
Thanks much!
Cheers,
--Gabriel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-04 15:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-01 14:55 [litex-hub:litex-rebase 14/15] drivers/clk/clk-litex.c:539:21: warning: use of logical '&&' with constant operand kernel test robot
2025-02-04 14:59 ` Geert Uytterhoeven
2025-02-04 15:26 ` Gabriel L. Somlo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox