Re: [PATCH net-next v1 2/7] net: hsr: replace fallthrough comments with fallthrough macro

kernel test robot
2026-03-26T22:16:25Z

Hi,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url: https://github.com/intel-lab-lkp/linux/commits/luka-gejak-linux-dev/net-hsr-constify-hsr_ops-and-prp_ops-protocol-operation-structures/20260326-143638
base: net-next/main
patch link: https://lore.kernel.org/r/20260324144630.189094-3-luka.gejak%40linux.dev
patch subject: [PATCH net-next v1 2/7] net: hsr: replace fallthrough comments with fallthrough macro
config: i386-randconfig-001-20260327 (https://download.01.org/0day-ci/archive/20260327/202603270658.FJCTgZee-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260327/202603270658.FJCTgZee-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603270658.FJCTgZee-lkp@intel.com/

All errors (new ones prefixed by >>):

>> net/hsr/hsr_netlink.c:436:2: error: fallthrough annotation is outside switch statement
436 | fallthrough;
| ^
include/linux/compiler_attributes.h:214:56: note: expanded from macro 'fallthrough'
214 | # define fallthrough __attribute__((__fallthrough__))
| ^
net/hsr/hsr_netlink.c:527:2: error: fallthrough annotation is outside switch statement
527 | fallthrough;
| ^
include/linux/compiler_attributes.h:214:56: note: expanded from macro 'fallthrough'
214 | # define fallthrough __attribute__((__fallthrough__))
| ^
2 errors generated.

vim +436 net/hsr/hsr_netlink.c

300
301 /* HSR_C_GET_NODE_STATUS lets userspace query the internal HSR node table
302 * about the status of a specific node in the network, defined by its MAC
303 * address.
304 *
305 * Input: hsr ifindex, node mac address
306 * Output: hsr ifindex, node mac address (copied from request),
307 * age of latest frame from node over slave 1, slave 2 [ms]
308 */
309 static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
310 {
311 /* For receiving */
312 struct nlattr *na;
313 struct net_device *hsr_dev;
314
315 /* For sending */
316 struct sk_buff *skb_out;
317 void *msg_head;
318 struct hsr_priv *hsr;
319 struct hsr_port *port;
320 unsigned char hsr_node_addr_b[ETH_ALEN];
321 int hsr_node_if1_age;
322 u16 hsr_node_if1_seq;
323 int hsr_node_if2_age;
324 u16 hsr_node_if2_seq;
325 int addr_b_ifindex;
326 int res;
327
328 if (!info)
329 goto invalid;
330
331 na = info->attrs[HSR_A_IFINDEX];
332 if (!na)
333 goto invalid;
334 na = info->attrs[HSR_A_NODE_ADDR];
335 if (!na)
336 goto invalid;
337
338 rcu_read_lock();
339 hsr_dev = dev_get_by_index_rcu(genl_info_net(info),
340 nla_get_u32(info->attrs[HSR_A_IFINDEX]));
341 if (!hsr_dev)
342 goto rcu_unlock;
343 if (!is_hsr_master(hsr_dev))
344 goto rcu_unlock;
345
346 /* Send reply */
347 skb_out = genlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC);
348 if (!skb_out) {
349 res = -ENOMEM;
350 goto fail;
351 }
352
353 msg_head = genlmsg_put(skb_out, NETLINK_CB(skb_in).portid,
354 info->snd_seq, &hsr_genl_family, 0,
355 HSR_C_SET_NODE_STATUS);
356 if (!msg_head) {
357 res = -ENOMEM;
358 goto nla_put_failure;
359 }
360
361 res = nla_put_u32(skb_out, HSR_A_IFINDEX, hsr_dev->ifindex);
362 if (res < 0)
363 goto nla_put_failure;
364
365 hsr = netdev_priv(hsr_dev);
366 res = hsr_get_node_data(hsr,
367 (unsigned char *)
368 nla_data(info->attrs[HSR_A_NODE_ADDR]),
369 hsr_node_addr_b,
370 &addr_b_ifindex,
371 &hsr_node_if1_age,
372 &hsr_node_if1_seq,
373 &hsr_node_if2_age,
374 &hsr_node_if2_seq);
375 if (res < 0)
376 goto nla_put_failure;
377
378 res = nla_put(skb_out, HSR_A_NODE_ADDR, ETH_ALEN,
379 nla_data(info->attrs[HSR_A_NODE_ADDR]));
380 if (res < 0)
381 goto nla_put_failure;
382
383 if (addr_b_ifindex > -1) {
384 res = nla_put(skb_out, HSR_A_NODE_ADDR_B, ETH_ALEN,
385 hsr_node_addr_b);
386 if (res < 0)
387 goto nla_put_failure;
388
389 res = nla_put_u32(skb_out, HSR_A_ADDR_B_IFINDEX,
390 addr_b_ifindex);
391 if (res < 0)
392 goto nla_put_failure;
393 }
394
395 res = nla_put_u32(skb_out, HSR_A_IF1_AGE, hsr_node_if1_age);
396 if (res < 0)
397 goto nla_put_failure;
398 res = nla_put_u16(skb_out, HSR_A_IF1_SEQ, hsr_node_if1_seq);
399 if (res < 0)
400 goto nla_put_failure;
401 port = hsr_port_get_hsr(hsr, HSR_PT_SLAVE_A);
402 if (port)
403 res = nla_put_u32(skb_out, HSR_A_IF1_IFINDEX,
404 port->dev->ifindex);
405 if (res < 0)
406 goto nla_put_failure;
407
408 res = nla_put_u32(skb_out, HSR_A_IF2_AGE, hsr_node_if2_age);
409 if (res < 0)
410 goto nla_put_failure;
411 res = nla_put_u16(skb_out, HSR_A_IF2_SEQ, hsr_node_if2_seq);
412 if (res < 0)
413 goto nla_put_failure;
414 port = hsr_port_get_hsr(hsr, HSR_PT_SLAVE_B);
415 if (port)
416 res = nla_put_u32(skb_out, HSR_A_IF2_IFINDEX,
417 port->dev->ifindex);
418 if (res < 0)
419 goto nla_put_failure;
420
421 rcu_read_unlock();
422
423 genlmsg_end(skb_out, msg_head);
424 genlmsg_unicast(genl_info_net(info), skb_out, info->snd_portid);
425
426 return 0;
427
428 rcu_unlock:
429 rcu_read_unlock();
430 invalid:
431 netlink_ack(skb_in, nlmsg_hdr(skb_in), -EINVAL, NULL);
432 return 0;
433
434 nla_put_failure:
435 kfree_skb(skb_out);
> 436 fallthrough;
437
438 fail:
439 rcu_read_unlock();
440 return res;
441 }
442

--
0-DAY CI Kernel Test Service