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: <c34968b8-f6bf-4ee1-8767-ef463637d866@csgroup.eu>
Date: Thu, 25 Jan 2024 10:41:56 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Kunwu Chan <chentao@...inos.cn>, "jk@...abs.org" <jk@...abs.org>,
	"arnd@...db.de" <arnd@...db.de>, "mpe@...erman.id.au" <mpe@...erman.id.au>,
	"npiggin@...il.com" <npiggin@...il.com>, "aneesh.kumar@...nel.org"
	<aneesh.kumar@...nel.org>, "naveen.n.rao@...ux.ibm.com"
	<naveen.n.rao@...ux.ibm.com>
CC: "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] powerpc/cell: Code cleanup for spufs_mfc_flush



Le 25/01/2024 à 11:08, Kunwu Chan a écrit :
> This part was commented from commit a33a7d7309d7
> ("[PATCH] spufs: implement mfc access for PPE-side DMA")
> in about 18 years before.
> 
> If there are no plans to enable this part code in the future,
> we can remove this dead code.
> 
> Signed-off-by: Kunwu Chan <chentao@...inos.cn>
> ---
>   arch/powerpc/platforms/cell/spufs/file.c | 12 ------------
>   1 file changed, 12 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
> index 02a8158c469d..d5e1af483601 100644
> --- a/arch/powerpc/platforms/cell/spufs/file.c
> +++ b/arch/powerpc/platforms/cell/spufs/file.c
> @@ -1705,19 +1705,7 @@ static int spufs_mfc_flush(struct file *file, fl_owner_t id)
>   	ret = spu_acquire(ctx);
>   	if (ret)
>   		goto out;
> -#if 0
> -/* this currently hangs */
> -	ret = spufs_wait(ctx->mfc_wq,
> -			 ctx->ops->set_mfc_query(ctx, ctx->tagwait, 2));
> -	if (ret)
> -		goto out;
> -	ret = spufs_wait(ctx->mfc_wq,
> -			 ctx->ops->read_mfc_tagstatus(ctx) == ctx->tagwait);
> -	if (ret)
> -		goto out;
> -#else
>   	ret = 0;

If you arrived here, it means ret is already 0, otherwise you would have 
jumped to label out:, so you can also remove that ret = 0 setting.

And while you are at it, there is no point in a goto to just a return, 
just return instead of the goto, and then you can return 0 directly, 
something like:

	ret = spu_acquire(ctx);
	if (ret)
		return ret;

	spu_release(ctx);

	return 0;


That would be a better cleanup.

> -#endif
>   	spu_release(ctx);
>   out:
>   	return ret;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ