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]
Date:	Wed, 13 Feb 2008 10:52:49 +0100
From:	Jan Kara <jack@...e.cz>
To:	marcin.slusarz@...il.com
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] quota: le*_add_cpu conversion

On Wed 13-02-08 00:06:19, marcin.slusarz@...il.com wrote:
> From: Marcin Slusarz <marcin.slusarz@...il.com>
> 
> replace all:
> little_endian_variable = cpu_to_leX(leX_to_cpu(little_endian_variable) +
> 					expression_in_cpu_byteorder);
> with:
> 	leX_add_cpu(&little_endian_variable, expression_in_cpu_byteorder);
> generated with semantic patch
> 
> Signed-off-by: Marcin Slusarz <marcin.slusarz@...il.com>
> Cc: Jan Kara <jack@...e.cz>
  Acked-by: Jan Kara <jack@...e.cz>

									Honza
> ---
>  fs/quota_v2.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/quota_v2.c b/fs/quota_v2.c
> index c519a58..a9f9eef 100644
> --- a/fs/quota_v2.c
> +++ b/fs/quota_v2.c
> @@ -303,7 +303,7 @@ static uint find_free_dqentry(struct dquot *dquot, int *err)
>  			printk(KERN_ERR "VFS: find_free_dqentry(): Can't remove block (%u) from entry free list.\n", blk);
>  			goto out_buf;
>  		}
> -	dh->dqdh_entries = cpu_to_le16(le16_to_cpu(dh->dqdh_entries)+1);
> +	le16_add_cpu(&dh->dqdh_entries, 1);
>  	memset(&fakedquot, 0, sizeof(struct v2_disk_dqblk));
>  	/* Find free structure in block */
>  	for (i = 0; i < V2_DQSTRINBLK && memcmp(&fakedquot, ddquot+i, sizeof(struct v2_disk_dqblk)); i++);
> @@ -445,7 +445,7 @@ static int free_dqentry(struct dquot *dquot, uint blk)
>  		goto out_buf;
>  	}
>  	dh = (struct v2_disk_dqdbheader *)buf;
> -	dh->dqdh_entries = cpu_to_le16(le16_to_cpu(dh->dqdh_entries)-1);
> +	le16_add_cpu(&dh->dqdh_entries, -1);
>  	if (!le16_to_cpu(dh->dqdh_entries)) {	/* Block got free? */
>  		if ((ret = remove_free_dqentry(sb, type, buf, blk)) < 0 ||
>  		    (ret = put_free_dqblk(sb, type, buf, blk)) < 0) {
> -- 
> 1.5.3.7
> 
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ