lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231120151714.ttaFVMK0@linutronix.de>
Date:   Mon, 20 Nov 2023 16:17:14 +0100
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     kernel test robot <lkp@...el.com>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: kernel/time/hrtimer.c:1483:14: warning: variable
 'expires_in_hardirq' set but not used

On 2023-11-12 08:52:44 [+0800], kernel test robot wrote:
> Hi Sebastian,
Hi,

> FYI, the error/warning still remains.
> 
>    kernel/time/hrtimer.c:120:35: warning: initialized field overwritten [-Woverride-init]
>      120 |         [CLOCK_REALTIME]        = HRTIMER_BASE_REALTIME,
>          |                                   ^~~~~~~~~~~~~~~~~~~~~
>    kernel/time/hrtimer.c:120:35: note: (near initialization for 'hrtimer_clock_to_base_table[0]')
>    kernel/time/hrtimer.c:121:35: warning: initialized field overwritten [-Woverride-init]
>      121 |         [CLOCK_MONOTONIC]       = HRTIMER_BASE_MONOTONIC,
>          |                                   ^~~~~~~~~~~~~~~~~~~~~~
>    kernel/time/hrtimer.c:121:35: note: (near initialization for 'hrtimer_clock_to_base_table[1]')
>    kernel/time/hrtimer.c:122:35: warning: initialized field overwritten [-Woverride-init]
>      122 |         [CLOCK_BOOTTIME]        = HRTIMER_BASE_BOOTTIME,
>          |                                   ^~~~~~~~~~~~~~~~~~~~~
>    kernel/time/hrtimer.c:122:35: note: (near initialization for 'hrtimer_clock_to_base_table[7]')
>    kernel/time/hrtimer.c:123:35: warning: initialized field overwritten [-Woverride-init]
>      123 |         [CLOCK_TAI]             = HRTIMER_BASE_TAI,
>          |                                   ^~~~~~~~~~~~~~~~
>    kernel/time/hrtimer.c:123:35: note: (near initialization for 'hrtimer_clock_to_base_table[11]')

This is "okay". The array is first initialized completely to a safe
value and then a few of the individual values are overwritten.
So this "initialized field overwritten", that the compiler complains
about, is intended here. 

>    kernel/time/hrtimer.c: In function '__run_hrtimer':
> >> kernel/time/hrtimer.c:1483:14: warning: variable 'expires_in_hardirq' set but not used [-Wunused-but-set-variable]
>     1483 |         bool expires_in_hardirq;
>          |              ^~~~~~~~~~~~~~~~~~

This is because the code using it is disabled at build time. I could
tweak the code to make look it used in the off case so the warning goes
away.

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ