From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Ingo Molnar <mingo@elte•hu>
Cc: linux-kernel@vger•kernel.org, Ken Chen <kenchen@google•com>,
Paul Mackerras <paulus@samba•org>,
Thomas Gleixner <tglx@linutronix•de>,
"H. Peter Anvin" <hpa@zytor•com>,
linux-next@vger•kernel.org
Subject: Re: [patch] powerpc: change u64/s64 to a long long integer type
Date: Wed, 31 Dec 2008 15:40:27 +1100 [thread overview]
Message-ID: <20081231154027.457d9197.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20081222080341.GA18897@elte.hu>
[-- Attachment #1: Type: text/plain, Size: 4180 bytes --]
Hi Ingo,
On Mon, 22 Dec 2008 09:03:41 +0100 Ingo Molnar <mingo@elte•hu> wrote:
>
> Subject: powerpc: change u64/s64 to a long long integer type
> From: Ingo Molnar <mingo@elte•hu>
> Date: Mon Dec 22 08:32:41 CET 2008
>
> Convert arch/powerpc/ over to long long based u64:
>
> -#ifdef __powerpc64__
> -# include <asm-generic/int-l64.h>
> -#else
> -# include <asm-generic/int-ll64.h>
> -#endif
> +#include <asm-generic/int-ll64.h>
>
> This will avoid reoccuring spurious warnings in core kernel code that
> comes when people test on their own hardware. (i.e. x86 in ~98% of the
> cases) This is what x86 uses and it generally helps keep 64-bit code
> 32-bit clean too.
Thanks for this great start. Just a few comments ...
Firstly, it would be nice if we could split this into things we can do
now (e.g. logical bug fixes) and things that must be done at the time of
the u64 type change (e.g. the printk's etc). That will make the second
patch hopefully somewhat smaller.
> Index: linux/arch/powerpc/kernel/prom.c
> ===================================================================
> --- linux.orig/arch/powerpc/kernel/prom.c
> +++ linux/arch/powerpc/kernel/prom.c
> @@ -824,11 +824,11 @@ static int __init early_init_dt_scan_cho
> #endif
>
> #ifdef CONFIG_KEXEC
> - lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL);
> + lprop = (unsigned long *)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL);
> if (lprop)
> crashk_res.start = *lprop;
>
> - lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-size", NULL);
> + lprop = (unsigned long *)of_get_flat_dt_prop(node, "linux,crashkernel-size", NULL);
These casts are actually not needed at all as of_get_flat_dt_prop()
returns "void *".
> Index: linux/arch/powerpc/oprofile/cell/vma_map.c
> ===================================================================
> --- linux.orig/arch/powerpc/oprofile/cell/vma_map.c
> +++ linux/arch/powerpc/oprofile/cell/vma_map.c
> @@ -92,7 +92,7 @@ vma_map_add(struct vma_to_fileoffset_map
> * A pointer to the first vma_map in the generated list
> * of vma_maps is returned. */
> struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
> - unsigned long __spu_elf_start)
> + u64 __spu_elf_start)
Wouldn't it make more sense to change the prototype to match the
implementation and the only caller (which passes an "unsigned long")?
> Index: linux/arch/powerpc/platforms/cell/interrupt.c
> ===================================================================
> --- linux.orig/arch/powerpc/platforms/cell/interrupt.c
> +++ linux/arch/powerpc/platforms/cell/interrupt.c
> @@ -148,7 +148,7 @@ static unsigned int iic_get_irq(void)
>
> iic = &__get_cpu_var(iic);
> *(unsigned long *) &pending =
> - in_be64((unsigned long __iomem *) &iic->regs->pending_destr);
> + in_be64((unsigned long long __iomem *) &iic->regs->pending_destr);
in_be64()'s argument is "const volatile u64 __iomem *" so the
original "unsigned long" should have been "u64".
> Index: linux/arch/powerpc/platforms/cell/spu_base.c
> ===================================================================
> --- linux.orig/arch/powerpc/platforms/cell/spu_base.c
> +++ linux/arch/powerpc/platforms/cell/spu_base.c
> @@ -139,10 +139,10 @@ static void spu_restart_dma(struct spu *
> {
> struct spu_priv2 __iomem *priv2 = spu->priv2;
>
> - if (!test_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags))
> + if (!test_bit(SPU_CONTEXT_SWITCH_PENDING, (unsigned long *)&spu->flags))
> out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESTART_DMA_COMMAND);
> else {
> - set_bit(SPU_CONTEXT_FAULT_PENDING, &spu->flags);
> + set_bit(SPU_CONTEXT_FAULT_PENDING, (unsigned long *)&spu->flags);
I have submitted a different patch for this. The bitops work on unsigned
longs, so I changed the "flags" to be unsigned long.
So, would you like me to push this along - including splitting it up a
bit (keeping your Signed-off-by, of course)?
--
Cheers,
Stephen Rothwell sfr@canb•auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-12-31 4:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-22 4:22 linux-next: sched tree build warning Stephen Rothwell
2008-12-22 6:47 ` Ingo Molnar
2008-12-22 6:49 ` Ken Chen
2008-12-22 7:04 ` Ingo Molnar
2008-12-22 7:19 ` Stephen Rothwell
2008-12-22 8:03 ` [patch] powerpc: change u64/s64 to a long long integer type Ingo Molnar
2008-12-22 22:43 ` Andrew Morton
2008-12-22 23:00 ` Sam Ravnborg
2008-12-22 23:03 ` H. Peter Anvin
2008-12-22 23:13 ` Sam Ravnborg
2008-12-22 23:13 ` Andrew Morton
2008-12-23 13:17 ` [PATCH] sparc64: use unsigned long long for u64 Sam Ravnborg
2008-12-23 14:42 ` [PATCH] sparc64: fix unsigned long long warnings in drivers Sam Ravnborg
2008-12-23 17:05 ` [PATCH] sparc64: use unsigned long long for u64 Ken Chen
2008-12-23 17:26 ` Sam Ravnborg
2008-12-23 17:29 ` Ken Chen
2008-12-23 17:34 ` Sam Ravnborg
2008-12-27 8:54 ` David Miller
2008-12-27 9:24 ` Sam Ravnborg
2008-12-27 9:37 ` David Miller
2008-12-27 9:49 ` Sam Ravnborg
2008-12-28 4:25 ` David Miller
2008-12-28 12:32 ` Sam Ravnborg
2008-12-31 4:40 ` Stephen Rothwell [this message]
2008-12-31 7:52 ` [patch] powerpc: change u64/s64 to a long long integer type Ingo Molnar
2008-12-22 8:14 ` linux-next: sched tree build warning Paul Mackerras
2008-12-22 8:18 ` Ingo Molnar
2008-12-22 9:44 ` Paul Mackerras
2008-12-22 10:53 ` Ingo Molnar
2008-12-22 12:03 ` Paul Mackerras
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=20081231154027.457d9197.sfr@canb.auug.org.au \
--to=sfr@canb$(echo .)auug.org.au \
--cc=hpa@zytor$(echo .)com \
--cc=kenchen@google$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=mingo@elte$(echo .)hu \
--cc=paulus@samba$(echo .)org \
--cc=tglx@linutronix$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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