diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-05-27 21:40:08 +0200 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-05-30 13:07:58 +0200 |
commit | bb269633f3da56ec65e4e5aa9d9fca0ef8b3d373 (patch) | |
tree | 2d7269c57c3d22e4cc13b99210ba1d1b51b16e5b /drivers/net/ethernet/cavium | |
parent | d20dd0ea14072e8a90ff864b2c1603bd68920b4b (diff) | |
download | linux-bb269633f3da56ec65e4e5aa9d9fca0ef8b3d373.tar.gz linux-bb269633f3da56ec65e4e5aa9d9fca0ef8b3d373.tar.bz2 linux-bb269633f3da56ec65e4e5aa9d9fca0ef8b3d373.zip |
liquidio: Use vzalloc()
Use vzalloc() instead of hand writing it with vmalloc()+memset().
This is less verbose.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/93b010824d9d92376e8d49b9eb396a0fa0c0ac80.1685216322.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/cavium')
-rw-r--r-- | drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c index 9ed3d1ab2ca5..285d3825cad3 100644 --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c @@ -719,12 +719,10 @@ static int cn23xx_setup_pf_mbox(struct octeon_device *oct) for (i = 0; i < oct->sriov_info.max_vfs; i++) { q_no = i * oct->sriov_info.rings_per_vf; - mbox = vmalloc(sizeof(*mbox)); + mbox = vzalloc(sizeof(*mbox)); if (!mbox) goto free_mbox; - memset(mbox, 0, sizeof(struct octeon_mbox)); - spin_lock_init(&mbox->lock); mbox->oct_dev = oct; diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c index fda49404968c..b3bd2767d3dd 100644 --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c @@ -279,12 +279,10 @@ static int cn23xx_setup_vf_mbox(struct octeon_device *oct) { struct octeon_mbox *mbox = NULL; - mbox = vmalloc(sizeof(*mbox)); + mbox = vzalloc(sizeof(*mbox)); if (!mbox) return 1; - memset(mbox, 0, sizeof(struct octeon_mbox)); - spin_lock_init(&mbox->lock); mbox->oct_dev = oct; |