mt76: usb: reduce code indentation in mt76u_alloc_tx
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Lorenzo Bianconi
maintainerPATCH v2 1/1 mt76: usb: reduce code indentation in mt76u_alloc_tx
Improve code readability reducing code indentation in mt76u_alloc_tx
Signed-off-by Lorenzo Bianconi <[email protected]>
---
Changes since v1:
- use devm_kcalloc instead of devm_kzalloc and get rid of size
--- drivers/net/wireless/mediatek/mt76/usb.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/net/wireless/mediatek/mt76/usb.c +8 -9
@@ -810,15 +810,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 ;
Signature · 1 line
2.20.1
Quoted 4 lines · Lorenzo Bianconi
Improve code readability reducing code indentation in
mt76u_alloc_txSigned-off-by Lorenzo Bianconi <[email protected]>
Applied, thanks.
- Felix