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.

net/sched: Use TC_RTAB_SIZE instead of magic number

Replace magic number with TC_RTAB_SIZE to make it more informative.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://patch.msgid.link/20250813125526.853895-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Yue Haibing and committed by
Jakub Kicinski
eeea7688 4b6dc4c8

+2 -2
+2 -2
net/sched/sch_api.c
··· 431 431 432 432 for (rtab = qdisc_rtab_list; rtab; rtab = rtab->next) { 433 433 if (!memcmp(&rtab->rate, r, sizeof(struct tc_ratespec)) && 434 - !memcmp(&rtab->data, nla_data(tab), 1024)) { 434 + !memcmp(&rtab->data, nla_data(tab), TC_RTAB_SIZE)) { 435 435 rtab->refcnt++; 436 436 return rtab; 437 437 } ··· 441 441 if (rtab) { 442 442 rtab->rate = *r; 443 443 rtab->refcnt = 1; 444 - memcpy(rtab->data, nla_data(tab), 1024); 444 + memcpy(rtab->data, nla_data(tab), TC_RTAB_SIZE); 445 445 if (r->linklayer == TC_LINKLAYER_UNAWARE) 446 446 r->linklayer = __detect_linklayer(r, rtab->data); 447 447 rtab->next = qdisc_rtab_list;