[PATCH] common/cnxk: fix incorrect error checking

Tomasz Duszynski tomasz.duszynski at octakon.com
Fri Jan 21 20:28:47 CET 2022


On Tue, Dec 21, 2021 at 04:02:20PM +0800, Weiguo Li wrote:
> Fixes: 804c108b039a ("common/cnxk: set BPHY IRQ handler")
>
> Signed-off-by: Weiguo Li <liwg06 at foxmail.com>
> ---
>  drivers/common/cnxk/roc_bphy_irq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_bphy_irq.c b/drivers/common/cnxk/roc_bphy_irq.c
> index f4e9b341af..5ba73c98dc 100644
> --- a/drivers/common/cnxk/roc_bphy_irq.c
> +++ b/drivers/common/cnxk/roc_bphy_irq.c
> @@ -261,9 +261,9 @@ roc_bphy_irq_handler_set(struct roc_bphy_irq_chip *chip, int irq_num,
>  	CPU_SET(curr_cpu, &intr_cpuset);
>  	retval = pthread_setaffinity_np(pthread_self(), sizeof(intr_cpuset),
>  					&intr_cpuset);

Use rc instead. This will generate less changes and will match
local conventions.

> -	if (rc < 0) {
> +	if (retval < 0) {
>  		plt_err("Failed to set affinity mask");
> -		return rc;
> +		return retval;
>  	}
>
>  	irq_usr.isr_base = (uint64_t)roc_bphy_intr_handler;
> --
> 2.25.1
>


More information about the dev mailing list