Re: [PATCH 4/5] IB/nes: Delete unnecessary braces

From: Joe Perches
Date: Mon Mar 06 2017 - 13:39:51 EST


On Mon, 2017-03-06 at 18:43 +0100, SF Markus Elfring wrote:
> Do not use curly brackets at some source code places
> where a single statement should be sufficient.
[]
> diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
[]
> @@ -137,11 +136,7 @@ static struct ib_mw *nes_alloc_mw(struct ib_pd *ibpd, enum ib_mw_type type,
> nes_put_cqp_request(nesdev, cqp_request);
> kfree(nesmr);
> nes_free_resource(nesadapter, nesadapter->allocated_mrs, stag_index);
> - if (!ret) {
> - return ERR_PTR(-ETIME);
> - } else {
> - return ERR_PTR(-ENOMEM);
> - }
> + return ERR_PTR(ret ? -ENOMEM : -ETIME);

Using a goto error label for this block would
probably be more common kernel style ere.