[linux-next:master 2767/4301] drivers/net/dsa/qca8k.c:2315:44: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Ansuel Smith <ansuelsmth(a)gmail.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 34f255a1e91ab44ff8926cf8294ff9144e62e861
commit: def975307c01191b6f0170048c3724b0ed3348af [2767/4301] net: dsa: qca8k: add LAG support
:::::: branch date: 15 hours ago
:::::: commit date: 7 days ago
compiler: mipsel-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> drivers/net/dsa/qca8k.c:2315:44: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
!val << QCA8K_REG_GOL_TRUNK_SHIFT(id) |
^
drivers/net/dsa/qca8k.c:2353:61: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
!delete << QCA8K_REG_GOL_TRUNK_ID_MEM_ID_SHIFT(id, i) |
^
>> drivers/net/dsa/qca8k.c:693:52: warning: Uninitialized variable: val [uninitvar]
ret = read_poll_timeout(qca8k_mii_read32, ret1, !(val & mask), 0,
^
>> drivers/net/usb/lan78xx.c:4752:3: warning: Variable 'mask_index' is modified but its new value is never used. [unreadVariable]
mask_index++;
^
vim +2315 drivers/net/dsa/qca8k.c
def975307c0119 Ansuel Smith 2021-11-23 2287
def975307c0119 Ansuel Smith 2021-11-23 2288 static int
def975307c0119 Ansuel Smith 2021-11-23 2289 qca8k_lag_refresh_portmap(struct dsa_switch *ds, int port,
def975307c0119 Ansuel Smith 2021-11-23 2290 struct net_device *lag, bool delete)
def975307c0119 Ansuel Smith 2021-11-23 2291 {
def975307c0119 Ansuel Smith 2021-11-23 2292 struct qca8k_priv *priv = ds->priv;
def975307c0119 Ansuel Smith 2021-11-23 2293 int ret, id, i;
def975307c0119 Ansuel Smith 2021-11-23 2294 u32 val;
def975307c0119 Ansuel Smith 2021-11-23 2295
def975307c0119 Ansuel Smith 2021-11-23 2296 id = dsa_lag_id(ds->dst, lag);
def975307c0119 Ansuel Smith 2021-11-23 2297
def975307c0119 Ansuel Smith 2021-11-23 2298 /* Read current port member */
def975307c0119 Ansuel Smith 2021-11-23 2299 ret = regmap_read(priv->regmap, QCA8K_REG_GOL_TRUNK_CTRL0, &val);
def975307c0119 Ansuel Smith 2021-11-23 2300 if (ret)
def975307c0119 Ansuel Smith 2021-11-23 2301 return ret;
def975307c0119 Ansuel Smith 2021-11-23 2302
def975307c0119 Ansuel Smith 2021-11-23 2303 /* Shift val to the correct trunk */
def975307c0119 Ansuel Smith 2021-11-23 2304 val >>= QCA8K_REG_GOL_TRUNK_SHIFT(id);
def975307c0119 Ansuel Smith 2021-11-23 2305 val &= QCA8K_REG_GOL_TRUNK_MEMBER_MASK;
def975307c0119 Ansuel Smith 2021-11-23 2306 if (delete)
def975307c0119 Ansuel Smith 2021-11-23 2307 val &= ~BIT(port);
def975307c0119 Ansuel Smith 2021-11-23 2308 else
def975307c0119 Ansuel Smith 2021-11-23 2309 val |= BIT(port);
def975307c0119 Ansuel Smith 2021-11-23 2310
def975307c0119 Ansuel Smith 2021-11-23 2311 /* Update port member. With empty portmap disable trunk */
def975307c0119 Ansuel Smith 2021-11-23 2312 ret = regmap_update_bits(priv->regmap, QCA8K_REG_GOL_TRUNK_CTRL0,
def975307c0119 Ansuel Smith 2021-11-23 2313 QCA8K_REG_GOL_TRUNK_MEMBER(id) |
def975307c0119 Ansuel Smith 2021-11-23 2314 QCA8K_REG_GOL_TRUNK_EN(id),
def975307c0119 Ansuel Smith 2021-11-23 @2315 !val << QCA8K_REG_GOL_TRUNK_SHIFT(id) |
def975307c0119 Ansuel Smith 2021-11-23 2316 val << QCA8K_REG_GOL_TRUNK_SHIFT(id));
def975307c0119 Ansuel Smith 2021-11-23 2317
def975307c0119 Ansuel Smith 2021-11-23 2318 /* Search empty member if adding or port on deleting */
def975307c0119 Ansuel Smith 2021-11-23 2319 for (i = 0; i < QCA8K_NUM_PORTS_FOR_LAG; i++) {
def975307c0119 Ansuel Smith 2021-11-23 2320 ret = regmap_read(priv->regmap, QCA8K_REG_GOL_TRUNK_CTRL(id), &val);
def975307c0119 Ansuel Smith 2021-11-23 2321 if (ret)
def975307c0119 Ansuel Smith 2021-11-23 2322 return ret;
def975307c0119 Ansuel Smith 2021-11-23 2323
def975307c0119 Ansuel Smith 2021-11-23 2324 val >>= QCA8K_REG_GOL_TRUNK_ID_MEM_ID_SHIFT(id, i);
def975307c0119 Ansuel Smith 2021-11-23 2325 val &= QCA8K_REG_GOL_TRUNK_ID_MEM_ID_MASK;
def975307c0119 Ansuel Smith 2021-11-23 2326
def975307c0119 Ansuel Smith 2021-11-23 2327 if (delete) {
def975307c0119 Ansuel Smith 2021-11-23 2328 /* If port flagged to be disabled assume this member is
def975307c0119 Ansuel Smith 2021-11-23 2329 * empty
def975307c0119 Ansuel Smith 2021-11-23 2330 */
def975307c0119 Ansuel Smith 2021-11-23 2331 if (val != QCA8K_REG_GOL_TRUNK_ID_MEM_ID_EN_MASK)
def975307c0119 Ansuel Smith 2021-11-23 2332 continue;
def975307c0119 Ansuel Smith 2021-11-23 2333
def975307c0119 Ansuel Smith 2021-11-23 2334 val &= QCA8K_REG_GOL_TRUNK_ID_MEM_ID_PORT_MASK;
def975307c0119 Ansuel Smith 2021-11-23 2335 if (val != port)
def975307c0119 Ansuel Smith 2021-11-23 2336 continue;
def975307c0119 Ansuel Smith 2021-11-23 2337 } else {
def975307c0119 Ansuel Smith 2021-11-23 2338 /* If port flagged to be enabled assume this member is
def975307c0119 Ansuel Smith 2021-11-23 2339 * already set
def975307c0119 Ansuel Smith 2021-11-23 2340 */
def975307c0119 Ansuel Smith 2021-11-23 2341 if (val == QCA8K_REG_GOL_TRUNK_ID_MEM_ID_EN_MASK)
def975307c0119 Ansuel Smith 2021-11-23 2342 continue;
def975307c0119 Ansuel Smith 2021-11-23 2343 }
def975307c0119 Ansuel Smith 2021-11-23 2344
def975307c0119 Ansuel Smith 2021-11-23 2345 /* We have found the member to add/remove */
def975307c0119 Ansuel Smith 2021-11-23 2346 break;
def975307c0119 Ansuel Smith 2021-11-23 2347 }
def975307c0119 Ansuel Smith 2021-11-23 2348
def975307c0119 Ansuel Smith 2021-11-23 2349 /* Set port in the correct port mask or disable port if in delete mode */
def975307c0119 Ansuel Smith 2021-11-23 2350 return regmap_update_bits(priv->regmap, QCA8K_REG_GOL_TRUNK_CTRL(id),
def975307c0119 Ansuel Smith 2021-11-23 2351 QCA8K_REG_GOL_TRUNK_ID_MEM_ID_EN(id, i) |
def975307c0119 Ansuel Smith 2021-11-23 2352 QCA8K_REG_GOL_TRUNK_ID_MEM_ID_PORT(id, i),
def975307c0119 Ansuel Smith 2021-11-23 2353 !delete << QCA8K_REG_GOL_TRUNK_ID_MEM_ID_SHIFT(id, i) |
def975307c0119 Ansuel Smith 2021-11-23 2354 port << QCA8K_REG_GOL_TRUNK_ID_MEM_ID_SHIFT(id, i));
def975307c0119 Ansuel Smith 2021-11-23 2355 }
def975307c0119 Ansuel Smith 2021-11-23 2356
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 4 weeks
[linux-next:master 1368/4301] net/core/gro.c:493:5-12: ERROR: PTR_ERR applied after initialization to constant on line 441
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Eric Dumazet <edumazet(a)google.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 34f255a1e91ab44ff8926cf8294ff9144e62e861
commit: 587652bbdd06ab38a4c1b85e40f933d2cf4a1147 [1368/4301] net: gro: populate net/core/gro.c
:::::: branch date: 15 hours ago
:::::: commit date: 2 weeks ago
config: x86_64-randconfig-c002-20211128 (https://download.01.org/0day-ci/archive/20211201/202112010622.NE8tV8Jc-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> net/core/gro.c:493:5-12: ERROR: PTR_ERR applied after initialization to constant on line 441
vim +493 net/core/gro.c
587652bbdd06ab3 Eric Dumazet 2021-11-15 433
587652bbdd06ab3 Eric Dumazet 2021-11-15 434 static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
587652bbdd06ab3 Eric Dumazet 2021-11-15 435 {
587652bbdd06ab3 Eric Dumazet 2021-11-15 436 u32 bucket = skb_get_hash_raw(skb) & (GRO_HASH_BUCKETS - 1);
587652bbdd06ab3 Eric Dumazet 2021-11-15 437 struct gro_list *gro_list = &napi->gro_hash[bucket];
587652bbdd06ab3 Eric Dumazet 2021-11-15 438 struct list_head *head = &offload_base;
587652bbdd06ab3 Eric Dumazet 2021-11-15 439 struct packet_offload *ptype;
587652bbdd06ab3 Eric Dumazet 2021-11-15 440 __be16 type = skb->protocol;
587652bbdd06ab3 Eric Dumazet 2021-11-15 @441 struct sk_buff *pp = NULL;
587652bbdd06ab3 Eric Dumazet 2021-11-15 442 enum gro_result ret;
587652bbdd06ab3 Eric Dumazet 2021-11-15 443 int same_flow;
587652bbdd06ab3 Eric Dumazet 2021-11-15 444 int grow;
587652bbdd06ab3 Eric Dumazet 2021-11-15 445
587652bbdd06ab3 Eric Dumazet 2021-11-15 446 if (netif_elide_gro(skb->dev))
587652bbdd06ab3 Eric Dumazet 2021-11-15 447 goto normal;
587652bbdd06ab3 Eric Dumazet 2021-11-15 448
587652bbdd06ab3 Eric Dumazet 2021-11-15 449 gro_list_prepare(&gro_list->list, skb);
587652bbdd06ab3 Eric Dumazet 2021-11-15 450
587652bbdd06ab3 Eric Dumazet 2021-11-15 451 rcu_read_lock();
587652bbdd06ab3 Eric Dumazet 2021-11-15 452 list_for_each_entry_rcu(ptype, head, list) {
587652bbdd06ab3 Eric Dumazet 2021-11-15 453 if (ptype->type != type || !ptype->callbacks.gro_receive)
587652bbdd06ab3 Eric Dumazet 2021-11-15 454 continue;
587652bbdd06ab3 Eric Dumazet 2021-11-15 455
587652bbdd06ab3 Eric Dumazet 2021-11-15 456 skb_set_network_header(skb, skb_gro_offset(skb));
587652bbdd06ab3 Eric Dumazet 2021-11-15 457 skb_reset_mac_len(skb);
587652bbdd06ab3 Eric Dumazet 2021-11-15 458 NAPI_GRO_CB(skb)->same_flow = 0;
587652bbdd06ab3 Eric Dumazet 2021-11-15 459 NAPI_GRO_CB(skb)->flush = skb_is_gso(skb) || skb_has_frag_list(skb);
587652bbdd06ab3 Eric Dumazet 2021-11-15 460 NAPI_GRO_CB(skb)->free = 0;
587652bbdd06ab3 Eric Dumazet 2021-11-15 461 NAPI_GRO_CB(skb)->encap_mark = 0;
587652bbdd06ab3 Eric Dumazet 2021-11-15 462 NAPI_GRO_CB(skb)->recursion_counter = 0;
587652bbdd06ab3 Eric Dumazet 2021-11-15 463 NAPI_GRO_CB(skb)->is_fou = 0;
587652bbdd06ab3 Eric Dumazet 2021-11-15 464 NAPI_GRO_CB(skb)->is_atomic = 1;
587652bbdd06ab3 Eric Dumazet 2021-11-15 465 NAPI_GRO_CB(skb)->gro_remcsum_start = 0;
587652bbdd06ab3 Eric Dumazet 2021-11-15 466
587652bbdd06ab3 Eric Dumazet 2021-11-15 467 /* Setup for GRO checksum validation */
587652bbdd06ab3 Eric Dumazet 2021-11-15 468 switch (skb->ip_summed) {
587652bbdd06ab3 Eric Dumazet 2021-11-15 469 case CHECKSUM_COMPLETE:
587652bbdd06ab3 Eric Dumazet 2021-11-15 470 NAPI_GRO_CB(skb)->csum = skb->csum;
587652bbdd06ab3 Eric Dumazet 2021-11-15 471 NAPI_GRO_CB(skb)->csum_valid = 1;
587652bbdd06ab3 Eric Dumazet 2021-11-15 472 NAPI_GRO_CB(skb)->csum_cnt = 0;
587652bbdd06ab3 Eric Dumazet 2021-11-15 473 break;
587652bbdd06ab3 Eric Dumazet 2021-11-15 474 case CHECKSUM_UNNECESSARY:
587652bbdd06ab3 Eric Dumazet 2021-11-15 475 NAPI_GRO_CB(skb)->csum_cnt = skb->csum_level + 1;
587652bbdd06ab3 Eric Dumazet 2021-11-15 476 NAPI_GRO_CB(skb)->csum_valid = 0;
587652bbdd06ab3 Eric Dumazet 2021-11-15 477 break;
587652bbdd06ab3 Eric Dumazet 2021-11-15 478 default:
587652bbdd06ab3 Eric Dumazet 2021-11-15 479 NAPI_GRO_CB(skb)->csum_cnt = 0;
587652bbdd06ab3 Eric Dumazet 2021-11-15 480 NAPI_GRO_CB(skb)->csum_valid = 0;
587652bbdd06ab3 Eric Dumazet 2021-11-15 481 }
587652bbdd06ab3 Eric Dumazet 2021-11-15 482
587652bbdd06ab3 Eric Dumazet 2021-11-15 483 pp = INDIRECT_CALL_INET(ptype->callbacks.gro_receive,
587652bbdd06ab3 Eric Dumazet 2021-11-15 484 ipv6_gro_receive, inet_gro_receive,
587652bbdd06ab3 Eric Dumazet 2021-11-15 485 &gro_list->list, skb);
587652bbdd06ab3 Eric Dumazet 2021-11-15 486 break;
587652bbdd06ab3 Eric Dumazet 2021-11-15 487 }
587652bbdd06ab3 Eric Dumazet 2021-11-15 488 rcu_read_unlock();
587652bbdd06ab3 Eric Dumazet 2021-11-15 489
587652bbdd06ab3 Eric Dumazet 2021-11-15 490 if (&ptype->list == head)
587652bbdd06ab3 Eric Dumazet 2021-11-15 491 goto normal;
587652bbdd06ab3 Eric Dumazet 2021-11-15 492
587652bbdd06ab3 Eric Dumazet 2021-11-15 @493 if (PTR_ERR(pp) == -EINPROGRESS) {
587652bbdd06ab3 Eric Dumazet 2021-11-15 494 ret = GRO_CONSUMED;
587652bbdd06ab3 Eric Dumazet 2021-11-15 495 goto ok;
587652bbdd06ab3 Eric Dumazet 2021-11-15 496 }
587652bbdd06ab3 Eric Dumazet 2021-11-15 497
587652bbdd06ab3 Eric Dumazet 2021-11-15 498 same_flow = NAPI_GRO_CB(skb)->same_flow;
587652bbdd06ab3 Eric Dumazet 2021-11-15 499 ret = NAPI_GRO_CB(skb)->free ? GRO_MERGED_FREE : GRO_MERGED;
587652bbdd06ab3 Eric Dumazet 2021-11-15 500
587652bbdd06ab3 Eric Dumazet 2021-11-15 501 if (pp) {
587652bbdd06ab3 Eric Dumazet 2021-11-15 502 skb_list_del_init(pp);
587652bbdd06ab3 Eric Dumazet 2021-11-15 503 napi_gro_complete(napi, pp);
587652bbdd06ab3 Eric Dumazet 2021-11-15 504 gro_list->count--;
587652bbdd06ab3 Eric Dumazet 2021-11-15 505 }
587652bbdd06ab3 Eric Dumazet 2021-11-15 506
587652bbdd06ab3 Eric Dumazet 2021-11-15 507 if (same_flow)
587652bbdd06ab3 Eric Dumazet 2021-11-15 508 goto ok;
587652bbdd06ab3 Eric Dumazet 2021-11-15 509
587652bbdd06ab3 Eric Dumazet 2021-11-15 510 if (NAPI_GRO_CB(skb)->flush)
587652bbdd06ab3 Eric Dumazet 2021-11-15 511 goto normal;
587652bbdd06ab3 Eric Dumazet 2021-11-15 512
587652bbdd06ab3 Eric Dumazet 2021-11-15 513 if (unlikely(gro_list->count >= MAX_GRO_SKBS))
587652bbdd06ab3 Eric Dumazet 2021-11-15 514 gro_flush_oldest(napi, &gro_list->list);
587652bbdd06ab3 Eric Dumazet 2021-11-15 515 else
587652bbdd06ab3 Eric Dumazet 2021-11-15 516 gro_list->count++;
587652bbdd06ab3 Eric Dumazet 2021-11-15 517
587652bbdd06ab3 Eric Dumazet 2021-11-15 518 NAPI_GRO_CB(skb)->count = 1;
587652bbdd06ab3 Eric Dumazet 2021-11-15 519 NAPI_GRO_CB(skb)->age = jiffies;
587652bbdd06ab3 Eric Dumazet 2021-11-15 520 NAPI_GRO_CB(skb)->last = skb;
587652bbdd06ab3 Eric Dumazet 2021-11-15 521 skb_shinfo(skb)->gso_size = skb_gro_len(skb);
587652bbdd06ab3 Eric Dumazet 2021-11-15 522 list_add(&skb->list, &gro_list->list);
587652bbdd06ab3 Eric Dumazet 2021-11-15 523 ret = GRO_HELD;
587652bbdd06ab3 Eric Dumazet 2021-11-15 524
587652bbdd06ab3 Eric Dumazet 2021-11-15 525 pull:
587652bbdd06ab3 Eric Dumazet 2021-11-15 526 grow = skb_gro_offset(skb) - skb_headlen(skb);
587652bbdd06ab3 Eric Dumazet 2021-11-15 527 if (grow > 0)
587652bbdd06ab3 Eric Dumazet 2021-11-15 528 gro_pull_from_frag0(skb, grow);
587652bbdd06ab3 Eric Dumazet 2021-11-15 529 ok:
587652bbdd06ab3 Eric Dumazet 2021-11-15 530 if (gro_list->count) {
587652bbdd06ab3 Eric Dumazet 2021-11-15 531 if (!test_bit(bucket, &napi->gro_bitmask))
587652bbdd06ab3 Eric Dumazet 2021-11-15 532 __set_bit(bucket, &napi->gro_bitmask);
587652bbdd06ab3 Eric Dumazet 2021-11-15 533 } else if (test_bit(bucket, &napi->gro_bitmask)) {
587652bbdd06ab3 Eric Dumazet 2021-11-15 534 __clear_bit(bucket, &napi->gro_bitmask);
587652bbdd06ab3 Eric Dumazet 2021-11-15 535 }
587652bbdd06ab3 Eric Dumazet 2021-11-15 536
587652bbdd06ab3 Eric Dumazet 2021-11-15 537 return ret;
587652bbdd06ab3 Eric Dumazet 2021-11-15 538
587652bbdd06ab3 Eric Dumazet 2021-11-15 539 normal:
587652bbdd06ab3 Eric Dumazet 2021-11-15 540 ret = GRO_NORMAL;
587652bbdd06ab3 Eric Dumazet 2021-11-15 541 goto pull;
587652bbdd06ab3 Eric Dumazet 2021-11-15 542 }
587652bbdd06ab3 Eric Dumazet 2021-11-15 543
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 4 weeks
Re: [RFC][PATCH v6 1/5] trace: Add trace any kernel object
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20211129164951.220511-2-xiehuan09(a)gmail.com>
References: <20211129164951.220511-2-xiehuan09(a)gmail.com>
TO: Jeff Xie <xiehuan09(a)gmail.com>
Hi Jeff,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on rostedt-trace/for-next]
[also build test WARNING on linux/master linus/master v5.16-rc3 next-20211130]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Jeff-Xie/trace-Introduce-objtrac...
base: https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git for-next
:::::: branch date: 23 hours ago
:::::: commit date: 23 hours ago
config: x86_64-randconfig-c007-20211128 (https://download.01.org/0day-ci/archive/20211201/202112010332.H8xSohUr-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 25eb7fa01d7ebbe67648ea03841cda55b4239ab2)
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/0day-ci/linux/commit/88ea43d691b0980bf49b4e579c39303cf...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jeff-Xie/trace-Introduce-objtrace-trigger-to-trace-the-kernel-object/20211130-041958
git checkout 88ea43d691b0980bf49b4e579c39303cf3c9cd72
# 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(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
if (function != ACPI_READ && function != ACPI_WRITE)
^~~~~~~~~~~~~~~~~~~~~
drivers/acpi/ec.c:1283:6: note: Left side of '&&' is true
drivers/acpi/ec.c:1283:31: note: Assuming 'function' is equal to ACPI_WRITE
if (function != ACPI_READ && function != ACPI_WRITE)
^~~~~~~~~~~~~~~~~~~~~~
drivers/acpi/ec.c:1283:2: note: Taking false branch
if (function != ACPI_READ && function != ACPI_WRITE)
^
drivers/acpi/ec.c:1286:6: note: Assuming field 'busy_polling' is true
if (ec->busy_polling || bits > 8)
^~~~~~~~~~~~~~~~
drivers/acpi/ec.c:1286:23: note: Left side of '||' is true
if (ec->busy_polling || bits > 8)
^
drivers/acpi/ec.c:1289:14: note: Assuming 'i' is < 'bytes'
for (i = 0; i < bytes; ++i, ++address, ++value)
^~~~~~~~~
drivers/acpi/ec.c:1289:2: note: Loop condition is true. Entering loop body
for (i = 0; i < bytes; ++i, ++address, ++value)
^
drivers/acpi/ec.c:1290:13: note: 'function' is not equal to ACPI_READ
result = (function == ACPI_READ) ?
^~~~~~~~
drivers/acpi/ec.c:1290:12: note: '?' condition is false
result = (function == ACPI_READ) ?
^
drivers/acpi/ec.c:1292:4: note: Calling 'acpi_ec_write'
acpi_ec_write(ec, address, *value);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/acpi/ec.c:872:9: note: Calling 'acpi_ec_transaction'
return acpi_ec_transaction(ec, &t);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/acpi/ec.c:807:2: note: 'glk' declared without an initial value
u32 glk;
^~~~~~~
drivers/acpi/ec.c:809:7: note: 'ec' is non-null
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
^~
drivers/acpi/ec.c:809:6: note: Left side of '||' is false
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
^
drivers/acpi/ec.c:809:15: note: 't' is non-null
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
^
drivers/acpi/ec.c:809:6: note: Left side of '||' is false
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
^
drivers/acpi/ec.c:809:25: note: Field 'wlen' is 2
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
^
drivers/acpi/ec.c:809:22: note: Left side of '&&' is true
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
^
drivers/acpi/ec.c:809:37: note: Field 'wdata' is non-null
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
^
drivers/acpi/ec.c:809:6: note: Left side of '||' is false
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
^
drivers/acpi/ec.c:809:51: note: Field 'rlen' is 0
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
^
drivers/acpi/ec.c:809:56: note: Left side of '&&' is false
if (!ec || (!t) || (t->wlen && !t->wdata) || (t->rlen && !t->rdata))
^
drivers/acpi/ec.c:811:9: note: Field 'rdata' is null
if (t->rdata)
^
drivers/acpi/ec.c:811:2: note: Taking false branch
if (t->rdata)
^
drivers/acpi/ec.c:815:6: note: Assuming field 'global_lock' is false
if (ec->global_lock) {
^~~~~~~~~~~~~~~
drivers/acpi/ec.c:815:2: note: Taking false branch
if (ec->global_lock) {
^
drivers/acpi/ec.c:825:6: note: Assuming field 'global_lock' is true
if (ec->global_lock)
^~~~~~~~~~~~~~~
drivers/acpi/ec.c:825:2: note: Taking true branch
if (ec->global_lock)
^
drivers/acpi/ec.c:826:3: note: 1st function call argument is an uninitialized value
acpi_release_global_lock(glk);
^ ~~~
drivers/acpi/ec.c:1576:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
^~~~~~
drivers/acpi/ec.c:1576:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
^~~~~~
drivers/acpi/ec.c:1577:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcpy(acpi_device_class(device), ACPI_EC_CLASS);
^~~~~~
drivers/acpi/ec.c:1577:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
strcpy(acpi_device_class(device), ACPI_EC_CLASS);
^~~~~~
3 warnings generated.
>> kernel/trace/trace_object.c:99:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
list_for_each_entry_rcu(inst, head, active_list)
^
include/linux/rculist.h:393:9: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
^
include/linux/rculist.h:307:15: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
include/asm-generic/rwonce.h:50:2: note: expanded from macro 'READ_ONCE'
__READ_ONCE(x); \
^
include/asm-generic/rwonce.h:44:24: note: expanded from macro '__READ_ONCE'
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
^
kernel/trace/trace_object.c:298:2: note: Assuming 'debug_locks' is 0
lockdep_assert_held(&event_mutex);
^
include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/lockdep.h:310:15: note: expanded from macro 'lockdep_assert'
do { WARN_ON(debug_locks && !(cond)); } while (0)
^~~~~~~~~~~
include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
kernel/trace/trace_object.c:298:2: note: Left side of '&&' is false
lockdep_assert_held(&event_mutex);
^
include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
^
include/linux/lockdep.h:310:27: note: expanded from macro 'lockdep_assert'
do { WARN_ON(debug_locks && !(cond)); } while (0)
^
kernel/trace/trace_object.c:298:2: note: Taking false branch
lockdep_assert_held(&event_mutex);
^
include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
^
include/linux/lockdep.h:310:7: note: expanded from macro 'lockdep_assert'
do { WARN_ON(debug_locks && !(cond)); } while (0)
^
include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
if (unlikely(__ret_warn_on)) \
^
kernel/trace/trace_object.c:298:2: note: Loop condition is false. Exiting loop
lockdep_assert_held(&event_mutex);
^
include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
^
include/linux/lockdep.h:310:2: note: expanded from macro 'lockdep_assert'
do { WARN_ON(debug_locks && !(cond)); } while (0)
^
kernel/trace/trace_object.c:300:2: note: Loop condition is false. Execution continues on line 307
list_for_each_entry(test, &file->triggers, list) {
^
include/linux/list.h:630:2: note: expanded from macro 'list_for_each_entry'
for (pos = list_first_entry(head, typeof(*pos), member); \
^
kernel/trace/trace_object.c:307:6: note: Assuming field 'init' is null
if (data->ops->init) {
^~~~~~~~~~~~~~~
kernel/trace/trace_object.c:307:2: note: Taking false branch
if (data->ops->init) {
^
kernel/trace/trace_object.c:317:6: note: Assuming the condition is false
if (trace_event_trigger_enable_disable(file, 1) < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/trace/trace_object.c:317:2: note: Taking false branch
if (trace_event_trigger_enable_disable(file, 1) < 0) {
^
kernel/trace/trace_object.c:322:2: note: Calling 'init_trace_object'
init_trace_object();
^~~~~~~~~~~~~~~~~~~
kernel/trace/trace_object.c:495:6: note: Assuming the condition is false
if (atomic_inc_return(&trace_object_ref) != 1) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/trace/trace_object.c:495:2: note: Taking false branch
if (atomic_inc_return(&trace_object_ref) != 1) {
^
kernel/trace/trace_object.c:500:8: note: Calling 'init_object_pool'
ret = init_object_pool();
^~~~~~~~~~~~~~~~~~
kernel/trace/trace_object.c:117:6: note: Assuming 'obj_pool' is non-null
if (!obj_pool) {
^~~~~~~~~
kernel/trace/trace_object.c:117:2: note: Taking false branch
if (!obj_pool) {
^
kernel/trace/trace_object.c:124:2: note: Loop condition is true. Entering loop body
for (i = 0; i < max_obj_pool; i++) {
^
kernel/trace/trace_object.c:126:7: note: Assuming 'inst' is null
if (!inst) {
^~~~~
kernel/trace/trace_object.c:126:3: note: Taking true branch
if (!inst) {
--
compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
^
include/linux/compiler_types.h:302:3: note: expanded from macro '__native_word'
(sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
^
kernel/trace/trace_object.c:99:2: note: Left side of '||' is false
list_for_each_entry_rcu(inst, head, active_list)
^
include/linux/rculist.h:393:9: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
^
include/linux/rculist.h:307:15: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
compiletime_assert_rwonce_type(x); \
^
include/asm-generic/rwonce.h:36:21: note: expanded from macro 'compiletime_assert_rwonce_type'
compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
^
include/linux/compiler_types.h:302:3: note: expanded from macro '__native_word'
(sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
^
kernel/trace/trace_object.c:99:2: note: Left side of '||' is true
list_for_each_entry_rcu(inst, head, active_list)
^
include/linux/rculist.h:393:9: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
^
include/linux/rculist.h:307:15: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
compiletime_assert_rwonce_type(x); \
^
include/asm-generic/rwonce.h:36:38: note: expanded from macro 'compiletime_assert_rwonce_type'
compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
^
kernel/trace/trace_object.c:99:2: note: Taking false branch
list_for_each_entry_rcu(inst, head, active_list)
^
include/linux/rculist.h:393:9: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
^
include/linux/rculist.h:307:15: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
compiletime_assert_rwonce_type(x); \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:335:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:323:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:315:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
kernel/trace/trace_object.c:99:2: note: Loop condition is false. Exiting loop
list_for_each_entry_rcu(inst, head, active_list)
^
include/linux/rculist.h:393:9: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
^
include/linux/rculist.h:307:15: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
^
include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
compiletime_assert_rwonce_type(x); \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:335:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:323:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:307:2: note: expanded from macro '__compiletime_assert'
do { \
^
kernel/trace/trace_object.c:99:2: note: Use of memory after it is freed
list_for_each_entry_rcu(inst, head, active_list)
^
include/linux/rculist.h:393:9: note: expanded from macro 'list_for_each_entry_rcu'
pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/rculist.h:307:15: note: expanded from macro 'list_entry_rcu'
container_of(READ_ONCE(ptr), type, member)
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:50:2: note: expanded from macro 'READ_ONCE'
__READ_ONCE(x); \
^
include/asm-generic/rwonce.h:44:24: note: expanded from macro '__READ_ONCE'
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
^
include/linux/container_of.h:18:26: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
>> kernel/trace/trace_object.c:533:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
return ret;
^
kernel/trace/trace_object.c:334:2: note: Assuming 'debug_locks' is 0
lockdep_assert_held(&event_mutex);
^
include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/lockdep.h:310:15: note: expanded from macro 'lockdep_assert'
do { WARN_ON(debug_locks && !(cond)); } while (0)
^~~~~~~~~~~
include/asm-generic/bug.h:121:25: note: expanded from macro 'WARN_ON'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
kernel/trace/trace_object.c:334:2: note: Left side of '&&' is false
lockdep_assert_held(&event_mutex);
^
include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
^
include/linux/lockdep.h:310:27: note: expanded from macro 'lockdep_assert'
do { WARN_ON(debug_locks && !(cond)); } while (0)
^
kernel/trace/trace_object.c:334:2: note: Taking false branch
lockdep_assert_held(&event_mutex);
^
include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
^
include/linux/lockdep.h:310:7: note: expanded from macro 'lockdep_assert'
do { WARN_ON(debug_locks && !(cond)); } while (0)
^
include/asm-generic/bug.h:122:2: note: expanded from macro 'WARN_ON'
if (unlikely(__ret_warn_on)) \
^
kernel/trace/trace_object.c:334:2: note: Loop condition is false. Exiting loop
lockdep_assert_held(&event_mutex);
^
include/linux/lockdep.h:316:2: note: expanded from macro 'lockdep_assert_held'
lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
^
include/linux/lockdep.h:310:2: note: expanded from macro 'lockdep_assert'
do { WARN_ON(debug_locks && !(cond)); } while (0)
^
kernel/trace/trace_object.c:336:2: note: Loop condition is true. Entering loop body
list_for_each_entry(data, &file->triggers, list) {
^
include/linux/list.h:630:2: note: expanded from macro 'list_for_each_entry'
for (pos = list_first_entry(head, typeof(*pos), member); \
^
kernel/trace/trace_object.c:337:7: note: Assuming 'data->cmd_ops->trigger_type' is equal to 'test->cmd_ops->trigger_type'
if (data->cmd_ops->trigger_type == test->cmd_ops->trigger_type) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/trace/trace_object.c:337:3: note: Taking true branch
if (data->cmd_ops->trigger_type == test->cmd_ops->trigger_type) {
^
kernel/trace/trace_object.c:342:4: note: Execution continues on line 346
break;
^
kernel/trace/trace_object.c:346:6: note: 'unregistered' is true
if (unregistered && data->ops->free) {
^~~~~~~~~~~~
kernel/trace/trace_object.c:346:6: note: Left side of '&&' is true
kernel/trace/trace_object.c:346:22: note: Assuming field 'free' is non-null
if (unregistered && data->ops->free) {
^~~~~~~~~~~~~~~
kernel/trace/trace_object.c:346:2: note: Taking true branch
if (unregistered && data->ops->free) {
^
kernel/trace/trace_object.c:348:3: note: Calling 'exit_trace_object'
exit_trace_object();
^~~~~~~~~~~~~~~~~~~
kernel/trace/trace_object.c:516:2: note: 'ret' declared without an initial value
int ret;
^~~~~~~
kernel/trace/trace_object.c:518:19: note: Assuming the condition is true
if (WARN_ON_ONCE(atomic_read(&trace_object_ref) <= 0))
^
include/asm-generic/bug.h:104:25: note: expanded from macro 'WARN_ON_ONCE'
int __ret_warn_on = !!(condition); \
^~~~~~~~~
kernel/trace/trace_object.c:518:6: note: Taking true branch
if (WARN_ON_ONCE(atomic_read(&trace_object_ref) <= 0))
^
include/asm-generic/bug.h:105:2: note: expanded from macro 'WARN_ON_ONCE'
if (unlikely(__ret_warn_on)) \
^
kernel/trace/trace_object.c:518:6: note: Loop condition is false. Exiting loop
if (WARN_ON_ONCE(atomic_read(&trace_object_ref) <= 0))
^
include/asm-generic/bug.h:106:3: note: expanded from macro 'WARN_ON_ONCE'
__WARN_FLAGS(BUGFLAG_ONCE | \
^
arch/x86/include/asm/bug.h:79:2: note: expanded from macro '__WARN_FLAGS'
_BUG_FLAGS(ASM_UD2, BUGFLAG_WARNING|(flags)); \
^
arch/x86/include/asm/bug.h:25:37: note: expanded from macro '_BUG_FLAGS'
#define _BUG_FLAGS(ins, flags) \
^
kernel/trace/trace_object.c:518:6: note: Loop condition is false. Exiting loop
vim +99 kernel/trace/trace_object.c
88ea43d691b0980 Jeff Xie 2021-11-30 94
88ea43d691b0980 Jeff Xie 2021-11-30 95 static inline void free_active_list_objects(struct list_head *head)
88ea43d691b0980 Jeff Xie 2021-11-30 96 {
88ea43d691b0980 Jeff Xie 2021-11-30 97 struct object_instance *inst;
88ea43d691b0980 Jeff Xie 2021-11-30 98
88ea43d691b0980 Jeff Xie 2021-11-30 @99 list_for_each_entry_rcu(inst, head, active_list)
88ea43d691b0980 Jeff Xie 2021-11-30 100 kfree(inst);
88ea43d691b0980 Jeff Xie 2021-11-30 101 }
88ea43d691b0980 Jeff Xie 2021-11-30 102
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 4 weeks
drivers/net/ethernet/actions/owl-emac.c:210:16: warning: Access to field 'control' results in a dereference of an undefined pointer value (loaded from variable 'desc') [clang-analyzer-core.NullDereference]
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Cai Huoqing <caihuoqing(a)baidu.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d58071a8a76d779eedab38033ae4c821c30295a5
commit: fbcf8a340150abd20bf44fc706362b0827157fe8 net: ethernet: actions: Add helper dependency on COMPILE_TEST
date: 3 months ago
:::::: branch date: 2 days ago
:::::: commit date: 3 months ago
config: arm-randconfig-c002-20211001 (https://download.01.org/0day-ci/archive/20211201/202112010219.RWu2F2Ib-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 962e503cc8bc411f7523cc393acae8aae425b1c4)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# 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 fbcf8a340150abd20bf44fc706362b0827157fe8
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
6 warnings generated.
Suppressed 6 warnings (6 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
3 warnings generated.
Suppressed 3 warnings (3 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.
Suppressed 2 warnings (2 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.
Suppressed 6 warnings (6 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.
Suppressed 6 warnings (6 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.
Suppressed 6 warnings (6 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.
Suppressed 6 warnings (6 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.
Suppressed 6 warnings (6 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.
Suppressed 6 warnings (6 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 6 warnings (6 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
7 warnings generated.
Suppressed 7 warnings (7 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.
Suppressed 2 warnings (2 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.
Suppressed 6 warnings (6 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.
Suppressed 2 warnings (2 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.
10 warnings generated.
drivers/net/can/ti_hecc.c:783:3: warning: Value stored to 'int_status' is never read [clang-analyzer-deadcode.DeadStores]
int_status = hecc_read(priv, HECC_CANGIF1);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/can/ti_hecc.c:783:3: note: Value stored to 'int_status' is never read
int_status = hecc_read(priv, HECC_CANGIF1);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/can/ti_hecc.c:786:3: warning: Value stored to 'int_status' is never read [clang-analyzer-deadcode.DeadStores]
int_status = hecc_read(priv, HECC_CANGIF0);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/can/ti_hecc.c:786:3: note: Value stored to 'int_status' is never read
int_status = hecc_read(priv, HECC_CANGIF0);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/can/ti_hecc.c:861:22: warning: Value stored to 'np' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device_node *np = pdev->dev.of_node;
^~ ~~~~~~~~~~~~~~~~~
drivers/net/can/ti_hecc.c:861:22: note: Value stored to 'np' during its initialization is never read
struct device_node *np = pdev->dev.of_node;
^~ ~~~~~~~~~~~~~~~~~
Suppressed 7 warnings (7 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.
7 warnings generated.
Suppressed 7 warnings (7 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.
9 warnings generated.
>> drivers/net/ethernet/actions/owl-emac.c:210:16: warning: Access to field 'control' results in a dereference of an undefined pointer value (loaded from variable 'desc') [clang-analyzer-core.NullDereference]
desc->control |= OWL_EMAC_BIT_RDES1_RER;
^
drivers/net/ethernet/actions/owl-emac.c:1420:2: note: '?' condition is false
if (ret)
^
include/linux/compiler.h:56:28: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^
drivers/net/ethernet/actions/owl-emac.c:1420:6: note: 'ret' is 0
if (ret)
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
(cond) ? \
^~~~
drivers/net/ethernet/actions/owl-emac.c:1420:2: note: '?' condition is false
if (ret)
^
include/linux/compiler.h:56:28: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^
include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
(cond) ? \
^
drivers/net/ethernet/actions/owl-emac.c:1420:2: note: Taking false branch
if (ret)
^
include/linux/compiler.h:56:23: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
drivers/net/ethernet/actions/owl-emac.c:1423:2: note: Assuming the condition is false
if (netif_running(netdev)) {
^
include/linux/compiler.h:56:45: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
drivers/net/ethernet/actions/owl-emac.c:1423:2: note: '?' condition is false
if (netif_running(netdev)) {
^
include/linux/compiler.h:56:28: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^
drivers/net/ethernet/actions/owl-emac.c:1423:2: note: '?' condition is true
if (netif_running(netdev)) {
^
include/linux/compiler.h:56:28: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^
include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
(cond) ? \
^
drivers/net/ethernet/actions/owl-emac.c:1423:2: note: Taking true branch
if (netif_running(netdev)) {
^
include/linux/compiler.h:56:23: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
drivers/net/ethernet/actions/owl-emac.c:1427:9: note: Calling 'owl_emac_enable'
ret = owl_emac_enable(netdev, true);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/actions/owl-emac.c:1042:8: note: Calling 'owl_emac_ring_prepare_rx'
ret = owl_emac_ring_prepare_rx(priv);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/actions/owl-emac.c:184:2: note: 'desc' declared without an initial value
struct owl_emac_ring_desc *desc;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/actions/owl-emac.c:189:14: note: Assuming 'i' is >= field 'size'
for (i = 0; i < ring->size; i++) {
^~~~~~~~~~~~~~
drivers/net/ethernet/actions/owl-emac.c:189:2: note: Loop condition is false. Execution continues on line 210
for (i = 0; i < ring->size; i++) {
^
drivers/net/ethernet/actions/owl-emac.c:210:16: note: Access to field 'control' results in a dereference of an undefined pointer value (loaded from variable 'desc')
desc->control |= OWL_EMAC_BIT_RDES1_RER;
~~~~ ^
drivers/net/ethernet/actions/owl-emac.c:233:16: warning: Access to field 'control' results in a dereference of an undefined pointer value (loaded from variable 'desc') [clang-analyzer-core.NullDereference]
desc->control |= OWL_EMAC_BIT_TDES1_TER;
^
drivers/net/ethernet/actions/owl-emac.c:1420:2: note: '?' condition is false
if (ret)
vim +210 drivers/net/ethernet/actions/owl-emac.c
de6e0b19823985 Cristian Ciocaltea 2021-03-22 178
de6e0b19823985 Cristian Ciocaltea 2021-03-22 179 static int owl_emac_ring_prepare_rx(struct owl_emac_priv *priv)
de6e0b19823985 Cristian Ciocaltea 2021-03-22 180 {
de6e0b19823985 Cristian Ciocaltea 2021-03-22 181 struct owl_emac_ring *ring = &priv->rx_ring;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 182 struct device *dev = owl_emac_get_dev(priv);
de6e0b19823985 Cristian Ciocaltea 2021-03-22 183 struct net_device *netdev = priv->netdev;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 184 struct owl_emac_ring_desc *desc;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 185 struct sk_buff *skb;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 186 dma_addr_t dma_addr;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 187 int i;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 188
de6e0b19823985 Cristian Ciocaltea 2021-03-22 189 for (i = 0; i < ring->size; i++) {
de6e0b19823985 Cristian Ciocaltea 2021-03-22 190 skb = owl_emac_alloc_skb(netdev);
de6e0b19823985 Cristian Ciocaltea 2021-03-22 191 if (!skb)
de6e0b19823985 Cristian Ciocaltea 2021-03-22 192 return -ENOMEM;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 193
de6e0b19823985 Cristian Ciocaltea 2021-03-22 194 dma_addr = owl_emac_dma_map_rx(priv, skb);
de6e0b19823985 Cristian Ciocaltea 2021-03-22 195 if (dma_mapping_error(dev, dma_addr)) {
de6e0b19823985 Cristian Ciocaltea 2021-03-22 196 dev_kfree_skb(skb);
de6e0b19823985 Cristian Ciocaltea 2021-03-22 197 return -ENOMEM;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 198 }
de6e0b19823985 Cristian Ciocaltea 2021-03-22 199
de6e0b19823985 Cristian Ciocaltea 2021-03-22 200 desc = &ring->descs[i];
de6e0b19823985 Cristian Ciocaltea 2021-03-22 201 desc->status = OWL_EMAC_BIT_RDES0_OWN;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 202 desc->control = skb_tailroom(skb) & OWL_EMAC_MSK_RDES1_RBS1;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 203 desc->buf_addr = dma_addr;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 204 desc->reserved = 0;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 205
de6e0b19823985 Cristian Ciocaltea 2021-03-22 206 ring->skbs[i] = skb;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 207 ring->skbs_dma[i] = dma_addr;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 208 }
de6e0b19823985 Cristian Ciocaltea 2021-03-22 209
de6e0b19823985 Cristian Ciocaltea 2021-03-22 @210 desc->control |= OWL_EMAC_BIT_RDES1_RER;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 211
de6e0b19823985 Cristian Ciocaltea 2021-03-22 212 ring->head = 0;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 213 ring->tail = 0;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 214
de6e0b19823985 Cristian Ciocaltea 2021-03-22 215 return 0;
de6e0b19823985 Cristian Ciocaltea 2021-03-22 216 }
de6e0b19823985 Cristian Ciocaltea 2021-03-22 217
:::::: The code at line 210 was first introduced by commit
:::::: de6e0b198239857943db395377dc1d2ddd6c05df net: ethernet: actions: Add Actions Semi Owl Ethernet MAC driver
:::::: TO: Cristian Ciocaltea <cristian.ciocaltea(a)gmail.com>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 4 weeks
[arnd-playground:randconfig-5.16-min 169/191] drivers/char/tpm/st33zp24/i2c.c:123 st33zp24_i2c_acpi_request_resources() error: uninitialized symbol 'gpiod_lpcpd'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Arnd Bergmann <arnd(a)arndb.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git randconfig-5.16-min
head: 7a16665b8fd19f170c0c15f1432c90e4750183f2
commit: 19074a13cd9fb8cd329d4f09ac0c28a6323abc9a [169/191] tpm: st33zp24: convert to gpio descriptors
:::::: branch date: 6 hours ago
:::::: commit date: 6 days ago
config: x86_64-randconfig-m001-20211128 (https://download.01.org/0day-ci/archive/20211201/202112010127.gh8qvdja-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/char/tpm/st33zp24/i2c.c:123 st33zp24_i2c_acpi_request_resources() error: uninitialized symbol 'gpiod_lpcpd'.
vim +/gpiod_lpcpd +123 drivers/char/tpm/st33zp24/i2c.c
2d2e376f05f23f Andy Shevchenko 2017-03-15 107
740ec346f32b34 Christophe Ricard 2016-02-23 108 static int st33zp24_i2c_acpi_request_resources(struct i2c_client *client)
22eb90db936755 Christophe Ricard 2016-02-13 109 {
9e0d39d8a6a0a8 Christophe Ricard 2016-03-31 110 struct tpm_chip *chip = i2c_get_clientdata(client);
9e0d39d8a6a0a8 Christophe Ricard 2016-03-31 111 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev);
9e0d39d8a6a0a8 Christophe Ricard 2016-03-31 112 struct st33zp24_i2c_phy *phy = tpm_dev->phy_id;
22eb90db936755 Christophe Ricard 2016-02-13 113 struct gpio_desc *gpiod_lpcpd;
32da5633dcb911 Christophe Ricard 2016-03-23 114 struct device *dev = &client->dev;
2d2e376f05f23f Andy Shevchenko 2017-03-15 115 int ret;
2d2e376f05f23f Andy Shevchenko 2017-03-15 116
23c3beae581f7c Andy Shevchenko 2017-06-12 117 ret = devm_acpi_dev_add_driver_gpios(dev, acpi_st33zp24_gpios);
2d2e376f05f23f Andy Shevchenko 2017-03-15 118 if (ret)
2d2e376f05f23f Andy Shevchenko 2017-03-15 119 return ret;
22eb90db936755 Christophe Ricard 2016-02-13 120
22eb90db936755 Christophe Ricard 2016-02-13 121 /* Get LPCPD GPIO from ACPI */
19074a13cd9fb8 Arnd Bergmann 2021-11-11 122 phy->io_lpcpd = devm_gpiod_get_optional(dev, "lpcpd", GPIOD_OUT_HIGH);
22eb90db936755 Christophe Ricard 2016-02-13 @123 if (IS_ERR(gpiod_lpcpd)) {
22eb90db936755 Christophe Ricard 2016-02-13 124 dev_err(&client->dev,
22eb90db936755 Christophe Ricard 2016-02-13 125 "Failed to retrieve lpcpd-gpios from acpi.\n");
19074a13cd9fb8 Arnd Bergmann 2021-11-11 126 phy->io_lpcpd = NULL;
22eb90db936755 Christophe Ricard 2016-02-13 127 /*
22eb90db936755 Christophe Ricard 2016-02-13 128 * lpcpd pin is not specified. This is not an issue as
22eb90db936755 Christophe Ricard 2016-02-13 129 * power management can be also managed by TPM specific
22eb90db936755 Christophe Ricard 2016-02-13 130 * commands. So leave with a success status code.
22eb90db936755 Christophe Ricard 2016-02-13 131 */
22eb90db936755 Christophe Ricard 2016-02-13 132 return 0;
22eb90db936755 Christophe Ricard 2016-02-13 133 }
22eb90db936755 Christophe Ricard 2016-02-13 134
22eb90db936755 Christophe Ricard 2016-02-13 135 return 0;
22eb90db936755 Christophe Ricard 2016-02-13 136 }
22eb90db936755 Christophe Ricard 2016-02-13 137
:::::: The code at line 123 was first introduced by commit
:::::: 22eb90db936755e5d600a4561a0cc7a82c791eb9 tpm/st33zp24: Add support for acpi probing for i2c device.
:::::: TO: Christophe RICARD <christophe.ricard(a)gmail.com>
:::::: CC: Jarkko Sakkinen <jarkko.sakkinen(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 4 weeks
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:491:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Léo Le Bouter" <lle-bout(a)zaclys.net>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d58071a8a76d779eedab38033ae4c821c30295a5
commit: 9b22fece786ed641909988da4810bfa8e5d2e592 atlantic: remove architecture depends
date: 11 months ago
:::::: branch date: 2 days ago
:::::: commit date: 11 months ago
config: i386-randconfig-c001-20211126 (https://download.01.org/0day-ci/archive/20211201/202112010129.KI0y5I8w-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5162b558d8c0b542e752b037e72a69d5fd51eb1e)
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...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 9b22fece786ed641909988da4810bfa8e5d2e592
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
fs/ntfs/runlist.c:1764:4: warning: Value stored to 'rl_end' is never read [clang-analyzer-deadcode.DeadStores]
rl_end = trl + (rl_end - runlist->rl);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ntfs/runlist.c:1764:4: note: Value stored to 'rl_end' is never read
rl_end = trl + (rl_end - runlist->rl);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ntfs/runlist.c:1834:4: warning: Value stored to 'rl_end' is never read [clang-analyzer-deadcode.DeadStores]
rl_end = trl + (rl_end - runlist->rl);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ntfs/runlist.c:1834:4: note: Value stored to 'rl_end' is never read
rl_end = trl + (rl_end - runlist->rl);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ntfs/runlist.c:1866:2: warning: Value stored to 'old_size' is never read [clang-analyzer-deadcode.DeadStores]
old_size += 2;
^ ~
fs/ntfs/runlist.c:1866:2: note: Value stored to 'old_size' is never read
old_size += 2;
^ ~
fs/ntfs/runlist.c:1869:3: warning: Value stored to 'rl_end' is never read [clang-analyzer-deadcode.DeadStores]
rl_end = trl + (rl_end - runlist->rl);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ntfs/runlist.c:1869:3: note: Value stored to 'rl_end' is never read
rl_end = trl + (rl_end - runlist->rl);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 3 warnings (3 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.
4 warnings generated.
fs/ntfs/super.c:775:2: warning: Value stored to 'nr_hidden_sects' is never read [clang-analyzer-deadcode.DeadStores]
nr_hidden_sects = le32_to_cpu(b->bpb.hidden_sectors);
^
fs/ntfs/super.c:775:2: note: Value stored to 'nr_hidden_sects' is never read
Suppressed 3 warnings (3 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.
3 warnings generated.
Suppressed 3 warnings (3 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.
3 warnings generated.
Suppressed 3 warnings (3 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.
3 warnings generated.
Suppressed 3 warnings (3 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.
4 warnings generated.
fs/ntfs/lcnalloc.c:735:4: warning: Value stored to 'need_writeback' is never read [clang-analyzer-deadcode.DeadStores]
need_writeback = 0;
^ ~
fs/ntfs/lcnalloc.c:735:4: note: Value stored to 'need_writeback' is never read
need_writeback = 0;
^ ~
Suppressed 3 warnings (3 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
3 warnings generated.
>> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:491:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = readx_poll_timeout_atomic(hw_atl_scrpad25_get,
^
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:491:2: note: Value stored to 'err' is never read
Suppressed 2 warnings (2 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.
5 warnings generated.
>> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c:100:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = readx_poll_timeout_atomic(aq_fw2x_mbox_get,
^
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c:100:2: note: Value stored to 'err' is never read
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c:105:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = readx_poll_timeout_atomic(aq_fw2x_rpc_get,
^
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c:105:2: note: Value stored to 'err' is never read
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c:343:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = readx_poll_timeout_atomic(aq_fw2x_state2_get, self, val,
^
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils_fw2x.c:343:2: note: Value stored to 'err' is never read
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
5 warnings generated.
drivers/scsi/scsi_transport_iscsi.c:3191:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = transport->get_chap(shost, ev->u.get_chap.chap_tbl_idx,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_transport_iscsi.c:3191:3: note: Value stored to 'err' is never read
err = transport->get_chap(shost, ev->u.get_chap.chap_tbl_idx,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 4 warnings (4 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
4 warnings generated.
drivers/scsi/libfc/fc_disc.c:111:3: warning: Value stored to 'ev_qual' is never read [clang-analyzer-deadcode.DeadStores]
ev_qual &= ELS_RSCN_EV_QUAL_MASK;
^
drivers/scsi/libfc/fc_disc.c:111:3: note: Value stored to 'ev_qual' is never read
Suppressed 3 warnings (2 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
drivers/net/ethernet/8390/pcnet_cs.c:311:5: warning: Value stored to 'j' is never read [clang-analyzer-deadcode.DeadStores]
j = pcmcia_release_window(link, link->resource[2]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/8390/pcnet_cs.c:311:5: note: Value stored to 'j' is never read
j = pcmcia_release_window(link, link->resource[2]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/8390/pcnet_cs.c:1434:6: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = -ENOMEM;
^ ~~~~~~~
drivers/net/ethernet/8390/pcnet_cs.c:1434:6: note: Value stored to 'ret' is never read
ret = -ENOMEM;
^ ~~~~~~~
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
3 warnings generated.
Suppressed 3 warnings (2 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
>> drivers/net/ethernet/aquantia/atlantic/aq_vec.c:44:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = -EINVAL;
^ ~~~~~~~
drivers/net/ethernet/aquantia/atlantic/aq_vec.c:44:3: note: Value stored to 'err' is never read
err = -EINVAL;
^ ~~~~~~~
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
4 warnings generated.
>> drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c:211:2: warning: Value stored to 'data' is never read [clang-analyzer-deadcode.DeadStores]
data = aq_macsec_get_stats(aq_nic, data);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c:211:2: note: Value stored to 'data' is never read
data = aq_macsec_get_stats(aq_nic, data);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c:435:2: warning: Value stored to 'cfg' is never read [clang-analyzer-deadcode.DeadStores]
cfg = aq_nic_get_cfg(aq_nic);
^ ~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c:435:2: note: Value stored to 'cfg' is never read
cfg = aq_nic_get_cfg(aq_nic);
^ ~~~~~~~~~~~~~~~~~~~~~~
Suppressed 2 warnings (2 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.
3 warnings generated.
drivers/i3c/master.c:555:32: warning: Value stored to 'master' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct i3c_master_controller *master = i3c_bus_to_i3c_master(i3cbus);
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/i3c/master.c:555:32: note: Value stored to 'master' during its initialization is never read
struct i3c_master_controller *master = i3c_bus_to_i3c_master(i3cbus);
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 2 warnings (2 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.
3 warnings generated.
drivers/i3c/master/i3c-master-cdns.c:1245:2: warning: Value stored to 'prescl1' is never read [clang-analyzer-deadcode.DeadStores]
prescl1 = PRESCL_CTRL1_OD_LOW(low);
^
drivers/i3c/master/i3c-master-cdns.c:1245:2: note: Value stored to 'prescl1' is never read
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
5 warnings generated.
drivers/ata/pata_legacy.c:283:3: warning: Value stored to 'rt' is never read [clang-analyzer-deadcode.DeadStores]
rt |= (1 + 3 * pio) << (3 * adev->devno);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/ata/pata_legacy.c:283:3: note: Value stored to 'rt' is never read
rt |= (1 + 3 * pio) << (3 * adev->devno);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/ata/pata_legacy.c:781:6: warning: Value stored to 'timing' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
int timing = 0x88 + (ap->port_no * 4) + (adev->devno * 2);
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/ata/pata_legacy.c:781:6: note: Value stored to 'timing' during its initialization is never read
int timing = 0x88 + (ap->port_no * 4) + (adev->devno * 2);
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 3 warnings (2 in non-user code, 1 with check filters).
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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
Suppressed 2 warnings (2 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.
3 warnings generated.
Suppressed 3 warnings (2 in non-user code, 1 with check filters).
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.
Suppressed 2 warnings (2 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.
3 warnings generated.
drivers/input/keyboard/samsung-keypad.c:88:23: warning: The result of the left shift is undefined because the left operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult]
val &= ~(1 << col) << 8;
^
drivers/input/keyboard/samsung-keypad.c:158:3: note: Calling 'samsung_keypad_scan'
samsung_keypad_scan(keypad, row_state);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/input/keyboard/samsung-keypad.c:85:16: note: Assuming 'col' is < field 'cols'
for (col = 0; col < keypad->cols; col++) {
^~~~~~~~~~~~~~~~~~
drivers/input/keyboard/samsung-keypad.c:85:2: note: Loop condition is true. Entering loop body
for (col = 0; col < keypad->cols; col++) {
^
drivers/input/keyboard/samsung-keypad.c:86:7: note: Assuming field 'type' is equal to KEYPAD_TYPE_S5PV210
vim +/err +491 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c
98c4c20142e985 David VomLehn 2017-01-23 472
98c4c20142e985 David VomLehn 2017-01-23 473 static int hw_atl_utils_init_ucp(struct aq_hw_s *self,
4cbc9f92f9a134 Igor Russkikh 2018-01-15 474 const struct aq_hw_caps_s *aq_hw_caps)
98c4c20142e985 David VomLehn 2017-01-23 475 {
98c4c20142e985 David VomLehn 2017-01-23 476 int err = 0;
98c4c20142e985 David VomLehn 2017-01-23 477
98c4c20142e985 David VomLehn 2017-01-23 478 if (!aq_hw_read_reg(self, 0x370U)) {
98c4c20142e985 David VomLehn 2017-01-23 479 unsigned int rnd = 0U;
98c4c20142e985 David VomLehn 2017-01-23 480 unsigned int ucp_0x370 = 0U;
98c4c20142e985 David VomLehn 2017-01-23 481
98c4c20142e985 David VomLehn 2017-01-23 482 get_random_bytes(&rnd, sizeof(unsigned int));
98c4c20142e985 David VomLehn 2017-01-23 483
98c4c20142e985 David VomLehn 2017-01-23 484 ucp_0x370 = 0x02020202U | (0xFEFEFEFEU & rnd);
98c4c20142e985 David VomLehn 2017-01-23 485 aq_hw_write_reg(self, HW_ATL_UCP_0X370_REG, ucp_0x370);
98c4c20142e985 David VomLehn 2017-01-23 486 }
98c4c20142e985 David VomLehn 2017-01-23 487
8e1c072fcbeae2 Igor Russkikh 2018-01-15 488 hw_atl_reg_glb_cpu_scratch_scp_set(self, 0x00000000U, 25U);
98c4c20142e985 David VomLehn 2017-01-23 489
98c4c20142e985 David VomLehn 2017-01-23 490 /* check 10 times by 1ms */
6a7f2277313b4a Nikita Danilov 2019-02-27 @491 err = readx_poll_timeout_atomic(hw_atl_scrpad25_get,
6a7f2277313b4a Nikita Danilov 2019-02-27 492 self, self->mbox_addr,
6a7f2277313b4a Nikita Danilov 2019-02-27 493 self->mbox_addr != 0U,
6a7f2277313b4a Nikita Danilov 2019-02-27 494 1000U, 10000U);
e7b5f97e6574dc Igor Russkikh 2020-02-14 495 err = readx_poll_timeout_atomic(aq_fw1x_rpc_get, self,
e7b5f97e6574dc Igor Russkikh 2020-02-14 496 self->rpc_addr,
e7b5f97e6574dc Igor Russkikh 2020-02-14 497 self->rpc_addr != 0U,
e7b5f97e6574dc Igor Russkikh 2020-02-14 498 1000U, 100000U);
98c4c20142e985 David VomLehn 2017-01-23 499
98c4c20142e985 David VomLehn 2017-01-23 500 return err;
98c4c20142e985 David VomLehn 2017-01-23 501 }
98c4c20142e985 David VomLehn 2017-01-23 502
:::::: The code at line 491 was first introduced by commit
:::::: 6a7f2277313b4a39645c13277efb9337ca441933 net: aquantia: replace AQ_HW_WAIT_FOR with readx_poll_timeout_atomic
:::::: TO: Nikita Danilov <nikita.danilov(a)aquantia.com>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 4 weeks
[linux-next:master 3660/4301] fs/gfs2/inode.c:192 gfs2_inode_lookup() error: we previously assumed 'gl' could be null (see line 169)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Andreas Gruenbacher <agruenba(a)redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 34f255a1e91ab44ff8926cf8294ff9144e62e861
commit: cfdb9692082c42515edc5a921481826a1573d329 [3660/4301] gfs2: Rework gfs2_inode_lookup
:::::: branch date: 2 hours ago
:::::: commit date: 22 hours ago
config: powerpc64-randconfig-m031-20211129 (https://download.01.org/0day-ci/archive/20211130/202111301821.8ginBraG-lk...)
compiler: powerpc64-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
fs/gfs2/inode.c:192 gfs2_inode_lookup() error: we previously assumed 'gl' could be null (see line 169)
Old smatch warnings:
fs/gfs2/inode.c:343 gfs2_lookupi() warn: passing zero to 'ERR_PTR'
vim +/gl +192 fs/gfs2/inode.c
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 91
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 92 /**
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 93 * gfs2_inode_lookup - Lookup an inode
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 94 * @sb: The super block
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 95 * @type: The type of the inode
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 96 * @no_addr: The inode number
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 97 * @no_formal_ino: The inode generation number
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 98 * @blktype: Requested block type (GFS2_BLKST_DINODE or GFS2_BLKST_UNLINKED;
61b91cfdc6c0c4 fs/gfs2/inode.c Andreas Gruenbacher 2017-08-01 99 * GFS2_BLKST_FREE to indicate not to verify)
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 100 *
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 101 * If @type is DT_UNKNOWN, the inode type is fetched from disk.
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 102 *
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 103 * If @blktype is anything other than GFS2_BLKST_FREE (which is used as a
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 104 * placeholder because it doesn't otherwise make sense), the on-disk block type
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 105 * is verified to be @blktype.
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 106 *
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 107 * When @no_formal_ino is non-zero, this function will return ERR_PTR(-ESTALE)
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 108 * if it detects that @no_formal_ino doesn't match the actual inode generation
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 109 * number. However, it doesn't always know unless @type is DT_UNKNOWN.
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 110 *
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 111 * Returns: A VFS inode, or an error
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 112 */
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 113
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 114 struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 115 u64 no_addr, u64 no_formal_ino,
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 116 unsigned int blktype)
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 117 {
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 118 struct gfs2_sbd *sdp = sb->s_fs_info;
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 119 struct gfs2_glock *gl = NULL;
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 120 struct inode *inode;
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 121 struct gfs2_inode *ip;
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 122 struct gfs2_holder gh;
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 123 int error;
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 124
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 125 gfs2_holder_mark_uninitialized(&gh);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 126 inode = ilookup5(sb, no_addr, iget_test, &no_addr);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 127 if (!inode && (type == DT_UNKNOWN || blktype != GFS2_BLKST_FREE)) {
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 128 error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &gl);
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 129 if (unlikely(error))
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 130 goto fail;
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 131
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 132 /*
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 133 * The GL_SKIP flag indicates to skip reading the inode
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 134 * block. We read the inode when instantiating it
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 135 * after possibly checking the block type.
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 136 */
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 137 error = gfs2_glock_nq_init(gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh);
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 138 if (error)
40e7e86ef16550 fs/gfs2/inode.c Andreas Gruenbacher 2020-01-24 139 goto fail;
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 140
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 141 error = -ESTALE;
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 142 if (no_formal_ino &&
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 143 gfs2_inode_already_deleted(gl, no_formal_ino))
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 144 goto fail;
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 145
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 146 if (blktype != GFS2_BLKST_FREE) {
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 147 error = gfs2_check_blk_type(sdp, no_addr, blktype);
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 148 if (error)
40e7e86ef16550 fs/gfs2/inode.c Andreas Gruenbacher 2020-01-24 149 goto fail;
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 150 }
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 151 }
3ce37b2cb49176 fs/gfs2/inode.c Andreas Gruenbacher 2016-06-14 152
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 153 while (!inode) {
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 154 inode = iget5_locked(sb, no_addr, iget_test, iget_set, &no_addr);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 155 error = -ENOMEM;
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 156 if (!inode)
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 157 goto fail;
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 158 if (is_bad_inode(inode)) {
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 159 iput(inode);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 160 inode = NULL;
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 161 }
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 162 }
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 163
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 164 ip = GFS2_I(inode);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 165
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 166 if (inode->i_state & I_NEW) {
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 167 struct gfs2_glock *io_gl;
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 168
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 @169 if (!gl) {
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 170 error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &gl);
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 171 if (unlikely(error))
40e7e86ef16550 fs/gfs2/inode.c Andreas Gruenbacher 2020-01-24 172 goto fail;
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 173 }
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 174 flush_delayed_work(&gl->gl_work);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 175 set_bit(GLF_INSTANTIATE_NEEDED, &gl->gl_flags);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 176
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 177 error = gfs2_glock_get(sdp, no_addr, &gfs2_iopen_glops, CREATE, &io_gl);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 178 if (unlikely(error))
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 179 goto fail;
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 180 if (blktype != GFS2_BLKST_UNLINKED)
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 181 gfs2_cancel_delete_work(io_gl);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 182 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 183 gfs2_glock_put(io_gl);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 184 if (unlikely(error))
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 185 goto fail;
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 186
2b0fb353c029de fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 187 /* Lowest possible timestamp; will be overwritten in gfs2_dinode_in. */
2b0fb353c029de fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 188 inode->i_atime.tv_sec = 1LL << (8 * sizeof(inode->i_atime.tv_sec) - 1);
2b0fb353c029de fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 189 inode->i_atime.tv_nsec = 0;
2b0fb353c029de fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 190
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 191 ip->i_gl = gl;
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 @192 glock_set_object(gl, ip);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 193
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 194 if (type == DT_UNKNOWN) {
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 195 /* Inode glock must be locked already */
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 196 error = gfs2_instantiate(&gh);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 197 if (error) {
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 198 glock_clear_object(gl, ip);
40e7e86ef16550 fs/gfs2/inode.c Andreas Gruenbacher 2020-01-24 199 goto fail;
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 200 }
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 201 } else {
2b0fb353c029de fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 202 ip->i_no_formal_ino = no_formal_ino;
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 203 inode->i_mode = DT2IF(type);
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 204 }
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 205
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 206 if (gfs2_holder_initialized(&gh))
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 207 gfs2_glock_dq_uninit(&gh);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 208 glock_set_object(io_gl, ip);
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 209
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 210 gfs2_set_iop(inode);
a44a8c9c8df1fa fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 211 unlock_new_inode(inode);
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 212 }
332f51d7db13ff fs/gfs2/inode.c Andreas Gruenbacher 2016-09-26 213
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 214 if (no_formal_ino && ip->i_no_formal_ino &&
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 215 no_formal_ino != ip->i_no_formal_ino) {
b66648ad6dcfef fs/gfs2/inode.c Andreas Gruenbacher 2020-01-15 216 iput(inode);
a44a8c9c8df1fa fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 217 return ERR_PTR(-ESTALE);
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 218 }
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 219
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 220 return inode;
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 221
40e7e86ef16550 fs/gfs2/inode.c Andreas Gruenbacher 2020-01-24 222 fail:
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 223 if (inode) {
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 224 if (gfs2_holder_initialized(&ip->i_iopen_gh))
763766c0571ea1 fs/gfs2/inode.c Bob Peterson 2021-09-29 225 gfs2_glock_dq_uninit(&ip->i_iopen_gh);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 226 if (inode->i_state & I_NEW) {
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 227 make_bad_inode(inode);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 228 unlock_new_inode(inode);
763766c0571ea1 fs/gfs2/inode.c Bob Peterson 2021-09-29 229 }
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 230 iput(inode);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 231 }
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 232 if (gfs2_holder_initialized(&gh))
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 233 gfs2_glock_dq_uninit(&gh);
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 234 if (gl)
cfdb9692082c42 fs/gfs2/inode.c Andreas Gruenbacher 2021-11-29 235 gfs2_glock_put(gl);
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 236 return ERR_PTR(error);
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 237 }
194c011fc4650d fs/gfs2/ops_inode.c Steven Whitehouse 2011-05-09 238
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 4 weeks
drivers/pci/controller/dwc/pci-dra7xx.c:864 dra7xx_pcie_probe() warn: 'dra7xx->clk' not released on lines: 759.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Luca Ceresoli <luca(a)lucaceresoli.net>
CC: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d58071a8a76d779eedab38033ae4c821c30295a5
commit: 5af9405397bfb90d6adab61d58f4d94c78166698 PCI: dra7xx: Get an optional clock
date: 9 weeks ago
:::::: branch date: 2 days ago
:::::: commit date: 9 weeks ago
config: powerpc64-randconfig-m031-20211128 (https://download.01.org/0day-ci/archive/20211130/202111301803.NOwoj4Jd-lk...)
compiler: powerpc64-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/pci/controller/dwc/pci-dra7xx.c:864 dra7xx_pcie_probe() warn: 'dra7xx->clk' not released on lines: 759.
vim +864 drivers/pci/controller/dwc/pci-dra7xx.c
c232c0df9610bf drivers/pci/controller/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2019-01-24 683
e259c2926c016d drivers/pci/controller/dwc/pci-dra7xx.c Tony Lindgren 2021-03-10 684 static int dra7xx_pcie_probe(struct platform_device *pdev)
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 685 {
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 686 u32 reg;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 687 int ret;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 688 int irq;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 689 int i;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 690 int phy_count;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 691 struct phy **phy;
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 692 struct device_link **link;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 693 void __iomem *base;
442ec4c04d1235 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 694 struct dw_pcie *pci;
442ec4c04d1235 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 695 struct dra7xx_pcie *dra7xx;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 696 struct device *dev = &pdev->dev;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 697 struct device_node *np = dev->of_node;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 698 char name[10];
602d38bc65aa29 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 699 struct gpio_desc *reset;
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 700 const struct of_device_id *match;
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 701 const struct dra7xx_pcie_of_data *data;
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 702 enum dw_pcie_device_mode mode;
c232c0df9610bf drivers/pci/controller/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2019-01-24 703 u32 b1co_mode_sel_mask;
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 704
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 705 match = of_match_device(of_match_ptr(of_dra7xx_pcie_match), dev);
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 706 if (!match)
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 707 return -EINVAL;
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 708
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 709 data = (struct dra7xx_pcie_of_data *)match->data;
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 710 mode = (enum dw_pcie_device_mode)data->mode;
c232c0df9610bf drivers/pci/controller/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2019-01-24 711 b1co_mode_sel_mask = data->b1co_mode_sel_mask;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 712
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 713 dra7xx = devm_kzalloc(dev, sizeof(*dra7xx), GFP_KERNEL);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 714 if (!dra7xx)
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 715 return -ENOMEM;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 716
442ec4c04d1235 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 717 pci = devm_kzalloc(dev, sizeof(*pci), GFP_KERNEL);
442ec4c04d1235 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 718 if (!pci)
442ec4c04d1235 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 719 return -ENOMEM;
442ec4c04d1235 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 720
442ec4c04d1235 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 721 pci->dev = dev;
442ec4c04d1235 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 722 pci->ops = &dw_pcie_ops;
442ec4c04d1235 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 723
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 724 irq = platform_get_irq(pdev, 0);
caecb05c800081 drivers/pci/controller/dwc/pci-dra7xx.c Krzysztof Wilczyński 2020-08-02 725 if (irq < 0)
a0d21ba120d2c7 drivers/pci/dwc/pci-dra7xx.c Gustavo A. R. Silva 2017-08-09 726 return irq;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 727
c8a119779f5609 drivers/pci/controller/dwc/pci-dra7xx.c Wei Yongjun 2020-04-29 728 base = devm_platform_ioremap_resource_byname(pdev, "ti_conf");
c8a119779f5609 drivers/pci/controller/dwc/pci-dra7xx.c Wei Yongjun 2020-04-29 729 if (IS_ERR(base))
c8a119779f5609 drivers/pci/controller/dwc/pci-dra7xx.c Wei Yongjun 2020-04-29 730 return PTR_ERR(base);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 731
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 732 phy_count = of_property_count_strings(np, "phy-names");
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 733 if (phy_count < 0) {
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 734 dev_err(dev, "unable to find the strings\n");
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 735 return phy_count;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 736 }
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 737
a86854d0c599b3 drivers/pci/dwc/pci-dra7xx.c Kees Cook 2018-06-12 738 phy = devm_kcalloc(dev, phy_count, sizeof(*phy), GFP_KERNEL);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 739 if (!phy)
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 740 return -ENOMEM;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 741
a86854d0c599b3 drivers/pci/dwc/pci-dra7xx.c Kees Cook 2018-06-12 742 link = devm_kcalloc(dev, phy_count, sizeof(*link), GFP_KERNEL);
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 743 if (!link)
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 744 return -ENOMEM;
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 745
5af9405397bfb9 drivers/pci/controller/dwc/pci-dra7xx.c Luca Ceresoli 2021-05-31 746 dra7xx->clk = devm_clk_get_optional(dev, NULL);
5af9405397bfb9 drivers/pci/controller/dwc/pci-dra7xx.c Luca Ceresoli 2021-05-31 747 if (IS_ERR(dra7xx->clk))
5af9405397bfb9 drivers/pci/controller/dwc/pci-dra7xx.c Luca Ceresoli 2021-05-31 748 return dev_err_probe(dev, PTR_ERR(dra7xx->clk),
5af9405397bfb9 drivers/pci/controller/dwc/pci-dra7xx.c Luca Ceresoli 2021-05-31 749 "clock request failed");
5af9405397bfb9 drivers/pci/controller/dwc/pci-dra7xx.c Luca Ceresoli 2021-05-31 750
5af9405397bfb9 drivers/pci/controller/dwc/pci-dra7xx.c Luca Ceresoli 2021-05-31 751 ret = clk_prepare_enable(dra7xx->clk);
5af9405397bfb9 drivers/pci/controller/dwc/pci-dra7xx.c Luca Ceresoli 2021-05-31 752 if (ret)
5af9405397bfb9 drivers/pci/controller/dwc/pci-dra7xx.c Luca Ceresoli 2021-05-31 753 return ret;
5af9405397bfb9 drivers/pci/controller/dwc/pci-dra7xx.c Luca Ceresoli 2021-05-31 754
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 755 for (i = 0; i < phy_count; i++) {
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 756 snprintf(name, sizeof(name), "pcie-phy%d", i);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 757 phy[i] = devm_phy_get(dev, name);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 758 if (IS_ERR(phy[i]))
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 759 return PTR_ERR(phy[i]);
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 760
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 761 link[i] = device_link_add(dev, &phy[i]->dev, DL_FLAG_STATELESS);
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 762 if (!link[i]) {
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 763 ret = -EINVAL;
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 764 goto err_link;
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 765 }
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 766 }
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 767
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 768 dra7xx->base = base;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 769 dra7xx->phy = phy;
442ec4c04d1235 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 770 dra7xx->pci = pci;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 771 dra7xx->phy_count = phy_count;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 772
c232c0df9610bf drivers/pci/controller/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2019-01-24 773 if (phy_count == 2) {
c232c0df9610bf drivers/pci/controller/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2019-01-24 774 ret = dra7xx_pcie_configure_two_lane(dev, b1co_mode_sel_mask);
c232c0df9610bf drivers/pci/controller/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2019-01-24 775 if (ret < 0)
c232c0df9610bf drivers/pci/controller/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2019-01-24 776 dra7xx->phy_count = 1; /* Fallback to x1 lane mode */
c232c0df9610bf drivers/pci/controller/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2019-01-24 777 }
c232c0df9610bf drivers/pci/controller/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2019-01-24 778
1f6c4501c667a6 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 779 ret = dra7xx_pcie_enable_phy(dra7xx);
1f6c4501c667a6 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 780 if (ret) {
1f6c4501c667a6 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 781 dev_err(dev, "failed to enable phy\n");
1f6c4501c667a6 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 782 return ret;
1f6c4501c667a6 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 783 }
1f6c4501c667a6 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 784
9bcf0a6fdc5062 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 785 platform_set_drvdata(pdev, dra7xx);
9bcf0a6fdc5062 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-02-15 786
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 787 pm_runtime_enable(dev);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 788 ret = pm_runtime_get_sync(dev);
d3f4caa355c1c9 drivers/pci/host/pci-dra7xx.c Fabio Estevam 2015-08-20 789 if (ret < 0) {
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 790 dev_err(dev, "pm_runtime_get_sync failed\n");
0e2bdb0e7abf4b drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2015-07-31 791 goto err_get_sync;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 792 }
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 793
602d38bc65aa29 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 794 reset = devm_gpiod_get_optional(dev, NULL, GPIOD_OUT_HIGH);
602d38bc65aa29 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 795 if (IS_ERR(reset)) {
602d38bc65aa29 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 796 ret = PTR_ERR(reset);
602d38bc65aa29 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 797 dev_err(&pdev->dev, "gpio request failed, ret %d\n", ret);
78bdcad05ea17f drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2015-07-28 798 goto err_gpio;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 799 }
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 800
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 801 reg = dra7xx_pcie_readl(dra7xx, PCIECTRL_DRA7XX_CONF_DEVICE_CMD);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 802 reg &= ~LTSSM_EN;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 803 dra7xx_pcie_writel(dra7xx, PCIECTRL_DRA7XX_CONF_DEVICE_CMD, reg);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 804
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 805 switch (mode) {
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 806 case DW_PCIE_RC_TYPE:
f1aba0a0de55c7 drivers/pci/dwc/pci-dra7xx.c Niklas Cassel 2017-12-20 807 if (!IS_ENABLED(CONFIG_PCI_DRA7XX_HOST)) {
f1aba0a0de55c7 drivers/pci/dwc/pci-dra7xx.c Niklas Cassel 2017-12-20 808 ret = -ENODEV;
f1aba0a0de55c7 drivers/pci/dwc/pci-dra7xx.c Niklas Cassel 2017-12-20 809 goto err_gpio;
f1aba0a0de55c7 drivers/pci/dwc/pci-dra7xx.c Niklas Cassel 2017-12-20 810 }
f1aba0a0de55c7 drivers/pci/dwc/pci-dra7xx.c Niklas Cassel 2017-12-20 811
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 812 dra7xx_pcie_writel(dra7xx, PCIECTRL_TI_CONF_DEVICE_TYPE,
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 813 DEVICE_TYPE_RC);
726d75a6d243bf drivers/pci/controller/dwc/pci-dra7xx.c Vignesh R 2018-09-25 814
726d75a6d243bf drivers/pci/controller/dwc/pci-dra7xx.c Vignesh R 2018-09-25 815 ret = dra7xx_pcie_unaligned_memaccess(dev);
726d75a6d243bf drivers/pci/controller/dwc/pci-dra7xx.c Vignesh R 2018-09-25 816 if (ret)
726d75a6d243bf drivers/pci/controller/dwc/pci-dra7xx.c Vignesh R 2018-09-25 817 dev_err(dev, "WA for Errata i870 not applied\n");
726d75a6d243bf drivers/pci/controller/dwc/pci-dra7xx.c Vignesh R 2018-09-25 818
23926c8dbd6fdc drivers/pci/host/pci-dra7xx.c Jingoo Han 2014-11-06 819 ret = dra7xx_add_pcie_port(dra7xx, pdev);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 820 if (ret < 0)
78bdcad05ea17f drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2015-07-28 821 goto err_gpio;
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 822 break;
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 823 case DW_PCIE_EP_TYPE:
f1aba0a0de55c7 drivers/pci/dwc/pci-dra7xx.c Niklas Cassel 2017-12-20 824 if (!IS_ENABLED(CONFIG_PCI_DRA7XX_EP)) {
f1aba0a0de55c7 drivers/pci/dwc/pci-dra7xx.c Niklas Cassel 2017-12-20 825 ret = -ENODEV;
f1aba0a0de55c7 drivers/pci/dwc/pci-dra7xx.c Niklas Cassel 2017-12-20 826 goto err_gpio;
f1aba0a0de55c7 drivers/pci/dwc/pci-dra7xx.c Niklas Cassel 2017-12-20 827 }
f1aba0a0de55c7 drivers/pci/dwc/pci-dra7xx.c Niklas Cassel 2017-12-20 828
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 829 dra7xx_pcie_writel(dra7xx, PCIECTRL_TI_CONF_DEVICE_TYPE,
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 830 DEVICE_TYPE_EP);
f7a2757f6cd0aa drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 831
726d75a6d243bf drivers/pci/controller/dwc/pci-dra7xx.c Vignesh R 2018-09-25 832 ret = dra7xx_pcie_unaligned_memaccess(dev);
f7a2757f6cd0aa drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 833 if (ret)
f7a2757f6cd0aa drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 834 goto err_gpio;
f7a2757f6cd0aa drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 835
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 836 ret = dra7xx_add_pcie_ep(dra7xx, pdev);
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 837 if (ret < 0)
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 838 goto err_gpio;
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 839 break;
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 840 default:
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 841 dev_err(dev, "INVALID device type %d\n", mode);
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 842 }
608793e27b3313 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-03-27 843 dra7xx->mode = mode;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 844
d4c7d1a089d6fd drivers/pci/dwc/pci-dra7xx.c Keerthy 2017-03-13 845 ret = devm_request_irq(dev, irq, dra7xx_pcie_irq_handler,
d4c7d1a089d6fd drivers/pci/dwc/pci-dra7xx.c Keerthy 2017-03-13 846 IRQF_SHARED, "dra7xx-pcie-main", dra7xx);
d4c7d1a089d6fd drivers/pci/dwc/pci-dra7xx.c Keerthy 2017-03-13 847 if (ret) {
d4c7d1a089d6fd drivers/pci/dwc/pci-dra7xx.c Keerthy 2017-03-13 848 dev_err(dev, "failed to request irq\n");
d4c7d1a089d6fd drivers/pci/dwc/pci-dra7xx.c Keerthy 2017-03-13 849 goto err_gpio;
d4c7d1a089d6fd drivers/pci/dwc/pci-dra7xx.c Keerthy 2017-03-13 850 }
d4c7d1a089d6fd drivers/pci/dwc/pci-dra7xx.c Keerthy 2017-03-13 851
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 852 return 0;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 853
78bdcad05ea17f drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2015-07-28 854 err_gpio:
0e2bdb0e7abf4b drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2015-07-31 855 err_get_sync:
c2615d620a852a drivers/pci/controller/dwc/pci-dra7xx.c Dinghao Liu 2020-05-20 856 pm_runtime_put(dev);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 857 pm_runtime_disable(dev);
1f6c4501c667a6 drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-01-11 858 dra7xx_pcie_disable_phy(dra7xx);
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 859
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 860 err_link:
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 861 while (--i >= 0)
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 862 device_link_del(link[i]);
7a4db656a6350f drivers/pci/dwc/pci-dra7xx.c Kishon Vijay Abraham I 2017-10-09 863
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 @864 return ret;
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 865 }
47ff3de911a728 drivers/pci/host/pci-dra7xx.c Kishon Vijay Abraham I 2014-07-22 866
:::::: The code at line 864 was first introduced by commit
:::::: 47ff3de911a728cdf9ecc6ad777131902cff62b4 PCI: dra7xx: Add TI DRA7xx PCIe driver
:::::: TO: Kishon Vijay Abraham I <kishon(a)ti.com>
:::::: CC: Bjorn Helgaas <bhelgaas(a)google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 4 weeks
[tglx-devel:msi 100/101] drivers/pci/msi/msi.c:1050 pci_msix_expand_vectors_at() warn: variable dereferenced before check 'dev' (see line 1046)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Thomas Gleixner <tglx(a)linutronix.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi
head: 1fd2d0e8970556f4495ebc122b6e7f249393022e
commit: 4044aa7eefffadc52424d908337708eaa82cf84c [100/101] PCI/MSI: Provide pci_msix_expand_vectors[_at]()
:::::: branch date: 13 hours ago
:::::: commit date: 13 hours ago
config: x86_64-randconfig-m001-20211128 (https://download.01.org/0day-ci/archive/20211130/202111301709.vSHraXYF-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/pci/msi/msi.c:1050 pci_msix_expand_vectors_at() warn: variable dereferenced before check 'dev' (see line 1046)
Old smatch warnings:
drivers/pci/msi/msi.c:517 msix_setup_msi_descs() error: uninitialized symbol 'ret'.
vim +/dev +1050 drivers/pci/msi/msi.c
aff171641d181e drivers/pci/msi.c Christoph Hellwig 2016-07-12 1030
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1031 /**
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1032 * pci_msix_expand_vectors_at - Expand MSI-X interrupts for a device
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1033 *
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1034 * @dev: PCI device to operate on
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1035 * @at: Allocate at MSI-X index.
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1036 * @nvec: Number of vectors to allocate
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1037 *
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1038 * Expand the MSI-X vectors of a device after an initial enablement and
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1039 * allocation.
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1040 *
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1041 * Return: 0 if the allocation was successful, an error code otherwise.
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1042 */
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1043 int pci_msix_expand_vectors_at(struct pci_dev *dev, unsigned int at, unsigned int nvec)
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1044 {
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1045 struct msi_range range = MSI_RANGE_LINEAR(at, nvec);
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 @1046 struct msi_device_data *md = dev->dev.msi.data;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1047 unsigned int max_vecs;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1048 int ret;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1049
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 @1050 if (!pci_msi_enable || !dev || !dev->msix_enabled || !md)
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1051 return -ENOTSUPP;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1052
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1053 if (!pci_msi_domain_supports_expand(dev))
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1054 return -ENOTSUPP;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1055
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1056 max_vecs = pci_msix_vec_count(dev);
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1057 if (!nvec || nvec > max_vecs)
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1058 return -EINVAL;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1059
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1060 if (at >= max_vecs || nvec > max_vecs - at)
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1061 return -ENOSPC;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1062
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1063 ret = msix_setup_interrupts(dev, dev->msix_base, &range, NULL, NULL, true);
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1064 return ret <= 0 ? ret : -ENOSPC;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1065 }
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1066 EXPORT_SYMBOL_GPL(pci_msix_expand_vectors_at);
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1067
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 4 weeks
drivers/md/bcache/sysfs.c:1102:4: warning: Division by zero [clang-analyzer-core.DivideZero]
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Kees Cook <keescook(a)chromium.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d58071a8a76d779eedab38033ae4c821c30295a5
commit: a52f8a59aef46b59753e583bf4b28fccb069ce64 fortify: Explicitly disable Clang support
date: 9 weeks ago
:::::: branch date: 35 hours ago
:::::: commit date: 9 weeks ago
config: i386-randconfig-c001-20211115 (https://download.01.org/0day-ci/archive/20211130/202111301728.11UuSEgW-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project fbe72e41b99dc7994daac300d208a955be3e4a0a)
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...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a52f8a59aef46b59753e583bf4b28fccb069ce64
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:740:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
sysfs_hprint(btree_cache_size, bch_cache_size(c));
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:740:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
sysfs_hprint(btree_cache_size, bch_cache_size(c));
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:751:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
sysfs_hprint(average_key_size, bch_average_key_size(c));
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:751:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
sysfs_hprint(average_key_size, bch_average_key_size(c));
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:778:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
sysfs_hprint(congested,
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:778:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
sysfs_hprint(congested,
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:1037:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
sysfs_hprint(bucket_size, bucket_bytes(ca));
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:1037:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
sysfs_hprint(bucket_size, bucket_bytes(ca));
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:1038:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
sysfs_hprint(block_size, block_bytes(ca));
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:1038:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
sysfs_hprint(block_size, block_bytes(ca));
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:1041:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
sysfs_hprint(written, atomic_long_read(&ca->sectors_written) << 9);
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:1041:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
sysfs_hprint(written, atomic_long_read(&ca->sectors_written) << 9);
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:1042:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
sysfs_hprint(btree_written,
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:1042:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
sysfs_hprint(btree_written,
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:1044:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
sysfs_hprint(metadata_written,
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
drivers/md/bcache/sysfs.c:1044:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
sysfs_hprint(metadata_written,
^
drivers/md/bcache/sysfs.h:67:3: note: expanded from macro 'sysfs_hprint'
strcat(buf, "\n"); \
^~~~~~
>> drivers/md/bcache/sysfs.c:1102:4: warning: Division by zero [clang-analyzer-core.DivideZero]
do_div(sum, n);
^
arch/x86/include/asm/div64.h:33:21: note: expanded from macro 'do_div'
__upper = __high % (__base); \
~~~~~~~^~~~~~~~~~
drivers/md/bcache/sysfs.c:1035:21: note: Left side of '&&' is false
struct cache *ca = container_of(kobj, struct cache, kobj);
^
include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/md/bcache/sysfs.c:1035:21: note: '?' condition is true
struct cache *ca = container_of(kobj, struct cache, kobj);
^
include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:317:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:297:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
include/linux/compiler.h:56:28: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^
drivers/md/bcache/sysfs.c:1035:21: note: Left side of '&&' is false
struct cache *ca = container_of(kobj, struct cache, kobj);
^
include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/md/bcache/sysfs.c:1035:21: note: Taking false branch
struct cache *ca = container_of(kobj, struct cache, kobj);
^
include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:317:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:305:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:297:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
include/linux/compiler.h:56:23: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
drivers/md/bcache/sysfs.c:1035:21: note: Loop condition is false. Exiting loop
struct cache *ca = container_of(kobj, struct cache, kobj);
^
include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:317:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:305:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:295:2: note: expanded from macro '__compiletime_assert'
do { \
^
drivers/md/bcache/sysfs.c:1037:2: note: '?' condition is false
sysfs_hprint(bucket_size, bucket_bytes(ca));
^
drivers/md/bcache/sysfs.h:65:2: note: expanded from macro 'sysfs_hprint'
if (attr == &sysfs_ ## file) { \
^
include/linux/compiler.h:56:28: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^
drivers/md/bcache/sysfs.c:1037:2: note: Assuming the condition is false
sysfs_hprint(bucket_size, bucket_bytes(ca));
^
drivers/md/bcache/sysfs.h:65:2: note: expanded from macro 'sysfs_hprint'
if (attr == &sysfs_ ## file) { \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:56:44: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
vim +1102 drivers/md/bcache/sysfs.c
58f913dce2814a Peter Foley 2017-10-13 1032
cafe563591446c Kent Overstreet 2013-03-23 1033 SHOW(__bch_cache)
cafe563591446c Kent Overstreet 2013-03-23 1034 {
cafe563591446c Kent Overstreet 2013-03-23 1035 struct cache *ca = container_of(kobj, struct cache, kobj);
cafe563591446c Kent Overstreet 2013-03-23 1036
cafe563591446c Kent Overstreet 2013-03-23 1037 sysfs_hprint(bucket_size, bucket_bytes(ca));
cafe563591446c Kent Overstreet 2013-03-23 1038 sysfs_hprint(block_size, block_bytes(ca));
cafe563591446c Kent Overstreet 2013-03-23 1039 sysfs_print(nbuckets, ca->sb.nbuckets);
cafe563591446c Kent Overstreet 2013-03-23 1040 sysfs_print(discard, ca->discard);
cafe563591446c Kent Overstreet 2013-03-23 1041 sysfs_hprint(written, atomic_long_read(&ca->sectors_written) << 9);
cafe563591446c Kent Overstreet 2013-03-23 1042 sysfs_hprint(btree_written,
cafe563591446c Kent Overstreet 2013-03-23 1043 atomic_long_read(&ca->btree_sectors_written) << 9);
cafe563591446c Kent Overstreet 2013-03-23 @1044 sysfs_hprint(metadata_written,
cafe563591446c Kent Overstreet 2013-03-23 1045 (atomic_long_read(&ca->meta_sectors_written) +
cafe563591446c Kent Overstreet 2013-03-23 1046 atomic_long_read(&ca->btree_sectors_written)) << 9);
cafe563591446c Kent Overstreet 2013-03-23 1047
cafe563591446c Kent Overstreet 2013-03-23 1048 sysfs_print(io_errors,
cafe563591446c Kent Overstreet 2013-03-23 1049 atomic_read(&ca->io_errors) >> IO_ERROR_SHIFT);
cafe563591446c Kent Overstreet 2013-03-23 1050
cafe563591446c Kent Overstreet 2013-03-23 1051 if (attr == &sysfs_cache_replacement_policy)
169ef1cf6171d3 Kent Overstreet 2013-03-28 1052 return bch_snprint_string_list(buf, PAGE_SIZE,
cafe563591446c Kent Overstreet 2013-03-23 1053 cache_replacement_policies,
cafe563591446c Kent Overstreet 2013-03-23 1054 CACHE_REPLACEMENT(&ca->sb));
cafe563591446c Kent Overstreet 2013-03-23 1055
cafe563591446c Kent Overstreet 2013-03-23 1056 if (attr == &sysfs_priority_stats) {
15754020524a56 Kent Overstreet 2014-02-25 1057 struct bucket *b;
15754020524a56 Kent Overstreet 2014-02-25 1058 size_t n = ca->sb.nbuckets, i;
15754020524a56 Kent Overstreet 2014-02-25 1059 size_t unused = 0, available = 0, dirty = 0, meta = 0;
cafe563591446c Kent Overstreet 2013-03-23 1060 uint64_t sum = 0;
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1061 /* Compute 31 quantiles */
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1062 uint16_t q[31], *p, *cached;
cafe563591446c Kent Overstreet 2013-03-23 1063 ssize_t ret;
cafe563591446c Kent Overstreet 2013-03-23 1064
42bc47b35320e0 Kees Cook 2018-06-12 1065 cached = p = vmalloc(array_size(sizeof(uint16_t),
42bc47b35320e0 Kees Cook 2018-06-12 1066 ca->sb.nbuckets));
cafe563591446c Kent Overstreet 2013-03-23 1067 if (!p)
cafe563591446c Kent Overstreet 2013-03-23 1068 return -ENOMEM;
cafe563591446c Kent Overstreet 2013-03-23 1069
cafe563591446c Kent Overstreet 2013-03-23 1070 mutex_lock(&ca->set->bucket_lock);
15754020524a56 Kent Overstreet 2014-02-25 1071 for_each_bucket(b, ca) {
15754020524a56 Kent Overstreet 2014-02-25 1072 if (!GC_SECTORS_USED(b))
15754020524a56 Kent Overstreet 2014-02-25 1073 unused++;
15754020524a56 Kent Overstreet 2014-02-25 1074 if (GC_MARK(b) == GC_MARK_RECLAIMABLE)
15754020524a56 Kent Overstreet 2014-02-25 1075 available++;
15754020524a56 Kent Overstreet 2014-02-25 1076 if (GC_MARK(b) == GC_MARK_DIRTY)
15754020524a56 Kent Overstreet 2014-02-25 1077 dirty++;
15754020524a56 Kent Overstreet 2014-02-25 1078 if (GC_MARK(b) == GC_MARK_METADATA)
15754020524a56 Kent Overstreet 2014-02-25 1079 meta++;
15754020524a56 Kent Overstreet 2014-02-25 1080 }
15754020524a56 Kent Overstreet 2014-02-25 1081
cafe563591446c Kent Overstreet 2013-03-23 1082 for (i = ca->sb.first_bucket; i < n; i++)
cafe563591446c Kent Overstreet 2013-03-23 1083 p[i] = ca->buckets[i].prio;
cafe563591446c Kent Overstreet 2013-03-23 1084 mutex_unlock(&ca->set->bucket_lock);
cafe563591446c Kent Overstreet 2013-03-23 1085
58f913dce2814a Peter Foley 2017-10-13 1086 sort(p, n, sizeof(uint16_t), __bch_cache_cmp, NULL);
cafe563591446c Kent Overstreet 2013-03-23 1087
cafe563591446c Kent Overstreet 2013-03-23 1088 while (n &&
cafe563591446c Kent Overstreet 2013-03-23 1089 !cached[n - 1])
cafe563591446c Kent Overstreet 2013-03-23 1090 --n;
cafe563591446c Kent Overstreet 2013-03-23 1091
cafe563591446c Kent Overstreet 2013-03-23 1092 while (cached < p + n &&
6751c1e3cff3aa Joe Perches 2021-02-10 1093 *cached == BTREE_PRIO) {
6751c1e3cff3aa Joe Perches 2021-02-10 1094 cached++;
6751c1e3cff3aa Joe Perches 2021-02-10 1095 n--;
6751c1e3cff3aa Joe Perches 2021-02-10 1096 }
cafe563591446c Kent Overstreet 2013-03-23 1097
cafe563591446c Kent Overstreet 2013-03-23 1098 for (i = 0; i < n; i++)
cafe563591446c Kent Overstreet 2013-03-23 1099 sum += INITIAL_PRIO - cached[i];
cafe563591446c Kent Overstreet 2013-03-23 1100
cafe563591446c Kent Overstreet 2013-03-23 1101 if (n)
cafe563591446c Kent Overstreet 2013-03-23 @1102 do_div(sum, n);
cafe563591446c Kent Overstreet 2013-03-23 1103
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1104 for (i = 0; i < ARRAY_SIZE(q); i++)
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1105 q[i] = INITIAL_PRIO - cached[n * (i + 1) /
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1106 (ARRAY_SIZE(q) + 1)];
cafe563591446c Kent Overstreet 2013-03-23 1107
cafe563591446c Kent Overstreet 2013-03-23 1108 vfree(p);
cafe563591446c Kent Overstreet 2013-03-23 1109
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1110 ret = scnprintf(buf, PAGE_SIZE,
cafe563591446c Kent Overstreet 2013-03-23 1111 "Unused: %zu%%\n"
15754020524a56 Kent Overstreet 2014-02-25 1112 "Clean: %zu%%\n"
15754020524a56 Kent Overstreet 2014-02-25 1113 "Dirty: %zu%%\n"
cafe563591446c Kent Overstreet 2013-03-23 1114 "Metadata: %zu%%\n"
cafe563591446c Kent Overstreet 2013-03-23 1115 "Average: %llu\n"
cafe563591446c Kent Overstreet 2013-03-23 1116 "Sectors per Q: %zu\n"
cafe563591446c Kent Overstreet 2013-03-23 1117 "Quantiles: [",
cafe563591446c Kent Overstreet 2013-03-23 1118 unused * 100 / (size_t) ca->sb.nbuckets,
15754020524a56 Kent Overstreet 2014-02-25 1119 available * 100 / (size_t) ca->sb.nbuckets,
15754020524a56 Kent Overstreet 2014-02-25 1120 dirty * 100 / (size_t) ca->sb.nbuckets,
15754020524a56 Kent Overstreet 2014-02-25 1121 meta * 100 / (size_t) ca->sb.nbuckets, sum,
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1122 n * ca->sb.bucket_size / (ARRAY_SIZE(q) + 1));
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1123
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1124 for (i = 0; i < ARRAY_SIZE(q); i++)
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1125 ret += scnprintf(buf + ret, PAGE_SIZE - ret,
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1126 "%u ", q[i]);
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1127 ret--;
cafe563591446c Kent Overstreet 2013-03-23 1128
bbc77aa7fb72e6 Kent Overstreet 2013-05-28 1129 ret += scnprintf(buf + ret, PAGE_SIZE - ret, "]\n");
cafe563591446c Kent Overstreet 2013-03-23 1130
cafe563591446c Kent Overstreet 2013-03-23 1131 return ret;
cafe563591446c Kent Overstreet 2013-03-23 1132 }
cafe563591446c Kent Overstreet 2013-03-23 1133
cafe563591446c Kent Overstreet 2013-03-23 1134 return 0;
cafe563591446c Kent Overstreet 2013-03-23 1135 }
cafe563591446c Kent Overstreet 2013-03-23 1136 SHOW_LOCKED(bch_cache)
cafe563591446c Kent Overstreet 2013-03-23 1137
:::::: The code at line 1102 was first introduced by commit
:::::: cafe563591446cf80bfbc2fe3bc72a2e36cf1060 bcache: A block layer cache
:::::: TO: Kent Overstreet <koverstreet(a)google.com>
:::::: CC: Kent Overstreet <koverstreet(a)google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months, 4 weeks