[intel-tdx:guest 47/63] drivers/acpi/acpica/hwsleep.c:119:25: warning: suggest braces around empty body in an 'if' statement
by kernel test robot
tree: https://github.com/intel/tdx.git guest
head: 8c20c364d1f52e432181d142054b1c2efa0ae6d3
commit: 96c781481b4771fb0fb4cc62072a6b1b50a0cea2 [47/63] x86/tdx: Skip WBINVD instruction for TDX guest
config: ia64-randconfig-p001-20210513 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel/tdx/commit/96c781481b4771fb0fb4cc62072a6b1b50a0cea2
git remote add intel-tdx https://github.com/intel/tdx.git
git fetch --no-tags intel-tdx guest
git checkout 96c781481b4771fb0fb4cc62072a6b1b50a0cea2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/acpi/acpica/hwsleep.c: In function 'acpi_hw_legacy_sleep':
>> drivers/acpi/acpica/hwsleep.c:119:25: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
119 | ACPI_FLUSH_CPU_CACHE();
| ^
vim +/if +119 drivers/acpi/acpica/hwsleep.c
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 17
709585765734e9 drivers/acpi/acpica/hwsleep.c Bob Moore 2012-02-14 18 #if (!ACPI_REDUCED_HARDWARE) /* Entire module */
44f6c01242da4e drivers/acpi/hardware/hwsleep.c Robert Moore 2005-04-18 19 /*******************************************************************************
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 20 *
2feec47d4c5f80 drivers/acpi/acpica/hwsleep.c Bob Moore 2012-02-14 21 * FUNCTION: acpi_hw_legacy_sleep
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 22 *
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 23 * PARAMETERS: sleep_state - Which sleep state to enter
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 24 *
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 25 * RETURN: Status
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 26 *
2feec47d4c5f80 drivers/acpi/acpica/hwsleep.c Bob Moore 2012-02-14 27 * DESCRIPTION: Enter a system sleep state via the legacy FADT PM registers
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 28 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 29 *
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 30 ******************************************************************************/
3f6f49c7854c92 drivers/acpi/acpica/hwsleep.c Len Brown 2012-07-26 31 acpi_status acpi_hw_legacy_sleep(u8 sleep_state)
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 32 {
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 33 struct acpi_bit_register_info *sleep_type_reg_info;
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 34 struct acpi_bit_register_info *sleep_enable_reg_info;
2feec47d4c5f80 drivers/acpi/acpica/hwsleep.c Bob Moore 2012-02-14 35 u32 pm1a_control;
2feec47d4c5f80 drivers/acpi/acpica/hwsleep.c Bob Moore 2012-02-14 36 u32 pm1b_control;
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 37 u32 in_value;
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 38 acpi_status status;
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 39
2feec47d4c5f80 drivers/acpi/acpica/hwsleep.c Bob Moore 2012-02-14 40 ACPI_FUNCTION_TRACE(hw_legacy_sleep);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 41
4be44fcd3bf648 drivers/acpi/hardware/hwsleep.c Len Brown 2005-08-05 42 sleep_type_reg_info =
82d79b86646504 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 43 acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_TYPE);
4be44fcd3bf648 drivers/acpi/hardware/hwsleep.c Len Brown 2005-08-05 44 sleep_enable_reg_info =
4be44fcd3bf648 drivers/acpi/hardware/hwsleep.c Len Brown 2005-08-05 45 acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_ENABLE);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 46
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 47 /* Clear wake status */
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 48
1fad87385e7e82 drivers/acpi/acpica/hwsleep.c Bob Moore 2015-12-29 49 status = acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS,
1fad87385e7e82 drivers/acpi/acpica/hwsleep.c Bob Moore 2015-12-29 50 ACPI_CLEAR_STATUS);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 51 if (ACPI_FAILURE(status)) {
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 52 return_ACPI_STATUS(status);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 53 }
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 54
fa85015c0d9588 drivers/acpi/acpica/hwsleep.c Rafael J. Wysocki 2018-07-09 55 /* Disable all GPEs */
fa85015c0d9588 drivers/acpi/acpica/hwsleep.c Rafael J. Wysocki 2018-07-09 56 status = acpi_hw_disable_all_gpes();
fa85015c0d9588 drivers/acpi/acpica/hwsleep.c Rafael J. Wysocki 2018-07-09 57 if (ACPI_FAILURE(status)) {
fa85015c0d9588 drivers/acpi/acpica/hwsleep.c Rafael J. Wysocki 2018-07-09 58 return_ACPI_STATUS(status);
fa85015c0d9588 drivers/acpi/acpica/hwsleep.c Rafael J. Wysocki 2018-07-09 59 }
fa85015c0d9588 drivers/acpi/acpica/hwsleep.c Rafael J. Wysocki 2018-07-09 60 status = acpi_hw_clear_acpi_status();
1d99967badac59 drivers/acpi/hardware/hwsleep.c Alexey Starikovskiy 2007-03-12 61 if (ACPI_FAILURE(status)) {
1d99967badac59 drivers/acpi/hardware/hwsleep.c Alexey Starikovskiy 2007-03-12 62 return_ACPI_STATUS(status);
1d99967badac59 drivers/acpi/hardware/hwsleep.c Alexey Starikovskiy 2007-03-12 63 }
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 64 acpi_gbl_system_awake_and_running = FALSE;
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 65
fa85015c0d9588 drivers/acpi/acpica/hwsleep.c Rafael J. Wysocki 2018-07-09 66 /* Enable all wakeup GPEs */
73459f73e5d160 drivers/acpi/hardware/hwsleep.c Robert Moore 2005-06-24 67 status = acpi_hw_enable_all_wakeup_gpes();
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 68 if (ACPI_FAILURE(status)) {
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 69 return_ACPI_STATUS(status);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 70 }
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 71
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 72 /* Get current value of PM1A control */
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 73
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 74 status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL,
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 75 &pm1a_control);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 76 if (ACPI_FAILURE(status)) {
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 77 return_ACPI_STATUS(status);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 78 }
44f6c01242da4e drivers/acpi/hardware/hwsleep.c Robert Moore 2005-04-18 79 ACPI_DEBUG_PRINT((ACPI_DB_INIT,
b27d65975c252f drivers/acpi/acpica/hwsleep.c Bob Moore 2010-05-26 80 "Entering sleep state [S%u]\n", sleep_state));
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 81
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 82 /* Clear the SLP_EN and SLP_TYP fields */
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 83
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 84 pm1a_control &= ~(sleep_type_reg_info->access_bit_mask |
44f6c01242da4e drivers/acpi/hardware/hwsleep.c Robert Moore 2005-04-18 85 sleep_enable_reg_info->access_bit_mask);
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 86 pm1b_control = pm1a_control;
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 87
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 88 /* Insert the SLP_TYP bits */
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 89
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 90 pm1a_control |=
4be44fcd3bf648 drivers/acpi/hardware/hwsleep.c Len Brown 2005-08-05 91 (acpi_gbl_sleep_type_a << sleep_type_reg_info->bit_position);
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 92 pm1b_control |=
4be44fcd3bf648 drivers/acpi/hardware/hwsleep.c Len Brown 2005-08-05 93 (acpi_gbl_sleep_type_b << sleep_type_reg_info->bit_position);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 94
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 95 /*
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 96 * We split the writes of SLP_TYP and SLP_EN to workaround
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 97 * poorly implemented hardware.
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 98 */
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 99
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 100 /* Write #1: write the SLP_TYP data to the PM1 Control registers */
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 101
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 102 status = acpi_hw_write_pm1_control(pm1a_control, pm1b_control);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 103 if (ACPI_FAILURE(status)) {
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 104 return_ACPI_STATUS(status);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 105 }
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 106
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 107 /* Insert the sleep enable (SLP_EN) bit */
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 108
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 109 pm1a_control |= sleep_enable_reg_info->access_bit_mask;
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 110 pm1b_control |= sleep_enable_reg_info->access_bit_mask;
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 111
96c781481b4771 drivers/acpi/acpica/hwsleep.c Kuppuswamy Sathyanarayanan 2021-05-12 112 /*
96c781481b4771 drivers/acpi/acpica/hwsleep.c Kuppuswamy Sathyanarayanan 2021-05-12 113 * WBINVD instruction is not supported in TDX
96c781481b4771 drivers/acpi/acpica/hwsleep.c Kuppuswamy Sathyanarayanan 2021-05-12 114 * guest. Since ACPI_FLUSH_CPU_CACHE() uses
96c781481b4771 drivers/acpi/acpica/hwsleep.c Kuppuswamy Sathyanarayanan 2021-05-12 115 * WBINVD, skip cache flushes for TDX guests.
96c781481b4771 drivers/acpi/acpica/hwsleep.c Kuppuswamy Sathyanarayanan 2021-05-12 116 */
96c781481b4771 drivers/acpi/acpica/hwsleep.c Kuppuswamy Sathyanarayanan 2021-05-12 117 if (!protected_guest_has(GUEST_TYPE_TDX))
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 118 /* Flush caches, as per ACPI specification */
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 @119 ACPI_FLUSH_CPU_CACHE();
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 120
0fc5e8f4e4b33d drivers/acpi/acpica/hwsleep.c Lv Zheng 2016-12-28 121 status = acpi_os_enter_sleep(sleep_state, pm1a_control, pm1b_control);
0fc5e8f4e4b33d drivers/acpi/acpica/hwsleep.c Lv Zheng 2016-12-28 122 if (status == AE_CTRL_TERMINATE) {
09f98a825a821f drivers/acpi/acpica/hwsleep.c Tang Liang 2011-12-09 123 return_ACPI_STATUS(AE_OK);
0fc5e8f4e4b33d drivers/acpi/acpica/hwsleep.c Lv Zheng 2016-12-28 124 }
0fc5e8f4e4b33d drivers/acpi/acpica/hwsleep.c Lv Zheng 2016-12-28 125 if (ACPI_FAILURE(status)) {
09f98a825a821f drivers/acpi/acpica/hwsleep.c Tang Liang 2011-12-09 126 return_ACPI_STATUS(status);
0fc5e8f4e4b33d drivers/acpi/acpica/hwsleep.c Lv Zheng 2016-12-28 127 }
0fc5e8f4e4b33d drivers/acpi/acpica/hwsleep.c Lv Zheng 2016-12-28 128
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 129 /* Write #2: Write both SLP_TYP + SLP_EN */
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 130
32c9ef994d9135 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-18 131 status = acpi_hw_write_pm1_control(pm1a_control, pm1b_control);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 132 if (ACPI_FAILURE(status)) {
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 133 return_ACPI_STATUS(status);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 134 }
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 135
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 136 if (sleep_state > ACPI_STATE_S3) {
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 137 /*
44f6c01242da4e drivers/acpi/hardware/hwsleep.c Robert Moore 2005-04-18 138 * We wanted to sleep > S3, but it didn't happen (by virtue of the
44f6c01242da4e drivers/acpi/hardware/hwsleep.c Robert Moore 2005-04-18 139 * fact that we are still executing!)
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 140 *
44f6c01242da4e drivers/acpi/hardware/hwsleep.c Robert Moore 2005-04-18 141 * Wait ten seconds, then try again. This is to get S4/S5 to work on
44f6c01242da4e drivers/acpi/hardware/hwsleep.c Robert Moore 2005-04-18 142 * all machines.
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 143 *
d4913dc6d0c680 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-03-06 144 * We wait so long to allow chipsets that poll this reg very slowly
d4913dc6d0c680 drivers/acpi/acpica/hwsleep.c Bob Moore 2009-03-06 145 * to still read the right value. Ideally, this block would go
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 146 * away entirely.
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 147 */
c41679a4481d5b drivers/acpi/acpica/hwsleep.c Bob Moore 2012-12-31 148 acpi_os_stall(10 * ACPI_USEC_PER_SEC);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 149
d30dc9abb4aacf drivers/acpi/hardware/hwsleep.c Alexey Starikovskiy 2007-09-30 150 status = acpi_hw_register_write(ACPI_REGISTER_PM1_CONTROL,
4be44fcd3bf648 drivers/acpi/hardware/hwsleep.c Len Brown 2005-08-05 151 sleep_enable_reg_info->
4be44fcd3bf648 drivers/acpi/hardware/hwsleep.c Len Brown 2005-08-05 152 access_bit_mask);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 153 if (ACPI_FAILURE(status)) {
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 154 return_ACPI_STATUS(status);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 155 }
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 156 }
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 157
2feec47d4c5f80 drivers/acpi/acpica/hwsleep.c Bob Moore 2012-02-14 158 /* Wait for transition back to Working State */
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 159
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 160 do {
50ffba1bd3120b drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-23 161 status =
50ffba1bd3120b drivers/acpi/acpica/hwsleep.c Bob Moore 2009-02-23 162 acpi_read_bit_register(ACPI_BITREG_WAKE_STATUS, &in_value);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 163 if (ACPI_FAILURE(status)) {
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 164 return_ACPI_STATUS(status);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 165 }
2feec47d4c5f80 drivers/acpi/acpica/hwsleep.c Bob Moore 2012-02-14 166
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 167 } while (!in_value);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 168
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 169 return_ACPI_STATUS(AE_OK);
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 170 }
^1da177e4c3f41 drivers/acpi/hardware/hwsleep.c Linus Torvalds 2005-04-16 171
:::::: The code at line 119 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c:1807:1: warning: unused variable 'iwl_dbgfs_dbg_time_point_ops'
by kernel test robot
Hi Mordechay,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c06a2ba62fc401b7aaefd23f5d0bc06d2457ccc1
commit: 9dbb62a29042e543ab6671dc12c1473c3cbc58c2 iwlwifi: mvm: add debugfs entry to trigger a dump as any time-point
date: 3 months ago
config: arm64-randconfig-r001-20210513 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a0fed635fe1701470062495a6ffee1c608f3f1bc)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 9dbb62a29042e543ab6671dc12c1473c3cbc58c2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c:1807:1: warning: unused variable 'iwl_dbgfs_dbg_time_point_ops' [-Wunused-const-variable]
MVM_DEBUGFS_WRITE_FILE_OPS(dbg_time_point, 64);
^
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c:1554:2: note: expanded from macro 'MVM_DEBUGFS_WRITE_FILE_OPS'
_MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz, struct iwl_mvm)
^
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.h:39:37: note: expanded from macro '_MVM_DEBUGFS_WRITE_FILE_OPS'
static const struct file_operations iwl_dbgfs_##name##_ops = { \
^
<scratch space>:48:1: note: expanded from here
iwl_dbgfs_dbg_time_point_ops
^
1 warning generated.
vim +/iwl_dbgfs_dbg_time_point_ops +1807 drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
1780
1781 /* Device wide debugfs entries */
1782 MVM_DEBUGFS_READ_FILE_OPS(ctdp_budget);
1783 MVM_DEBUGFS_WRITE_FILE_OPS(stop_ctdp, 8);
1784 MVM_DEBUGFS_WRITE_FILE_OPS(force_ctkill, 8);
1785 MVM_DEBUGFS_WRITE_FILE_OPS(tx_flush, 16);
1786 MVM_DEBUGFS_WRITE_FILE_OPS(sta_drain, 8);
1787 MVM_DEBUGFS_WRITE_FILE_OPS(send_echo_cmd, 8);
1788 MVM_DEBUGFS_READ_WRITE_FILE_OPS(sram, 64);
1789 MVM_DEBUGFS_READ_WRITE_FILE_OPS(set_nic_temperature, 64);
1790 MVM_DEBUGFS_READ_FILE_OPS(nic_temp);
1791 MVM_DEBUGFS_READ_FILE_OPS(stations);
1792 MVM_DEBUGFS_READ_FILE_OPS(rs_data);
1793 MVM_DEBUGFS_READ_FILE_OPS(bt_notif);
1794 MVM_DEBUGFS_READ_FILE_OPS(bt_cmd);
1795 MVM_DEBUGFS_READ_WRITE_FILE_OPS(disable_power_off, 64);
1796 MVM_DEBUGFS_READ_FILE_OPS(fw_rx_stats);
1797 MVM_DEBUGFS_READ_FILE_OPS(drv_rx_stats);
1798 MVM_DEBUGFS_READ_FILE_OPS(fw_ver);
1799 MVM_DEBUGFS_READ_FILE_OPS(phy_integration_ver);
1800 MVM_DEBUGFS_WRITE_FILE_OPS(fw_restart, 10);
1801 MVM_DEBUGFS_WRITE_FILE_OPS(fw_nmi, 10);
1802 MVM_DEBUGFS_WRITE_FILE_OPS(bt_tx_prio, 10);
1803 MVM_DEBUGFS_WRITE_FILE_OPS(bt_force_ant, 10);
1804 MVM_DEBUGFS_READ_WRITE_FILE_OPS(scan_ant_rxchain, 8);
1805 MVM_DEBUGFS_READ_WRITE_FILE_OPS(fw_dbg_conf, 8);
1806 MVM_DEBUGFS_WRITE_FILE_OPS(fw_dbg_collect, 64);
> 1807 MVM_DEBUGFS_WRITE_FILE_OPS(dbg_time_point, 64);
1808 MVM_DEBUGFS_WRITE_FILE_OPS(indirection_tbl,
1809 (IWL_RSS_INDIRECTION_TABLE_SIZE * 2));
1810 MVM_DEBUGFS_WRITE_FILE_OPS(inject_packet, 512);
1811 MVM_DEBUGFS_WRITE_FILE_OPS(inject_beacon_ie, 512);
1812 MVM_DEBUGFS_WRITE_FILE_OPS(inject_beacon_ie_restore, 512);
1813
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[linux-next:master 1527/2770] drivers/char/pcmcia/cm4000_cs.c:569:16: warning: iteration 4 invokes undefined behavior
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: ec2618180c3450d06a6a4ba951d4c9a2c689b517
commit: 5ae6eadfdaf431f47adbdf1754f3b5a5fd638de2 [1527/2770] asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE
config: m68k-randconfig-r035-20210513 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 5ae6eadfdaf431f47adbdf1754f3b5a5fd638de2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/char/pcmcia/cm4000_cs.c: In function 'cmm_write':
drivers/char/pcmcia/cm4000_cs.c:1053:16: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
1053 | unsigned char tmp;
| ^~~
drivers/char/pcmcia/cm4000_cs.c: In function 'set_protocol':
>> drivers/char/pcmcia/cm4000_cs.c:569:16: warning: iteration 4 invokes undefined behavior [-Waggressive-loop-optimizations]
569 | pts_reply[i] = inb(REG_BUF_DATA(iobase));
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/char/pcmcia/cm4000_cs.c:567:2: note: within this loop
567 | for (i = 0; i < num_bytes_read; i++) {
| ^~~
vim +569 drivers/char/pcmcia/cm4000_cs.c
c1986ee9bea3d8 Harald Welte 2005-11-13 516
c1986ee9bea3d8 Harald Welte 2005-11-13 517 /* set number of bytes to write */
c1986ee9bea3d8 Harald Welte 2005-11-13 518 DEBUGP(5, dev, "Set number of bytes to write\n");
c1986ee9bea3d8 Harald Welte 2005-11-13 519 xoutb(0x04, REG_NUM_SEND(iobase));
c1986ee9bea3d8 Harald Welte 2005-11-13 520
c1986ee9bea3d8 Harald Welte 2005-11-13 521 /* Trigger CARDMAN CONTROLLER */
c1986ee9bea3d8 Harald Welte 2005-11-13 522 xoutb(0x50, REG_FLAGS0(iobase));
c1986ee9bea3d8 Harald Welte 2005-11-13 523
c1986ee9bea3d8 Harald Welte 2005-11-13 524 /* Monitor progress */
c1986ee9bea3d8 Harald Welte 2005-11-13 525 /* wait for xmit done */
c1986ee9bea3d8 Harald Welte 2005-11-13 526 DEBUGP(5, dev, "Waiting for NumRecBytes getting valid\n");
c1986ee9bea3d8 Harald Welte 2005-11-13 527
c1986ee9bea3d8 Harald Welte 2005-11-13 528 for (i = 0; i < 100; i++) {
c1986ee9bea3d8 Harald Welte 2005-11-13 529 if (inb(REG_FLAGS0(iobase)) & 0x08) {
c1986ee9bea3d8 Harald Welte 2005-11-13 530 DEBUGP(5, dev, "NumRecBytes is valid\n");
c1986ee9bea3d8 Harald Welte 2005-11-13 531 break;
c1986ee9bea3d8 Harald Welte 2005-11-13 532 }
be826ada52f1fc Jia-Ju Bai 2018-03-18 533 usleep_range(10000, 11000);
c1986ee9bea3d8 Harald Welte 2005-11-13 534 }
c1986ee9bea3d8 Harald Welte 2005-11-13 535 if (i == 100) {
c1986ee9bea3d8 Harald Welte 2005-11-13 536 DEBUGP(5, dev, "Timeout waiting for NumRecBytes getting "
c1986ee9bea3d8 Harald Welte 2005-11-13 537 "valid\n");
c1986ee9bea3d8 Harald Welte 2005-11-13 538 rc = -EIO;
c1986ee9bea3d8 Harald Welte 2005-11-13 539 goto exit_setprotocol;
c1986ee9bea3d8 Harald Welte 2005-11-13 540 }
c1986ee9bea3d8 Harald Welte 2005-11-13 541
c1986ee9bea3d8 Harald Welte 2005-11-13 542 DEBUGP(5, dev, "Reading NumRecBytes\n");
c1986ee9bea3d8 Harald Welte 2005-11-13 543 for (i = 0; i < 100; i++) {
c1986ee9bea3d8 Harald Welte 2005-11-13 544 io_read_num_rec_bytes(iobase, &num_bytes_read);
c1986ee9bea3d8 Harald Welte 2005-11-13 545 if (num_bytes_read >= 4) {
c1986ee9bea3d8 Harald Welte 2005-11-13 546 DEBUGP(2, dev, "NumRecBytes = %i\n", num_bytes_read);
c1986ee9bea3d8 Harald Welte 2005-11-13 547 break;
c1986ee9bea3d8 Harald Welte 2005-11-13 548 }
be826ada52f1fc Jia-Ju Bai 2018-03-18 549 usleep_range(10000, 11000);
c1986ee9bea3d8 Harald Welte 2005-11-13 550 }
c1986ee9bea3d8 Harald Welte 2005-11-13 551
c1986ee9bea3d8 Harald Welte 2005-11-13 552 /* check whether it is a short PTS reply? */
c1986ee9bea3d8 Harald Welte 2005-11-13 553 if (num_bytes_read == 3)
c1986ee9bea3d8 Harald Welte 2005-11-13 554 i = 0;
c1986ee9bea3d8 Harald Welte 2005-11-13 555
c1986ee9bea3d8 Harald Welte 2005-11-13 556 if (i == 100) {
c1986ee9bea3d8 Harald Welte 2005-11-13 557 DEBUGP(5, dev, "Timeout reading num_bytes_read\n");
c1986ee9bea3d8 Harald Welte 2005-11-13 558 rc = -EIO;
c1986ee9bea3d8 Harald Welte 2005-11-13 559 goto exit_setprotocol;
c1986ee9bea3d8 Harald Welte 2005-11-13 560 }
c1986ee9bea3d8 Harald Welte 2005-11-13 561
c1986ee9bea3d8 Harald Welte 2005-11-13 562 DEBUGP(5, dev, "Reset the CARDMAN CONTROLLER\n");
c1986ee9bea3d8 Harald Welte 2005-11-13 563 xoutb(0x80, REG_FLAGS0(iobase));
c1986ee9bea3d8 Harald Welte 2005-11-13 564
c1986ee9bea3d8 Harald Welte 2005-11-13 565 /* Read PPS reply */
c1986ee9bea3d8 Harald Welte 2005-11-13 566 DEBUGP(5, dev, "Read PPS reply\n");
c1986ee9bea3d8 Harald Welte 2005-11-13 567 for (i = 0; i < num_bytes_read; i++) {
c1986ee9bea3d8 Harald Welte 2005-11-13 568 xoutb(i, REG_BUF_ADDR(iobase));
c1986ee9bea3d8 Harald Welte 2005-11-13 @569 pts_reply[i] = inb(REG_BUF_DATA(iobase));
c1986ee9bea3d8 Harald Welte 2005-11-13 570 }
c1986ee9bea3d8 Harald Welte 2005-11-13 571
:::::: The code at line 569 was first introduced by commit
:::::: c1986ee9bea3d880bcf0d3f1a31e055778f306c7 [PATCH] New Omnikey Cardman 4000 driver
:::::: TO: Harald Welte <laforge(a)gnumonks.org>
:::::: CC: Linus Torvalds <torvalds(a)g5.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[linux-next:master 2759/2770] include/linux/kernel.h:53:43: error: dereferencing pointer to incomplete type 'struct module'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: ec2618180c3450d06a6a4ba951d4c9a2c689b517
commit: 39a85add9ea5d011d1b109d8af183f048936ee0f [2759/2770] module: add printk formats to add module build ID to stacktraces
config: nios2-randconfig-r003-20210513 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 39a85add9ea5d011d1b109d8af183f048936ee0f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=nios2
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
kernel/kallsyms.c: In function 'kallsyms_lookup_size_offset':
kernel/kallsyms.c:310:11: error: too many arguments to function 'module_address_lookup'
310 | return !!module_address_lookup(addr, symbolsize, offset, NULL, NULL, namebuf) ||
| ^~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/kallsyms.h:14,
from kernel/kallsyms.c:15:
include/linux/module.h:745:27: note: declared here
745 | static inline const char *module_address_lookup(unsigned long addr,
| ^~~~~~~~~~~~~~~~~~~~~
kernel/kallsyms.c: At top level:
kernel/kallsyms.c:314:13: warning: no previous prototype for 'kallsyms_lookup_buildid' [-Wmissing-prototypes]
314 | const char *kallsyms_lookup_buildid(unsigned long addr, unsigned long *symbolsize,
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/kallsyms.c: In function 'kallsyms_lookup_buildid':
kernel/kallsyms.c:341:18: error: passing argument 5 of 'module_address_lookup' from incompatible pointer type [-Werror=incompatible-pointer-types]
341 | modname, modbuildid, namebuf);
| ^~~~~~~~~~
| |
| const unsigned char **
In file included from include/linux/kallsyms.h:14,
from kernel/kallsyms.c:15:
include/linux/module.h:749:14: note: expected 'char *' but argument is of type 'const unsigned char **'
749 | char *namebuf)
| ~~~~~~^~~~~~~
kernel/kallsyms.c:340:8: error: too many arguments to function 'module_address_lookup'
340 | ret = module_address_lookup(addr, symbolsize, offset,
| ^~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/kallsyms.h:14,
from kernel/kallsyms.c:15:
include/linux/module.h:745:27: note: declared here
745 | static inline const char *module_address_lookup(unsigned long addr,
| ^~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:6,
from include/linux/kernel.h:12,
from include/linux/cpumask.h:10,
from include/linux/mm_types_task.h:14,
from include/linux/mm_types.h:5,
from include/linux/buildid.h:5,
from include/linux/kallsyms.h:10,
from kernel/kallsyms.c:15:
kernel/kallsyms.c: In function '__sprint_symbol':
>> include/linux/kernel.h:53:43: error: dereferencing pointer to incomplete type 'struct module'
53 | #define typeof_member(T, m) typeof(((T*)0)->m)
| ^~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
kernel/kallsyms.c:454:4: note: in expansion of macro 'static_assert'
454 | static_assert(sizeof(typeof_member(struct module, build_id)) == 20);
| ^~~~~~~~~~~~~
kernel/kallsyms.c:454:25: note: in expansion of macro 'typeof_member'
454 | static_assert(sizeof(typeof_member(struct module, build_id)) == 20);
| ^~~~~~~~~~~~~
>> include/linux/build_bug.h:78:41: error: static assertion failed: "sizeof(typeof_member(struct module, build_id)) == 20"
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~~~~~~~~~~~
include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ^~~~~~~~~~~~~~~
kernel/kallsyms.c:454:4: note: in expansion of macro 'static_assert'
454 | static_assert(sizeof(typeof_member(struct module, build_id)) == 20);
| ^~~~~~~~~~~~~
kernel/kallsyms.c: At top level:
kernel/kallsyms.c:570:12: warning: no previous prototype for 'arch_get_kallsym' [-Wmissing-prototypes]
570 | int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value,
| ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +53 include/linux/kernel.h
3ed605bc8a0a68 Gustavo Padovan 2016-04-26 52
ce251e0e3c0597 Alexey Dobriyan 2019-07-16 @53 #define typeof_member(T, m) typeof(((T*)0)->m)
ce251e0e3c0597 Alexey Dobriyan 2019-07-16 54
:::::: The code at line 53 was first introduced by commit
:::::: ce251e0e3c0597ea8cab5787df579bd1f9c1aca1 include/linux/kernel.h: add typeof_member() macro
:::::: TO: Alexey Dobriyan <adobriyan(a)gmail.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[chrome-os:chromeos-4.14 14/20] sound/soc/codecs/cs42l42.c:1476 cs42l42_irq_thread() warn: inconsistent indenting
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.14
head: bbebfb4634bb843e284ba8fcf9cb816d51fada7b
commit: 972c48e87ad66b0893810f0b2d839fcd77e5e31e [14/20] CHROMIUM: ASoC: cs42l42: Switch to SCLK in IRQ
config: i386-randconfig-m021-20210513 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
smatch warnings:
sound/soc/codecs/cs42l42.c:1476 cs42l42_irq_thread() warn: inconsistent indenting
vim +1476 sound/soc/codecs/cs42l42.c
1439
1440 static irqreturn_t cs42l42_irq_thread(int irq, void *data)
1441 {
1442 struct cs42l42_private *cs42l42 = (struct cs42l42_private *)data;
1443 struct snd_soc_component *component = cs42l42->component;
1444 unsigned int stickies[12];
1445 unsigned int masks[12];
1446 unsigned int current_plug_status;
1447 unsigned int current_button_status;
1448 unsigned int i;
1449 int report = 0;
1450
1451
1452 /* Read sticky registers to clear interurpt */
1453 for (i = 0; i < ARRAY_SIZE(stickies); i++) {
1454 regmap_read(cs42l42->regmap, irq_params_table[i].status_addr,
1455 &(stickies[i]));
1456 regmap_read(cs42l42->regmap, irq_params_table[i].mask_addr,
1457 &(masks[i]));
1458 stickies[i] = stickies[i] & (~masks[i]) &
1459 irq_params_table[i].mask;
1460 }
1461
1462 if(cs42l42->pll_lock != stickies[10]) {
1463
1464 dev_dbg(component->dev, "%s() PLL lock transition %d => %d\n",
1465 __func__, cs42l42->pll_lock, stickies[10]);
1466
1467 /* Update pll_lock status */
1468 cs42l42->pll_lock = stickies[10];
1469
1470 if(cs42l42->pll_lock) {
1471 dev_dbg(component->dev, "%s() Switching to PLL\n", __func__);
1472 /* Mark SCLK as present */
1473 regmap_multi_reg_write(cs42l42->regmap, cs42l42_to_sclk_seq,
1474 ARRAY_SIZE(cs42l42_to_sclk_seq));
1475
> 1476 return IRQ_HANDLED;
1477 }
1478 }
1479
1480 /* Read tip sense status before handling type detect */
1481 current_plug_status = (stickies[11] &
1482 (CS42L42_TS_PLUG_MASK | CS42L42_TS_UNPLUG_MASK)) >>
1483 CS42L42_TS_PLUG_SHIFT;
1484
1485 /* Read button sense status */
1486 current_button_status = stickies[7] &
1487 (CS42L42_M_DETECT_TF_MASK |
1488 CS42L42_M_DETECT_FT_MASK |
1489 CS42L42_M_HSBIAS_HIZ_MASK);
1490
1491 /* Check auto-detect status */
1492 if ((~masks[5]) & irq_params_table[5].mask) {
1493 if (stickies[5] & CS42L42_HSDET_AUTO_DONE_MASK) {
1494 cs42l42_process_hs_type_detect(cs42l42);
1495 switch(cs42l42->hs_type){
1496 case CS42L42_PLUG_CTIA:
1497 case CS42L42_PLUG_OMTP:
1498 snd_soc_jack_report(cs42l42->jack, SND_JACK_HEADSET,
1499 SND_JACK_HEADSET);
1500 break;
1501 case CS42L42_PLUG_HEADPHONE:
1502 snd_soc_jack_report(cs42l42->jack, SND_JACK_HEADPHONE,
1503 SND_JACK_HEADPHONE);
1504 break;
1505 default:
1506 break;
1507 }
1508 dev_dbg(component->dev, "Auto detect done (%d)\n", cs42l42->hs_type);
1509 }
1510 }
1511
1512 /* Check tip sense status */
1513 if ((~masks[11]) & irq_params_table[11].mask) {
1514 switch (current_plug_status) {
1515 case CS42L42_TS_PLUG:
1516 if (cs42l42->plug_state != CS42L42_TS_PLUG) {
1517 cs42l42->plug_state = CS42L42_TS_PLUG;
1518 cs42l42_init_hs_type_detect(cs42l42);
1519 }
1520 break;
1521
1522 case CS42L42_TS_UNPLUG:
1523 if (cs42l42->plug_state != CS42L42_TS_UNPLUG) {
1524 cs42l42->plug_state = CS42L42_TS_UNPLUG;
1525 cs42l42_cancel_hs_type_detect(cs42l42);
1526
1527 switch(cs42l42->hs_type){
1528 case CS42L42_PLUG_CTIA:
1529 case CS42L42_PLUG_OMTP:
1530 snd_soc_jack_report(cs42l42->jack, 0, SND_JACK_HEADSET);
1531 break;
1532 case CS42L42_PLUG_HEADPHONE:
1533 snd_soc_jack_report(cs42l42->jack, 0, SND_JACK_HEADPHONE);
1534 break;
1535 default:
1536 break;
1537 }
1538 dev_dbg(component->dev, "Unplug event\n");
1539 }
1540 break;
1541
1542 default:
1543 if (cs42l42->plug_state != CS42L42_TS_TRANS)
1544 cs42l42->plug_state = CS42L42_TS_TRANS;
1545 }
1546 }
1547
1548 /* Check button detect status */
1549 if ((~masks[7]) & irq_params_table[7].mask) {
1550 if (!(current_button_status &
1551 CS42L42_M_HSBIAS_HIZ_MASK)) {
1552
1553 if (current_button_status & CS42L42_M_DETECT_TF_MASK) {
1554 dev_dbg(component->dev, "Button released\n");
1555 report = 0;
1556 } else if (current_button_status & CS42L42_M_DETECT_FT_MASK) {
1557 report = cs42l42_handle_button_press(cs42l42);
1558
1559 }
1560 snd_soc_jack_report(cs42l42->jack, report, SND_JACK_BTN_0 | SND_JACK_BTN_1 |
1561 SND_JACK_BTN_2 | SND_JACK_BTN_3);
1562 }
1563 }
1564
1565 return IRQ_HANDLED;
1566 }
1567
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[jpirko-mlxsw:linecards 45/98] drivers/platform/mellanox/mlxreg-lc.c:568:2: warning: variable 'err' is used uninitialized whenever switch default is taken
by kernel test robot
tree: https://github.com/jpirko/linux_mlxsw linecards
head: 0513ef364b3f13e981a6404bbb199bc614d796b0
commit: 272ecb7cd19b08c0961aba0e6e5f0e54e13110fd [45/98] platform/mellanox: mlxreg-lc: Add initial support for Mellanox line card devices
config: x86_64-randconfig-r002-20210513 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a0fed635fe1701470062495a6ffee1c608f3f1bc)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/jpirko/linux_mlxsw/commit/272ecb7cd19b08c0961aba0e6e5f...
git remote add jpirko-mlxsw https://github.com/jpirko/linux_mlxsw
git fetch --no-tags jpirko-mlxsw linecards
git checkout 272ecb7cd19b08c0961aba0e6e5f0e54e13110fd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/platform/mellanox/mlxreg-lc.c:568:2: warning: variable 'err' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
drivers/platform/mellanox/mlxreg-lc.c:572:9: note: uninitialized use occurs here
return err;
^~~
>> drivers/platform/mellanox/mlxreg-lc.c:544:7: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (action)
^~~~~~
drivers/platform/mellanox/mlxreg-lc.c:572:9: note: uninitialized use occurs here
return err;
^~~
drivers/platform/mellanox/mlxreg-lc.c:544:3: note: remove the 'if' if its condition is always true
if (action)
^~~~~~~~~~~
drivers/platform/mellanox/mlxreg-lc.c:537:9: note: initialize the variable 'err' to silence this warning
int err;
^
= 0
2 warnings generated.
vim +/err +568 drivers/platform/mellanox/mlxreg-lc.c
529
530 /*
531 * Callback is to be called from mlxreg-hotplug driver to notify about line card about received
532 * event.
533 */
534 static int mlxreg_lc_event_handler(void *handle, enum mlxreg_hotplug_kind kind, u8 action)
535 {
536 struct mlxreg_lc *mlxreg_lc = handle;
537 int err;
538
539 switch (kind) {
540 case MLXREG_HOTPLUG_LC_VERIFIED:
541 err = mlxreg_lc_power_on_off(mlxreg_lc, action);
542 break;
543 case MLXREG_HOTPLUG_LC_POWERED:
> 544 if (action)
545 err = mlxreg_lc_create_static_devices(mlxreg_lc, mlxreg_lc->aux_devs,
546 mlxreg_lc->main_devs_num);
547 else
548 mlxreg_lc_destroy_static_devices(mlxreg_lc, mlxreg_lc->aux_devs,
549 mlxreg_lc->main_devs_num);
550 break;
551 case MLXREG_HOTPLUG_LC_SYNCED:
552 if (action)
553 mlxreg_lc->state |= MLXREG_LC_SYNCED;
554 else
555 mlxreg_lc->state &= ~MLXREG_LC_SYNCED;
556 err = mlxreg_lc_enable_disable(mlxreg_lc, mlxreg_lc->state == MLXREG_LC_ENABLE);
557 break;
558 case MLXREG_HOTPLUG_LC_READY:
559 if (action)
560 mlxreg_lc->state |= MLXREG_LC_READY;
561 else
562 mlxreg_lc->state &= ~MLXREG_LC_READY;
563 err = mlxreg_lc_enable_disable(mlxreg_lc, mlxreg_lc->state == MLXREG_LC_ENABLE);
564 break;
565 case MLXREG_HOTPLUG_LC_THERMAL:
566 err = mlxreg_lc_power_on_off(mlxreg_lc, !action);
567 break;
> 568 default:
569 break;
570 }
571
572 return err;
573 }
574
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[mark-rutland:atomics/arch-atomic 15/33] arch/arm/include/asm/sync_bitops.h:24: warning: "sync_cmpxchg" redefined
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git atomics/arch-atomic
head: 2a8926b2ab0b5a1bdc6a7139c9b011e9d4ff14fa
commit: 4e146fa6d26c7c6959f8cc7a385958d7b63f0ff0 [15/33] locking/atomic: arm: move to ARCH_ATOMIC
config: arm-randconfig-r004-20210513 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?id...
git remote add mark-rutland https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
git fetch --no-tags mark-rutland atomics/arch-atomic
git checkout 4e146fa6d26c7c6959f8cc7a385958d7b63f0ff0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/xen/grant-table.c:67:
>> arch/arm/include/asm/sync_bitops.h:24: warning: "sync_cmpxchg" redefined
24 | #define sync_cmpxchg cmpxchg
|
In file included from include/linux/atomic.h:82,
from include/asm-generic/bitops/lock.h:5,
from arch/arm/include/asm/bitops.h:243,
from include/linux/bitops.h:32,
from include/linux/kernel.h:12,
from include/asm-generic/bug.h:20,
from arch/arm/include/asm/bug.h:60,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from include/linux/memblock.h:13,
from drivers/xen/grant-table.c:36:
include/asm-generic/atomic-instrumented.h:1810: note: this is the location of the previous definition
1810 | #define sync_cmpxchg(ptr, ...) \
|
--
In file included from drivers/xen/events/events_2l.c:14:
>> arch/arm/include/asm/sync_bitops.h:24: warning: "sync_cmpxchg" redefined
24 | #define sync_cmpxchg cmpxchg
|
In file included from include/linux/atomic.h:82,
from include/asm-generic/bitops/lock.h:5,
from arch/arm/include/asm/bitops.h:243,
from include/linux/bitops.h:32,
from include/linux/kernel.h:12,
from include/linux/interrupt.h:6,
from drivers/xen/events/events_2l.c:11:
include/asm-generic/atomic-instrumented.h:1810: note: this is the location of the previous definition
1810 | #define sync_cmpxchg(ptr, ...) \
|
drivers/xen/events/events_2l.c:264:13: warning: no previous prototype for 'xen_debug_interrupt' [-Wmissing-prototypes]
264 | irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
| ^~~~~~~~~~~~~~~~~~~
vim +/sync_cmpxchg +24 arch/arm/include/asm/sync_bitops.h
e54d2f61528165 Stefano Stabellini 2012-08-08 6
e54d2f61528165 Stefano Stabellini 2012-08-08 7 /* sync_bitops functions are equivalent to the SMP implementation of the
e54d2f61528165 Stefano Stabellini 2012-08-08 8 * original functions, independently from CONFIG_SMP being defined.
e54d2f61528165 Stefano Stabellini 2012-08-08 9 *
e54d2f61528165 Stefano Stabellini 2012-08-08 10 * We need them because _set_bit etc are not SMP safe if !CONFIG_SMP. But
e54d2f61528165 Stefano Stabellini 2012-08-08 11 * under Xen you might be communicating with a completely external entity
e54d2f61528165 Stefano Stabellini 2012-08-08 12 * who might be on another CPU (e.g. two uniprocessor guests communicating
e54d2f61528165 Stefano Stabellini 2012-08-08 13 * via event channels and grant tables). So we need a variant of the bit
e54d2f61528165 Stefano Stabellini 2012-08-08 14 * ops which are SMP safe even on a UP kernel.
e54d2f61528165 Stefano Stabellini 2012-08-08 15 */
e54d2f61528165 Stefano Stabellini 2012-08-08 16
e54d2f61528165 Stefano Stabellini 2012-08-08 17 #define sync_set_bit(nr, p) _set_bit(nr, p)
e54d2f61528165 Stefano Stabellini 2012-08-08 18 #define sync_clear_bit(nr, p) _clear_bit(nr, p)
e54d2f61528165 Stefano Stabellini 2012-08-08 19 #define sync_change_bit(nr, p) _change_bit(nr, p)
e54d2f61528165 Stefano Stabellini 2012-08-08 20 #define sync_test_and_set_bit(nr, p) _test_and_set_bit(nr, p)
e54d2f61528165 Stefano Stabellini 2012-08-08 21 #define sync_test_and_clear_bit(nr, p) _test_and_clear_bit(nr, p)
e54d2f61528165 Stefano Stabellini 2012-08-08 22 #define sync_test_and_change_bit(nr, p) _test_and_change_bit(nr, p)
e54d2f61528165 Stefano Stabellini 2012-08-08 23 #define sync_test_bit(nr, addr) test_bit(nr, addr)
e54d2f61528165 Stefano Stabellini 2012-08-08 @24 #define sync_cmpxchg cmpxchg
e54d2f61528165 Stefano Stabellini 2012-08-08 25
e54d2f61528165 Stefano Stabellini 2012-08-08 26
:::::: The code at line 24 was first introduced by commit
:::::: e54d2f61528165bbe0e5f628b111eab3be31c3b5 xen/arm: sync_bitops
:::::: TO: Stefano Stabellini <stefano.stabellini(a)eu.citrix.com>
:::::: CC: Stefano Stabellini <stefano.stabellini(a)eu.citrix.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months