xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Elena Ufimtseva <ufimtseva@gmail.com>
Cc: keir@xen.org, Ian.Campbell@citrix.com,
	george.dunlap@eu.citrix.com, ian.jackson@eu.citrix.com,
	xen-devel@lists.xen.org, JBeulich@suse.com
Subject: Re: [PATCH] numa.c: use spaces instead of tabs
Date: Wed, 3 Sep 2014 11:52:49 +0200	[thread overview]
Message-ID: <1409737969.2673.35.camel@Solace.lan> (raw)
In-Reply-To: <1409717890-2837-1-git-send-email-ufimtseva@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2444 bytes --]

On mer, 2014-09-03 at 00:18 -0400, Elena Ufimtseva wrote:
> Signed-off-by: Elena Ufimtseva <ufimtseva@gmail.com>
> ---
>
I think the patch does what the subject says, i.e., converting tabs to
spaces, and does it right (I've only one question, see below).

However, does it make sense, while at it, to turn the file into a Xen's
code stile compliant one? Because, if yes, there are other things than
tabs-->spaces that needs fixing, I believe.

> --- a/xen/arch/x86/numa.c
> +++ b/xen/arch/x86/numa.c

> @@ -67,53 +67,53 @@ int srat_disabled(void)
>  static int __init populate_memnodemap(const struct node *nodes,
>                                        int numnodes, int shift, int *nodeids)
>  {
> -	unsigned long spdx, epdx;
> -	int i, res = -1;
> -
> -	memset(memnodemap, NUMA_NO_NODE, memnodemapsize * sizeof(*memnodemap));
> -	for (i = 0; i < numnodes; i++) {
> -		spdx = paddr_to_pdx(nodes[i].start);
> -		epdx = paddr_to_pdx(nodes[i].end - 1) + 1;
> -		if (spdx >= epdx)
> -			continue;
> -		if ((epdx >> shift) >= memnodemapsize)
> -			return 0;
> -		do {
> -			if (memnodemap[spdx >> shift] != NUMA_NO_NODE)
> -				return -1;
> -
> -			if (!nodeids)
> -				memnodemap[spdx >> shift] = i;
> -			else
> -				memnodemap[spdx >> shift] = nodeids[i];
> -
> -			spdx += (1UL << shift);
> -		} while (spdx < epdx);
> -		res = 1;
> -	}
> -	return res;
> +    unsigned long spdx, epdx;
> +    int i, res = -1;
> +
> +    memset(memnodemap, NUMA_NO_NODE, memnodemapsize * sizeof(*memnodemap));
> +    for (i = 0; i < numnodes; i++) {
>
For example here. In Xen's style, this would become something like:

    for ( i = 0; i < numnodes; i++ )
    {

And the same throughout all the for-s and if-s in the file.

>  /*
> @@ -121,83 +121,83 @@ static int __init allocate_cachealigned_memnodemap(void)
>   * maximum possible shift.
>   */
>  static int __init extract_lsb_from_nodes(const struct node *nodes,
> -					 int numnodes)
> +                     int numnodes)
>
Perhaps I am the one missing something here, but shouldn't this still be
aligned to the '(' above (through spaces, of course)?

Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2014-09-03  9:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03  4:18 [PATCH] numa.c: use spaces instead of tabs Elena Ufimtseva
2014-09-03  9:52 ` Dario Faggioli [this message]
2014-09-03 10:01   ` Jan Beulich
2014-09-03 11:59     ` Elena Ufimtseva
2014-09-03 12:18       ` Ian Campbell
2014-09-03 12:29         ` Elena Ufimtseva
2014-09-03 12:29       ` Jan Beulich
2014-09-03 12:34         ` Elena Ufimtseva
2014-09-03 12:40           ` Jan Beulich
2014-09-06 17:28             ` Don Slutz
2014-09-08  6:53               ` Jan Beulich

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=1409737969.2673.35.camel@Solace.lan \
    --to=dario.faggioli@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=ufimtseva@gmail.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).