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 'net-pktgen-fix-checkpatch-code-style-errors-warnings'

Peter Seiderer says:

====================
net: pktgen: fix checkpatch code style errors/warnings

Fix checkpatch detected code style errors/warnings detected in
the file net/core/pktgen.c (remaining checkpatch checks will be addressed
in a follow up patch set).
====================

Link: https://patch.msgid.link/20250415112916.113455-1-ps.report@gmx.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+10 -14
+10 -14
net/core/pktgen.c
··· 227 227 228 228 /* Xmit modes */ 229 229 #define M_START_XMIT 0 /* Default normal TX */ 230 - #define M_NETIF_RECEIVE 1 /* Inject packets into stack */ 230 + #define M_NETIF_RECEIVE 1 /* Inject packets into stack */ 231 231 #define M_QUEUE_XMIT 2 /* Inject packet into qdisc */ 232 232 233 233 /* If lock -- protects updating of if_list */ ··· 1313 1313 put_page(pkt_dev->page); 1314 1314 pkt_dev->page = NULL; 1315 1315 } 1316 - } 1317 - else 1316 + } else { 1318 1317 sprintf(pg_result, "ERROR: node not possible"); 1318 + } 1319 1319 return count; 1320 1320 } 1321 1321 if (!strcmp(name, "xmit_mode")) { ··· 1419 1419 return -EFAULT; 1420 1420 buf[len] = 0; 1421 1421 if (strcmp(buf, pkt_dev->dst_min) != 0) { 1422 - memset(pkt_dev->dst_min, 0, sizeof(pkt_dev->dst_min)); 1423 - strcpy(pkt_dev->dst_min, buf); 1422 + strscpy_pad(pkt_dev->dst_min, buf); 1424 1423 pkt_dev->daddr_min = in_aton(pkt_dev->dst_min); 1425 1424 pkt_dev->cur_daddr = pkt_dev->daddr_min; 1426 1425 } ··· 1439 1440 return -EFAULT; 1440 1441 buf[len] = 0; 1441 1442 if (strcmp(buf, pkt_dev->dst_max) != 0) { 1442 - memset(pkt_dev->dst_max, 0, sizeof(pkt_dev->dst_max)); 1443 - strcpy(pkt_dev->dst_max, buf); 1443 + strscpy_pad(pkt_dev->dst_max, buf); 1444 1444 pkt_dev->daddr_max = in_aton(pkt_dev->dst_max); 1445 1445 pkt_dev->cur_daddr = pkt_dev->daddr_max; 1446 1446 } ··· 1548 1550 return -EFAULT; 1549 1551 buf[len] = 0; 1550 1552 if (strcmp(buf, pkt_dev->src_min) != 0) { 1551 - memset(pkt_dev->src_min, 0, sizeof(pkt_dev->src_min)); 1552 - strcpy(pkt_dev->src_min, buf); 1553 + strscpy_pad(pkt_dev->src_min, buf); 1553 1554 pkt_dev->saddr_min = in_aton(pkt_dev->src_min); 1554 1555 pkt_dev->cur_saddr = pkt_dev->saddr_min; 1555 1556 } ··· 1568 1571 return -EFAULT; 1569 1572 buf[len] = 0; 1570 1573 if (strcmp(buf, pkt_dev->src_max) != 0) { 1571 - memset(pkt_dev->src_max, 0, sizeof(pkt_dev->src_max)); 1572 - strcpy(pkt_dev->src_max, buf); 1574 + strscpy_pad(pkt_dev->src_max, buf); 1573 1575 pkt_dev->saddr_max = in_aton(pkt_dev->src_max); 1574 1576 pkt_dev->cur_saddr = pkt_dev->saddr_max; 1575 1577 } ··· 3224 3228 3225 3229 set_pkt_overhead(pkt_dev); 3226 3230 3227 - strcpy(pkt_dev->result, "Starting"); 3231 + strscpy(pkt_dev->result, "Starting"); 3228 3232 pkt_dev->running = 1; /* Cranke yeself! */ 3229 3233 started++; 3230 3234 } else 3231 - strcpy(pkt_dev->result, "Error starting"); 3235 + strscpy(pkt_dev->result, "Error starting"); 3232 3236 } 3233 3237 rcu_read_unlock(); 3234 3238 if (started) ··· 3842 3846 if (!pkt_dev) 3843 3847 return -ENOMEM; 3844 3848 3845 - strcpy(pkt_dev->odevname, ifname); 3849 + strscpy(pkt_dev->odevname, ifname); 3846 3850 pkt_dev->flows = vzalloc_node(array_size(MAX_CFLOWS, 3847 3851 sizeof(struct flow_state)), 3848 3852 node);