dev.c (9ff17e6bdaa50892dd9bdb1b116cb71b73dd711a) dev.c (b6d7c0eb2dcbd238fa233a3a1737654e380e784a)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * NET3 Protocol independent device support routines.
4 *
5 * Derived from the non IP parts of dev.c 1.0.19
6 * Authors: Ross Biro
7 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
8 * Mark Evans, <evansmp@uhura.aston.ac.uk>

--- 10616 unchanged lines hidden (view full) ---

10625
10626 p = kvzalloc(alloc_size, GFP_KERNEL_ACCOUNT | __GFP_RETRY_MAYFAIL);
10627 if (!p)
10628 return NULL;
10629
10630 dev = PTR_ALIGN(p, NETDEV_ALIGN);
10631 dev->padded = (char *)dev - (char *)p;
10632
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * NET3 Protocol independent device support routines.
4 *
5 * Derived from the non IP parts of dev.c 1.0.19
6 * Authors: Ross Biro
7 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
8 * Mark Evans, <evansmp@uhura.aston.ac.uk>

--- 10616 unchanged lines hidden (view full) ---

10625
10626 p = kvzalloc(alloc_size, GFP_KERNEL_ACCOUNT | __GFP_RETRY_MAYFAIL);
10627 if (!p)
10628 return NULL;
10629
10630 dev = PTR_ALIGN(p, NETDEV_ALIGN);
10631 dev->padded = (char *)dev - (char *)p;
10632
10633 ref_tracker_dir_init(&dev->refcnt_tracker, 128);
10633 ref_tracker_dir_init(&dev->refcnt_tracker, 128, name);
10634#ifdef CONFIG_PCPU_DEV_REFCNT
10635 dev->pcpu_refcnt = alloc_percpu(int);
10636 if (!dev->pcpu_refcnt)
10637 goto free_dev;
10638 __dev_hold(dev);
10639#else
10640 refcount_set(&dev->dev_refcnt, 1);
10641#endif

--- 845 unchanged lines hidden ---
10634#ifdef CONFIG_PCPU_DEV_REFCNT
10635 dev->pcpu_refcnt = alloc_percpu(int);
10636 if (!dev->pcpu_refcnt)
10637 goto free_dev;
10638 __dev_hold(dev);
10639#else
10640 refcount_set(&dev->dev_refcnt, 1);
10641#endif

--- 845 unchanged lines hidden ---