lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <839da111-f9a2-39a8-0a08-cb43cea0c3c5@gmail.com>
Date:   Wed, 11 Dec 2019 19:26:36 +0100
From:   Matthias Brugger <matthias.bgg@...il.com>
To:     Bibby Hsieh <bibby.hsieh@...iatek.com>,
        Rob Herring <robh+dt@...nel.org>, CK HU <ck.hu@...iatek.com>
Cc:     devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, srv_heupstream@...iatek.com,
        Nicolas Boichat <drinkcat@...omium.org>,
        Dennis-YC Hsieh <dennis-yc.hsieh@...iatek.com>
Subject: Re: [PATCH v17 2/6] soc: mediatek: cmdq: remove OR opertaion from err
 return



On 21/11/2019 02:54, Bibby Hsieh wrote:
> That make debugging confuseidly when we OR two error return number.
> 
> Signed-off-by: Bibby Hsieh <bibby.hsieh@...iatek.com>
> Reviewed-by: CK Hu <ck.hu@...iatek.com>

Queued for v5.5-next/soc

Thanks!

> ---
>  drivers/soc/mediatek/mtk-cmdq-helper.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c
> index 3c82de5f9417..c8fb69787649 100644
> --- a/drivers/soc/mediatek/mtk-cmdq-helper.c
> +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c
> @@ -149,13 +149,16 @@ int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys,
>  			u16 offset, u32 value, u32 mask)
>  {
>  	u32 offset_mask = offset;
> -	int err = 0;
> +	int err;
>  
>  	if (mask != 0xffffffff) {
>  		err = cmdq_pkt_append_command(pkt, CMDQ_CODE_MASK, 0, ~mask);
> +		if (err < 0)
> +			return err;
> +
>  		offset_mask |= CMDQ_WRITE_ENABLE_MASK;
>  	}
> -	err |= cmdq_pkt_write(pkt, subsys, offset_mask, value);
> +	err = cmdq_pkt_write(pkt, subsys, offset_mask, value);
>  
>  	return err;
>  }
> @@ -197,9 +200,11 @@ static int cmdq_pkt_finalize(struct cmdq_pkt *pkt)
>  
>  	/* insert EOC and generate IRQ for each command iteration */
>  	err = cmdq_pkt_append_command(pkt, CMDQ_CODE_EOC, 0, CMDQ_EOC_IRQ_EN);
> +	if (err < 0)
> +		return err;
>  
>  	/* JUMP to end */
> -	err |= cmdq_pkt_append_command(pkt, CMDQ_CODE_JUMP, 0, CMDQ_JUMP_PASS);
> +	err = cmdq_pkt_append_command(pkt, CMDQ_CODE_JUMP, 0, CMDQ_JUMP_PASS);
>  
>  	return err;
>  }
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ