mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] SG: set names for numeric constants
Date: Sat, 27 Oct 2007 13:14:22 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0710271312190.9802@localhost.localdomain> (raw)
In-Reply-To: <20071027170228.GA7257@cvg>

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@gmail.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
========================================================================

  reply	other threads:[~2007-10-27 17:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-27 17:02 Cyrill Gorcunov
2007-10-27 17:14 ` Robert P. J. Day [this message]
2007-10-27 17:46   ` Cyrill Gorcunov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0710271312190.9802@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=akpm@linux-foundation.org \
    --cc=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®