* drivers/pinctrl/intel/pinctrl-baytrail.c:1483:2: warning: Value stored to 'direct_irq' is never read [clang-analyzer-deadcode.DeadStores]
@ 2022-04-03 2:26 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-04-03 2:26 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 18629 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Hans de Goede <hdegoede@redhat.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: be2d3ecedd9911fbfd7e55cc9ceac5f8b79ae4cf
commit: 689e008877402564ce8a7884f21c9d2ed3ecb2dc pinctrl: baytrail: Clear direct_irq_en flag on broken configs
date: 10 weeks ago
:::::: branch date: 6 hours ago
:::::: commit date: 10 weeks ago
config: x86_64-randconfig-c007-20220328 (https://download.01.org/0day-ci/archive/20220403/202204031048.X4kpy9wQ-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
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/torvalds/linux.git/commit/?id=689e008877402564ce8a7884f21c9d2ed3ecb2dc
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 689e008877402564ce8a7884f21c9d2ed3ecb2dc
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:326:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
include/linux/list.h:37:2: note: Loop condition is false. Exiting loop
WRITE_ONCE(list->next, list);
^
include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE'
compiletime_assert_rwonce_type(x); \
^
include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type'
compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
^
include/linux/compiler_types.h:346:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:334:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:318:2: note: expanded from macro '__compiletime_assert'
do { \
^
include/linux/list.h:37:2: note: Use of memory after it is freed
WRITE_ONCE(list->next, list);
^
include/asm-generic/rwonce.h:61:2: note: expanded from macro 'WRITE_ONCE'
__WRITE_ONCE(x, val); \
^~~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:55:30: note: expanded from macro '__WRITE_ONCE'
*(volatile typeof(x) *)&(x) = (val); \
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
include/linux/list.h:137:13: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
__list_del(entry->prev, entry->next);
^
fs/btrfs/block-group.c:3895:2: note: Loop condition is true. Entering loop body
while (!list_empty(&info->caching_block_groups)) {
^
fs/btrfs/block-group.c:3899:3: note: Calling 'btrfs_put_caching_control'
btrfs_put_caching_control(caching_ctl);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/block-group.c:382:2: note: Taking true branch
if (refcount_dec_and_test(&ctl->count))
^
fs/btrfs/block-group.c:383:3: note: Memory is released
kfree(ctl);
^~~~~~~~~~
fs/btrfs/block-group.c:3899:3: note: Returning; memory was released via 1st parameter
btrfs_put_caching_control(caching_ctl);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/block-group.c:3895:2: note: Loop condition is true. Entering loop body
while (!list_empty(&info->caching_block_groups)) {
^
fs/btrfs/block-group.c:3898:3: note: Calling 'list_del'
list_del(&caching_ctl->list);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:148:2: note: Calling '__list_del_entry'
__list_del_entry(entry);
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:134:6: note: Assuming the condition is false
if (!__list_del_entry_valid(entry))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:134:2: note: Taking false branch
if (!__list_del_entry_valid(entry))
^
include/linux/list.h:137:13: note: Use of memory after it is freed
__list_del(entry->prev, entry->next);
^~~~~~~~~~~
include/linux/list.h:149:14: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
entry->next = LIST_POISON1;
^
fs/btrfs/block-group.c:3895:2: note: Loop condition is true. Entering loop body
while (!list_empty(&info->caching_block_groups)) {
^
fs/btrfs/block-group.c:3899:3: note: Calling 'btrfs_put_caching_control'
btrfs_put_caching_control(caching_ctl);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/block-group.c:382:2: note: Taking true branch
if (refcount_dec_and_test(&ctl->count))
^
fs/btrfs/block-group.c:383:3: note: Memory is released
kfree(ctl);
^~~~~~~~~~
fs/btrfs/block-group.c:3899:3: note: Returning; memory was released via 1st parameter
btrfs_put_caching_control(caching_ctl);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/btrfs/block-group.c:3895:2: note: Loop condition is true. Entering loop body
while (!list_empty(&info->caching_block_groups)) {
^
fs/btrfs/block-group.c:3898:3: note: Calling 'list_del'
list_del(&caching_ctl->list);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:149:14: note: Use of memory after it is freed
entry->next = LIST_POISON1;
~~~~~~~~~~~ ^
Suppressed 2 warnings (2 with check filters).
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
>> drivers/pinctrl/intel/pinctrl-baytrail.c:1483:2: warning: Value stored to 'direct_irq' is never read [clang-analyzer-deadcode.DeadStores]
direct_irq = match - direct_irq_mux;
^ ~~~~~~~~~~~~~~~~~~~~~~
drivers/pinctrl/intel/pinctrl-baytrail.c:1483:2: note: Value stored to 'direct_irq' is never read
direct_irq = match - direct_irq_mux;
^ ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/pinctrl/intel/pinctrl-baytrail.c:1485:2: warning: Value stored to 'ioapic_direct_irq_base' is never read [clang-analyzer-deadcode.DeadStores]
ioapic_direct_irq_base = (vg->communities->npins == BYT_NGPIO_SCORE) ? 51 : 67;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/pinctrl/intel/pinctrl-baytrail.c:1485:2: note: Value stored to 'ioapic_direct_irq_base' is never read
ioapic_direct_irq_base = (vg->communities->npins == BYT_NGPIO_SCORE) ? 51 : 67;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
drivers/pinctrl/intel/pinctrl-cherryview.c:1063:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = pctrl->dev;
^~~ ~~~~~~~~~~
drivers/pinctrl/intel/pinctrl-cherryview.c:1063:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = pctrl->dev;
^~~ ~~~~~~~~~~
drivers/pinctrl/intel/pinctrl-cherryview.c:1307:18: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = pctrl->dev;
^~~ ~~~~~~~~~~
drivers/pinctrl/intel/pinctrl-cherryview.c:1307:18: note: Value stored to 'dev' during its initialization is never read
struct device *dev = pctrl->dev;
^~~ ~~~~~~~~~~
2 warnings generated.
arch/x86/kernel/kvm.c:339:7: warning: Value stored to 'pa' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason));
^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/kernel/kvm.c:339:7: note: Value stored to 'pa' during its initialization is never read
u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason));
^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
drivers/regulator/ltc3676.c:76:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = ltc3676->dev;
^~~ ~~~~~~~~~~~~
drivers/regulator/ltc3676.c:76:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = ltc3676->dev;
^~~ ~~~~~~~~~~~~
drivers/regulator/ltc3676.c:77:6: warning: Value stored to 'dcdc' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
int dcdc = rdev_get_id(rdev);
^~~~ ~~~~~~~~~~~~~~~~~
drivers/regulator/ltc3676.c:77:6: note: Value stored to 'dcdc' during its initialization is never read
int dcdc = rdev_get_id(rdev);
^~~~ ~~~~~~~~~~~~~~~~~
drivers/regulator/ltc3676.c:94:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = ltc3676->dev;
^~~ ~~~~~~~~~~~~
drivers/regulator/ltc3676.c:94:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = ltc3676->dev;
^~~ ~~~~~~~~~~~~
drivers/regulator/ltc3676.c:96:6: warning: Value stored to 'dcdc' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
int dcdc = rdev_get_id(rdev);
^~~~ ~~~~~~~~~~~~~~~~~
drivers/regulator/ltc3676.c:96:6: note: Value stored to 'dcdc' during its initialization is never read
int dcdc = rdev_get_id(rdev);
^~~~ ~~~~~~~~~~~~~~~~~
drivers/regulator/ltc3676.c:121:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = ltc3676->dev;
^~~ ~~~~~~~~~~~~
drivers/regulator/ltc3676.c:121:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = ltc3676->dev;
^~~ ~~~~~~~~~~~~
drivers/regulator/ltc3676.c:122:11: warning: Value stored to 'dcdc' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
int ret, dcdc = rdev_get_id(rdev);
^~~~ ~~~~~~~~~~~~~~~~~
drivers/regulator/ltc3676.c:122:11: note: Value stored to 'dcdc' during its initialization is never read
int ret, dcdc = rdev_get_id(rdev);
^~~~ ~~~~~~~~~~~~~~~~~
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning generated.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
drivers/mfd/twl-core.c:1205:8: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]
temp &= ~(SR_I2C_SDA_CTRL_PU | SR_I2C_SCL_CTRL_PU | \
~~~~ ^
drivers/mfd/twl-core.c:1078:6: note: Assuming 'node' is non-null
if (!node && !pdata) {
^~~~~
drivers/mfd/twl-core.c:1078:12: note: Left side of '&&' is false
if (!node && !pdata) {
^
drivers/mfd/twl-core.c:1083:6: note: Assuming 'twl_priv' is null
if (twl_priv) {
^~~~~~~~
drivers/mfd/twl-core.c:1083:2: note: Taking false branch
if (twl_priv) {
^
drivers/mfd/twl-core.c:1090:6: note: Assuming 'pdev' is non-null
if (!pdev) {
^~~~~
drivers/mfd/twl-core.c:1090:2: note: Taking false branch
if (!pdev) {
^
drivers/mfd/twl-core.c:1096:6: note: Assuming 'status' is 0
if (status) {
^~~~~~
drivers/mfd/twl-core.c:1096:2: note: Taking false branch
if (status) {
^
drivers/mfd/twl-core.c:1101:2: note: Taking false branch
if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) {
vim +/direct_irq +1483 drivers/pinctrl/intel/pinctrl-baytrail.c
71e6ca61e82667 Cristina Ciocan 2016-04-01 1468
689e0088774025 Hans de Goede 2022-01-12 1469 static bool byt_direct_irq_sanity_check(struct intel_pinctrl *vg, int pin, u32 conf0)
689e0088774025 Hans de Goede 2022-01-12 1470 {
689e0088774025 Hans de Goede 2022-01-12 1471 int direct_irq, ioapic_direct_irq_base;
689e0088774025 Hans de Goede 2022-01-12 1472 u8 *match, direct_irq_mux[16];
689e0088774025 Hans de Goede 2022-01-12 1473 u32 trig;
689e0088774025 Hans de Goede 2022-01-12 1474
689e0088774025 Hans de Goede 2022-01-12 1475 memcpy_fromio(direct_irq_mux, vg->communities->pad_regs + BYT_DIRECT_IRQ_REG,
689e0088774025 Hans de Goede 2022-01-12 1476 sizeof(direct_irq_mux));
689e0088774025 Hans de Goede 2022-01-12 1477 match = memchr(direct_irq_mux, pin, sizeof(direct_irq_mux));
689e0088774025 Hans de Goede 2022-01-12 1478 if (!match) {
689e0088774025 Hans de Goede 2022-01-12 1479 dev_warn(vg->dev, FW_BUG "pin %i: direct_irq_en set but no IRQ assigned, clearing\n", pin);
689e0088774025 Hans de Goede 2022-01-12 1480 return false;
689e0088774025 Hans de Goede 2022-01-12 1481 }
689e0088774025 Hans de Goede 2022-01-12 1482
689e0088774025 Hans de Goede 2022-01-12 @1483 direct_irq = match - direct_irq_mux;
689e0088774025 Hans de Goede 2022-01-12 1484 /* Base IO-APIC pin numbers come from atom-e3800-family-datasheet.pdf */
689e0088774025 Hans de Goede 2022-01-12 @1485 ioapic_direct_irq_base = (vg->communities->npins == BYT_NGPIO_SCORE) ? 51 : 67;
689e0088774025 Hans de Goede 2022-01-12 1486 dev_dbg(vg->dev, "Pin %i: uses direct IRQ %d (IO-APIC %d)\n", pin,
689e0088774025 Hans de Goede 2022-01-12 1487 direct_irq, direct_irq + ioapic_direct_irq_base);
689e0088774025 Hans de Goede 2022-01-12 1488
689e0088774025 Hans de Goede 2022-01-12 1489 /*
689e0088774025 Hans de Goede 2022-01-12 1490 * Testing has shown that the way direct IRQs work is that the combination of the
689e0088774025 Hans de Goede 2022-01-12 1491 * direct-irq-en flag and the direct IRQ mux connect the output of the GPIO's IRQ
689e0088774025 Hans de Goede 2022-01-12 1492 * trigger block, which normally sets the status flag in the IRQ status reg at
689e0088774025 Hans de Goede 2022-01-12 1493 * 0x800, to one of the IO-APIC pins according to the mux registers.
689e0088774025 Hans de Goede 2022-01-12 1494 *
689e0088774025 Hans de Goede 2022-01-12 1495 * This means that:
689e0088774025 Hans de Goede 2022-01-12 1496 * 1. The TRIG_MASK bits must be set to configure the GPIO's IRQ trigger block
689e0088774025 Hans de Goede 2022-01-12 1497 * 2. The TRIG_LVL bit *must* be set, so that the GPIO's input value is directly
689e0088774025 Hans de Goede 2022-01-12 1498 * passed (1:1 or inverted) to the IO-APIC pin, if TRIG_LVL is not set,
689e0088774025 Hans de Goede 2022-01-12 1499 * selecting edge mode operation then on the first edge the IO-APIC pin goes
689e0088774025 Hans de Goede 2022-01-12 1500 * high, but since no write-to-clear write will be done to the IRQ status reg
689e0088774025 Hans de Goede 2022-01-12 1501 * at 0x800, the detected edge condition will never get cleared.
689e0088774025 Hans de Goede 2022-01-12 1502 */
689e0088774025 Hans de Goede 2022-01-12 1503 trig = conf0 & BYT_TRIG_MASK;
689e0088774025 Hans de Goede 2022-01-12 1504 if (trig != (BYT_TRIG_POS | BYT_TRIG_LVL) &&
689e0088774025 Hans de Goede 2022-01-12 1505 trig != (BYT_TRIG_NEG | BYT_TRIG_LVL)) {
689e0088774025 Hans de Goede 2022-01-12 1506 dev_warn(vg->dev, FW_BUG "pin %i: direct_irq_en set without trigger (conf0: %xh), clearing\n",
689e0088774025 Hans de Goede 2022-01-12 1507 pin, conf0);
689e0088774025 Hans de Goede 2022-01-12 1508 return false;
689e0088774025 Hans de Goede 2022-01-12 1509 }
689e0088774025 Hans de Goede 2022-01-12 1510
689e0088774025 Hans de Goede 2022-01-12 1511 return true;
689e0088774025 Hans de Goede 2022-01-12 1512 }
689e0088774025 Hans de Goede 2022-01-12 1513
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-03 2:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 2:26 drivers/pinctrl/intel/pinctrl-baytrail.c:1483:2: warning: Value stored to 'direct_irq' is never read [clang-analyzer-deadcode.DeadStores] kernel test robot
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.