* [PATCH] net: use 32-bit arithmetic while allocating net device
@ 2017-09-21 20:33 Alexey Dobriyan
2017-09-23 4:26 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2017-09-21 20:33 UTC (permalink / raw)
To: davem; +Cc: netdev
Private part of allocation is never big enough to warrant size_t.
Space savings:
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-10 (-10)
function old new delta
alloc_netdev_mqs 1120 1110 -10
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7989,7 +7989,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
unsigned int txqs, unsigned int rxqs)
{
struct net_device *dev;
- size_t alloc_size;
+ unsigned int alloc_size;
struct net_device *p;
BUG_ON(strlen(name) >= sizeof(dev->name));
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net: use 32-bit arithmetic while allocating net device
2017-09-21 20:33 [PATCH] net: use 32-bit arithmetic while allocating net device Alexey Dobriyan
@ 2017-09-23 4:26 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-09-23 4:26 UTC (permalink / raw)
To: adobriyan; +Cc: netdev
From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Thu, 21 Sep 2017 23:33:29 +0300
> Private part of allocation is never big enough to warrant size_t.
>
> Space savings:
>
> add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-10 (-10)
> function old new delta
> alloc_netdev_mqs 1120 1110 -10
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Applied to net-next.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-23 4:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-21 20:33 [PATCH] net: use 32-bit arithmetic while allocating net device Alexey Dobriyan
2017-09-23 4:26 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.