From cadae4772d2cdfac21fd86975d3860eff38c7e51 Mon Sep 17 00:00:00 2001 From: Lorenzo Bianconi Date: Mon, 4 Mar 2019 13:59:49 +0100 Subject: [PATCH] mt76: usb: reduce code indentation in mt76u_alloc_tx Improve code readability reducing code indentation in mt76u_alloc_tx Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/usb.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c index 65b0c244307f..27896a435d6c 100644 --- a/drivers/net/wireless/mediatek/mt76/usb.c +++ b/drivers/net/wireless/mediatek/mt76/usb.c @@ -818,15 +818,14 @@ static int mt76u_alloc_tx(struct mt76_dev *dev) if (!buf->urb) return -ENOMEM; - if (dev->usb.sg_en) { - size_t size = MT_SG_MAX_SIZE * - sizeof(struct scatterlist); - - buf->urb->sg = devm_kzalloc(dev->dev, size, - GFP_KERNEL); - if (!buf->urb->sg) - return -ENOMEM; - } + if (!dev->usb.sg_en) + continue; + + buf->urb->sg = devm_kcalloc(dev->dev, MT_SG_MAX_SIZE, + sizeof(struct scatterlist), + GFP_KERNEL); + if (!buf->urb->sg) + return -ENOMEM; } } return 0; -- GitLab