[dpdk-dev] [PATCH 03/10] bus/dpaa: fix management command init calling
Andrew Rybchenko
andrew.rybchenko at oktetlabs.ru
Tue Apr 20 11:35:31 CEST 2021
On 4/19/21 4:34 PM, Min Hu (Connor) wrote:
> 'bm_mc_init' only return 0, but the function whicl calls int
> check the negative ret, and this is redundant.
>
> This patch fixed it by not checking the return value.
>
> Fixes: f38f61e982f8 ("bus/dpaa: add BMAN hardware interfaces")
> Cc: stable at dpdk.org
>
> Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
> ---
> drivers/bus/dpaa/base/qbman/bman.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/bus/dpaa/base/qbman/bman.c b/drivers/bus/dpaa/base/qbman/bman.c
> index 8a62907..e1ba2a8 100644
> --- a/drivers/bus/dpaa/base/qbman/bman.c
> +++ b/drivers/bus/dpaa/base/qbman/bman.c
> @@ -70,10 +70,8 @@ struct bman_portal *bman_create_portal(struct bman_portal *portal,
> pr_err("Bman RCR initialisation failed\n");
> return NULL;
> }
> - if (bm_mc_init(p)) {
> - pr_err("Bman MC initialisation failed\n");
> - goto fail_mc;
> - }
> + (void)bm_mc_init(p);
> +
As I understand compiler can do it for you and there is no
point to break the code in the case of future changes if
bm_mc_init() starts to return errors.
> portal->pools = kmalloc(2 * sizeof(*pools), GFP_KERNEL);
> if (!portal->pools)
> goto fail_pools;
>
More information about the dev
mailing list