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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0710271312190.9802@localhost.localdomain>
Date:	Sat, 27 Oct 2007 13:14:22 -0400 (EDT)
From:	"Robert P. J. Day" <rpjday@...shcourse.ca>
To:	Cyrill Gorcunov <gorcunov@...il.com>
cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] SG: set names for numeric constants

On Sat, 27 Oct 2007, Cyrill Gorcunov wrote:

>
> This patch defines names for numeric constants that
> used in scatter list for more convenient code reading.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@...il.com>
...
> @@ -73,7 +76,7 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page,
>  	sg->length = len;
>  }
>
> -#define sg_page(sg)	((struct page *) ((sg)->page_link & ~0x3))
> +#define sg_page(sg)	((struct page *) ((sg)->page_link & ~SG_MASK))
>
> -#define sg_is_chain(sg)		((sg)->page_link & 0x01)
> -#define sg_is_last(sg)		((sg)->page_link & 0x02)
> +#define sg_is_chain(sg)		((sg)->page_link & SG_CHAIN)
> +#define sg_is_last(sg)		((sg)->page_link & SG_LAST)
>  #define sg_chain_ptr(sg)	\
> -	((struct scatterlist *) ((sg)->page_link & ~0x03))
> +	((struct scatterlist *) ((sg)->page_link & ~SG_MASK))

while you're at it, could you move all those macros to the top of the
file, rather than leaving them scattered across the first 100 lines or
so?  it would just make them easier to find when you're perusing the
code.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================
-
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