[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <151868021710.15373.766697204394848595@mail.alporthouse.com>
Date: Thu, 15 Feb 2018 07:36:57 +0000
From: Chris Wilson <chris@...is-wilson.co.uk>
To: Anshuman Khandual <khandual@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
bart.vanassche@....com, jthumshirn@...e.de, axboe@...nel.dk,
tvrtko.ursulin@...el.com
Cc: khandual@...ux.vnet.ibm.com
Subject: Re: [PATCH V2] lib/scatterlist: Add SG_CHAIN and SG_END macros for LSB
encodings
Quoting Anshuman Khandual (2018-02-15 03:33:56)
> This replaces scatterlist->page_link LSB encodings with SG_CHAIN and
> SG_END definitions without any functional change.
>
> Signed-off-by: Anshuman Khandual <khandual@...ux.vnet.ibm.com>
> ---
> Changes in V2:
> - Changed SG_EMARK as SG_END as per Johannes and Tvrtko
> - Added 'UL' to the constants as per Bart
>
> include/linux/scatterlist.h | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
> index 22b2131bcdcd..b6fe1815f5c4 100644
> --- a/include/linux/scatterlist.h
> +++ b/include/linux/scatterlist.h
> @@ -65,16 +65,18 @@ struct sg_table {
> */
>
> #define SG_MAGIC 0x87654321
> +#define SG_CHAIN 0x01UL
> +#define SG_END 0x02UL
The alternative would be BIT(0) and BIT(1), which by the time you write
the constant out in full, as above, become clearer.
I think you also want whitespace between the MAGIC and CHAIN,END so that
the reader doesn't think they refer to some magic encoding of SG_MAGIC.
-Chris
Powered by blists - more mailing lists