net: use 32-bit arithmetic while allocating net device
authorAlexey Dobriyan <adobriyan@gmail.com>
Thu, 21 Sep 2017 20:33:29 +0000 (23:33 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Sep 2017 04:25:52 +0000 (21:25 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index fb766d906148e7d1e85a654eaf6048c1cdf49364..37d6a3c59e69cf799c2782642ce1101ef3968c29 100644 (file)
@@ -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));