Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'add-missing-netlink-error-message-macros-to-coccinelle-test'

Gal Pressman says:

====================
Add missing netlink error message macros to coccinelle test

The newline_in_nl_msg.cocci test is missing some variants in the list of
checked macros, add them and fix all reported issues.
====================

Link: https://patch.msgid.link/20250226093904.6632-1-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+26 -23
+7 -7
drivers/net/ethernet/intel/ice/ice_dpll.c
··· 95 95 } 96 96 if (ret) { 97 97 NL_SET_ERR_MSG_FMT(extack, 98 - "err:%d %s failed to set pin freq:%u on pin:%u\n", 98 + "err:%d %s failed to set pin freq:%u on pin:%u", 99 99 ret, 100 100 ice_aq_str(pf->hw.adminq.sq_last_status), 101 101 freq, pin->idx); ··· 322 322 } 323 323 if (ret) 324 324 NL_SET_ERR_MSG_FMT(extack, 325 - "err:%d %s failed to enable %s pin:%u\n", 325 + "err:%d %s failed to enable %s pin:%u", 326 326 ret, ice_aq_str(hw->adminq.sq_last_status), 327 327 pin_type_name[pin_type], pin->idx); 328 328 ··· 367 367 } 368 368 if (ret) 369 369 NL_SET_ERR_MSG_FMT(extack, 370 - "err:%d %s failed to disable %s pin:%u\n", 370 + "err:%d %s failed to disable %s pin:%u", 371 371 ret, ice_aq_str(hw->adminq.sq_last_status), 372 372 pin_type_name[pin_type], pin->idx); 373 373 ··· 479 479 err: 480 480 if (extack) 481 481 NL_SET_ERR_MSG_FMT(extack, 482 - "err:%d %s failed to update %s pin:%u\n", 482 + "err:%d %s failed to update %s pin:%u", 483 483 ret, 484 484 ice_aq_str(pf->hw.adminq.sq_last_status), 485 485 pin_type_name[pin_type], pin->idx); ··· 518 518 (u8)prio); 519 519 if (ret) 520 520 NL_SET_ERR_MSG_FMT(extack, 521 - "err:%d %s failed to set pin prio:%u on pin:%u\n", 521 + "err:%d %s failed to set pin prio:%u on pin:%u", 522 522 ret, 523 523 ice_aq_str(pf->hw.adminq.sq_last_status), 524 524 prio, pin->idx); ··· 1004 1004 mutex_unlock(&pf->dplls.lock); 1005 1005 if (ret) 1006 1006 NL_SET_ERR_MSG_FMT(extack, 1007 - "err:%d %s failed to set pin phase_adjust:%d for pin:%u on dpll:%u\n", 1007 + "err:%d %s failed to set pin phase_adjust:%d for pin:%u on dpll:%u", 1008 1008 ret, 1009 1009 ice_aq_str(pf->hw.adminq.sq_last_status), 1010 1010 phase_adjust, p->idx, d->dpll_idx); ··· 1362 1362 &p->freq); 1363 1363 if (ret) 1364 1364 NL_SET_ERR_MSG_FMT(extack, 1365 - "err:%d %s failed to set pin state:%u for pin:%u on parent:%u\n", 1365 + "err:%d %s failed to set pin state:%u for pin:%u on parent:%u", 1366 1366 ret, 1367 1367 ice_aq_str(pf->hw.adminq.sq_last_status), 1368 1368 state, p->idx, parent->idx);
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/dpll.c
··· 242 242 return 0; 243 243 } 244 244 errout: 245 - NL_SET_ERR_MSG_MOD(extack, "Invalid clock quality level obtained from firmware\n"); 245 + NL_SET_ERR_MSG_MOD(extack, "Invalid clock quality level obtained from firmware"); 246 246 return -EINVAL; 247 247 } 248 248
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c
··· 140 140 gbp_mask = (u32 *)&enc_opts.mask->data[0]; 141 141 142 142 if (*gbp_mask & ~VXLAN_GBP_MASK) { 143 - NL_SET_ERR_MSG_FMT_MOD(extack, "Wrong VxLAN GBP mask(0x%08X)\n", *gbp_mask); 143 + NL_SET_ERR_MSG_FMT_MOD(extack, "Wrong VxLAN GBP mask(0x%08X)", *gbp_mask); 144 144 return -EINVAL; 145 145 } 146 146
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
··· 2026 2026 if (size_read < 0) { 2027 2027 NL_SET_ERR_MSG_FMT_MOD( 2028 2028 extack, 2029 - "Query module eeprom by page failed, read %u bytes, err %d\n", 2029 + "Query module eeprom by page failed, read %u bytes, err %d", 2030 2030 i, size_read); 2031 2031 return i; 2032 2032 }
+3 -3
drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
··· 1863 1863 "Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)\n", 1864 1864 addr, vport_num); 1865 1865 NL_SET_ERR_MSG_FMT_MOD(extack, 1866 - "Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)\n", 1866 + "Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)", 1867 1867 addr, vport_num); 1868 1868 return -EINVAL; 1869 1869 } ··· 1876 1876 "Failed to lookup bridge port vlan metadata to create MDB (MAC=%pM,vid=%u,vport=%u)\n", 1877 1877 addr, vid, vport_num); 1878 1878 NL_SET_ERR_MSG_FMT_MOD(extack, 1879 - "Failed to lookup vlan metadata for MDB (MAC=%pM,vid=%u,vport=%u)\n", 1879 + "Failed to lookup vlan metadata for MDB (MAC=%pM,vid=%u,vport=%u)", 1880 1880 addr, vid, vport_num); 1881 1881 return -EINVAL; 1882 1882 } ··· 1884 1884 1885 1885 err = mlx5_esw_bridge_port_mdb_attach(dev, port, addr, vid); 1886 1886 if (err) { 1887 - NL_SET_ERR_MSG_FMT_MOD(extack, "Failed to add MDB (MAC=%pM,vid=%u,vport=%u)\n", 1887 + NL_SET_ERR_MSG_FMT_MOD(extack, "Failed to add MDB (MAC=%pM,vid=%u,vport=%u)", 1888 1888 addr, vid, vport_num); 1889 1889 return err; 1890 1890 }
+1 -1
drivers/net/ethernet/sfc/mae.c
··· 755 755 rc = efx_mae_match_check_cap_typ(supported_fields[MAE_FIELD_INGRESS_PORT], 756 756 ingress_port_mask_type); 757 757 if (rc) { 758 - NL_SET_ERR_MSG_FMT_MOD(extack, "No support for %s mask in field %s\n", 758 + NL_SET_ERR_MSG_FMT_MOD(extack, "No support for %s mask in field %s", 759 759 mask_type_name(ingress_port_mask_type), 760 760 "ingress_port"); 761 761 return rc;
+3 -3
drivers/net/ethernet/sfc/tc.c
··· 1043 1043 return -EOPNOTSUPP; 1044 1044 } 1045 1045 if (fa->ct.action) { 1046 - NL_SET_ERR_MSG_FMT_MOD(extack, "Unhandled ct.action %u for LHS rule\n", 1046 + NL_SET_ERR_MSG_FMT_MOD(extack, "Unhandled ct.action %u for LHS rule", 1047 1047 fa->ct.action); 1048 1048 return -EOPNOTSUPP; 1049 1049 } ··· 1056 1056 act->zone = ct_zone; 1057 1057 break; 1058 1058 default: 1059 - NL_SET_ERR_MSG_FMT_MOD(extack, "Unhandled action %u for LHS rule\n", 1059 + NL_SET_ERR_MSG_FMT_MOD(extack, "Unhandled action %u for LHS rule", 1060 1060 fa->id); 1061 1061 return -EOPNOTSUPP; 1062 1062 } ··· 1581 1581 1582 1582 type = efx_tc_indr_netdev_type(net_dev); 1583 1583 if (type == EFX_ENCAP_TYPE_NONE) { 1584 - NL_SET_ERR_MSG_MOD(extack, "Egress encap match on unsupported tunnel device\n"); 1584 + NL_SET_ERR_MSG_MOD(extack, "Egress encap match on unsupported tunnel device"); 1585 1585 return -EOPNOTSUPP; 1586 1586 } 1587 1587
+1 -1
net/sched/sch_qfq.c
··· 447 447 448 448 if (q->wsum + delta_w > QFQ_MAX_WSUM) { 449 449 NL_SET_ERR_MSG_FMT_MOD(extack, 450 - "total weight out of range (%d + %u)\n", 450 + "total weight out of range (%d + %u)", 451 451 delta_w, q->wsum); 452 452 return -EINVAL; 453 453 }
+8 -5
scripts/coccinelle/misc/newline_in_nl_msg.cocci
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /// 3 - /// Catch strings ending in newline with GENL_SET_ERR_MSG, NL_SET_ERR_MSG, 4 - /// NL_SET_ERR_MSG_MOD. 3 + /// Catch strings ending in newline with (GE)NL_SET_ERR_MSG*. 5 4 /// 6 5 // Confidence: Very High 7 6 // Copyright: (C) 2020 Intel Corporation ··· 16 17 constant m; 17 18 position p; 18 19 @@ 19 - \(GENL_SET_ERR_MSG\|NL_SET_ERR_MSG\|NL_SET_ERR_MSG_MOD\)(e,m@p) 20 + \(GENL_SET_ERR_MSG\|GENL_SET_ERR_MSG_FMT\|NL_SET_ERR_MSG\|NL_SET_ERR_MSG_MOD\| 21 + NL_SET_ERR_MSG_FMT\|NL_SET_ERR_MSG_FMT_MOD\|NL_SET_ERR_MSG_WEAK\| 22 + NL_SET_ERR_MSG_WEAK_MOD\|NL_SET_ERR_MSG_ATTR_POL\| 23 + NL_SET_ERR_MSG_ATTR_POL_FMT\|NL_SET_ERR_MSG_ATTR\| 24 + NL_SET_ERR_MSG_ATTR_FMT\)(e,m@p,...) 20 25 21 26 @script:python@ 22 27 m << r.m; ··· 35 32 constant r.m; 36 33 position r.p; 37 34 @@ 38 - fname(e,m@p) 35 + fname(e,m@p,...) 39 36 40 37 //---------------------------------------------------------- 41 38 // For context mode ··· 46 43 expression r.e; 47 44 constant r.m; 48 45 @@ 49 - * fname(e,m) 46 + * fname(e,m,...) 50 47 51 48 //---------------------------------------------------------- 52 49 // For org mode