]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbe: use kzalloc for allocating one thing
authorManinder Singh <maninder1.s@samsung.com>
Fri, 19 Jun 2015 04:07:55 +0000 (09:37 +0530)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Mon, 12 Oct 2015 16:04:58 +0000 (09:04 -0700)
Orabug: 21918732

Use kzalloc rather than kcalloc(1..

The semantic patch that makes this change is as follows:

// <smpl>
@@
@@

- kcalloc(1,
+ kzalloc(
          ...)
// </smpl>

and removing checkpatch below CHECK:
CHECK: Prefer kzalloc(sizeof(*fwd_adapter)...) over
kzalloc(sizeof(struct ixgbe_fwd_adapter)...)

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Reviewed-by: Vaneet Narang <v.narang@samsung.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bc52f951e344b2ec64388c71890d88c5fc154a41)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 3e66c44b8fb73f82eae27316a111981ad0298e5a..f5fe29f4959b2ce919f53e627662e23753b53096 100644 (file)
@@ -8254,7 +8254,7 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
            (adapter->num_rx_pools > IXGBE_MAX_MACVLANS))
                return ERR_PTR(-EBUSY);
 
-       fwd_adapter = kcalloc(1, sizeof(struct ixgbe_fwd_adapter), GFP_KERNEL);
+       fwd_adapter = kzalloc(sizeof(*fwd_adapter), GFP_KERNEL);
        if (!fwd_adapter)
                return ERR_PTR(-ENOMEM);