linux-next: sched tree build warning
Subsystems (13)
Hi all,
Today's linux-next build (powerpc ppc64_defconfig) produced this new warning:
fs/proc/base.c: In function 'proc_pid_schedstat':fs/proc/base.c:352: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type 'u64'
Introduced by commit 9c2c48020ec0dd6ecd27e5a1298f73b40d85a595 ("schedstat: consolidate per-task cpu runtime stats").
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Quoted 10 lines · Stephen Rothwell
Hi all,
Today's linux-next build (powerpc
ppc64_defconfig) produced this new warning:
fs/proc/base.c: In function 'proc_pid_schedstat':fs/proc/base.c:352: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type 'u64'Introduced by commit
9c2c48020ec0dd6ecd27e5a1298f73b40d85a595("schedstat: consolidate per-task cpu runtime stats").
that should be harmless - fix below.
Given that all these warnings generated by asm-generic/int-l64.h are bogus, all the time - the right and clean fix is to change the architectures that use it (s390, mips, ia64, sparc, powerpc, alpha) to asm-generic/int-ll64.h. It will break nothing - there will only be a one-time conversion to avoid similar build warnings.
Ingo
----------------->
Quoted 1 line
From
826e08b0157c0ce8a80dfe3c0a6c5a1540dd0b1dMon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Mon, 22 Dec 2008 07:37:41 +0100
Subject: [PATCH] sched: fix warning in fs/proc/base.c
Stephen Rothwell reported this new (harmless) build warning on platforms that define u64 to long:
fs/proc/base.c: In function 'proc_pid_schedstat':
fs/proc/base.c:352: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type 'u64'
asm-generic/int-l64.h platforms strike again: that file should be eliminated.
Fix it by casting the parameters to long long.
--- fs/proc/base.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
fs/proc/base.c +2 -2
@@ -347,8 +347,8 @@ static int proc_pid_wchan(struct task_struct *task, char *buffer)static int proc_pid_schedstat (struct task_struct *task,char *buffer) {return sprintf (buffer,"%llu %llu %lu\n" , - task->se.sum_exec_runtime, - task->sched_info.run_delay, + (unsigned long long )task->se.sum_exec_runtime, + (unsigned long long )task->sched_info.run_delay, task->sched_info.pcount); }#endif
Quoted 11 lines · Stephen Rothwell
Hi all,
Today's linux-next build (powerpc
ppc64_defconfig) produced this new warning:
fs/proc/base.c: In function 'proc_pid_schedstat':fs/proc/base.c:352: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type 'u64'Introduced by commit
9c2c48020ec0dd6ecd27e5a1298f73b40d85a595("schedstat: consolidate per-task cpu runtime stats").
oh boy, this is the 2nd time that printing u64 bite me, I really need to get hold of a machine that is non-x86_64.
Just saw Ingo's patch came in while I'm typing this email. Thank you Ingo for fixing this.
- Ken
Quoted 10 lines · Ken Chen
Quoted 9 lines · Stephen Rothwell
Hi all,
Today's linux-next build (powerpc
ppc64_defconfig) produced this new warning:
fs/proc/base.c: In function 'proc_pid_schedstat':fs/proc/base.c:352: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type 'u64'
Quoted 8 lines
Quoted 2 lines
Introduced by commit
9c2c48020ec0dd6ecd27e5a1298f73b40d85a595("schedstat: consolidate per-task cpu runtime stats").oh boy, this is the 2nd time that printing u64 bite me, I really need to get hold of a machine that is non-x86_64.
Just saw Ingo's patch came in while I'm typing this email. Thank you Ingo for fixing this.
the real solution is something like the patch below. That generates new (but harmless) warnings within the powerpc code but those are a one-off effort to fix and are not reoccuring.
Ingo
--------------->
Quoted 1 line
From
3d835af97da5b6cb755ca4f8464f8e636cc321daMon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Mon, 22 Dec 2008 08:02:06 +0100
Subject: [PATCH] powerpc: fix u64
--- arch/powerpc/include/asm/types.h | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
arch/powerpc/include/asm/types.h +1 -5
@@ -1,11 +1,7 @@#ifndef _ASM_POWERPC_TYPES_H#define _ASM_POWERPC_TYPES_H -#ifdef __powerpc64__ -# include <asm-generic/int-l64.h> -#else -# include <asm-generic/int-ll64.h> -#endif +#include <asm-generic/int-ll64.h> #ifndef __ASSEMBLY__
Hi Ingo,
Quoted 6 lines · On Mon, 22 Dec 2008 08:04:26 +0100 Ingo Molnar <[email protected]> wrote:
the real solution is something like the patch below. That generates new (but harmless) warnings within the powerpc code but those are a one-off effort to fix and are not reoccuring.
Cc -ed Paul Mackerras - Paul, am i missing anything?
You mean besides the patches that fix all those warnings? :-)
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
PATCH 1/1 powerpc: change u64/s64 to a long long integer type
Quoted 11 lines · Stephen Rothwell
Hi Ingo,
Quoted 6 lines · On Mon, 22 Dec 2008 08:04:26 +0100 Ingo Molnar <[email protected]> wrote:
the real solution is something like the patch below. That generates new (but harmless) warnings within the powerpc code but those are a one-off effort to fix and are not reoccuring.
Cc -ed Paul Mackerras - Paul, am i missing anything?You mean besides the patches that fix all those warnings? :-)
i thought you as a PowerPC person would be more suited to fix them than me.
but it took me 30 minutes - much less than the total time just i had to spend on similar issues in the past. So this patch will be a real time-saver and it should have been done years ago.
Tested on ppc64-defconfig - i guess there's more to it but similarly trivial.
Ingo
----------------------->
Subject: powerpc: change u64/s64 to a long long integer type
From: Ingo Molnar <[email protected]>
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.
--- arch/powerpc/include/asm/rtas.h | 2 - arch/powerpc/include/asm/types.h | 6 ---- arch/powerpc/kernel/dma-iommu.c | 4 +- arch/powerpc/kernel/iommu.c | 12 ++++---- arch/powerpc/kernel/lparcfg.c | 10 +++---- arch/powerpc/kernel/prom.c | 4 +- arch/powerpc/kernel/prom_init.c | 2 - arch/powerpc/kernel/setup_64.c | 6 ++-- arch/powerpc/mm/stab.c | 4 +- arch/powerpc/oprofile/cell/vma_map.c | 2 - arch/powerpc/oprofile/op_model_pa6t.c | 6 ++-- arch/powerpc/platforms/cell/beat_htab.c | 21 ++++++++------- arch/powerpc/platforms/cell/beat_interrupt.c | 2 - arch/powerpc/platforms/cell/beat_udbg.c | 4 +- arch/powerpc/platforms/cell/celleb_scc_epci.c | 4 +- arch/powerpc/platforms/cell/interrupt.c | 2 - arch/powerpc/platforms/cell/io-workarounds.c | 2 - arch/powerpc/platforms/cell/iommu.c | 6 ++-- arch/powerpc/platforms/cell/ras.c | 8 ++--- arch/powerpc/platforms/cell/spu_base.c | 8 ++--- arch/powerpc/platforms/cell/spu_callbacks.c | 2 - arch/powerpc/platforms/iseries/iommu.c | 4 +- arch/powerpc/platforms/pasemi/cpufreq.c | 2 - arch/powerpc/platforms/pseries/iommu.c | 35 ++++++++++++-------------- arch/powerpc/sysdev/mpic.c | 2 - drivers/char/hvc_beat.c | 4 +- drivers/net/pasemi_mac.c | 6 ++-- drivers/pcmcia/electra_cf.c | 2 - drivers/scsi/ibmvscsi/ibmvscsi.c | 12 ++++---- 29 files changed, 90 insertions(+), 94 deletions(-)
arch/powerpc/include/asm/rtas.h +1 -1
@@ -18,7 +18,7 @@*/ #define RTAS_UNKNOWN_SERVICE (-1) -#define RTAS_INSTANTIATE_MAX (1UL<<30)/* Don't instantiate rtas at/above this value */ +#define RTAS_INSTANTIATE_MAX (1ULL<<30)/* Don't instantiate rtas at/above this value */ /* Buffer size for ppc_rtas system call. */ #define RTAS_RMOBUF_MAX (64 * 1024)
arch/powerpc/include/asm/types.h +1 -5
@@ -1,11 +1,7 @@#ifndef _ASM_POWERPC_TYPES_H#define _ASM_POWERPC_TYPES_H -#ifdef __powerpc64__ -# include <asm-generic/int-l64.h> -#else -# include <asm-generic/int-ll64.h> -#endif +#include <asm-generic/int-ll64.h> #ifndef __ASSEMBLY__
arch/powerpc/kernel/dma-iommu.c +2 -2
@@ -79,10 +79,10 @@ static int dma_iommu_dma_supported(struc "Warning: IOMMU offset too big for device mask\n");if (tbl)printk (KERN_INFO -"mask: 0x%08lx, table offset: 0x%08lx\n" , +"mask: 0x%08llx, table offset: 0x%08lx\n" , mask, tbl->it_offset);else -printk (KERN_INFO "mask: 0x%08lx, table unavailable\n" , +printk (KERN_INFO "mask: 0x%08llx, table unavailable\n" , mask);return 0 ; }else
arch/powerpc/kernel/iommu.c +6 -6
@@ -239,12 +239,12 @@ static void __iommu_free(struct iommu_taif (printk_ratelimit ()) {printk (KERN_INFO "iommu_free: invalid entry\n" );printk (KERN_INFO "\tentry = 0x%lx\n" , entry); -printk (KERN_INFO "\tdma_addr = 0x%lx\n" , (u64 )dma_addr); -printk (KERN_INFO "\tTable = 0x%lx\n" , (u64 )tbl); -printk (KERN_INFO "\tbus# = 0x%lx\n" , (u64 )tbl->it_busno); -printk (KERN_INFO "\tsize = 0x%lx\n" , (u64 )tbl->it_size); -printk (KERN_INFO "\tstartOff = 0x%lx\n" , (u64 )tbl->it_offset); -printk (KERN_INFO "\tindex = 0x%lx\n" , (u64 )tbl->it_index); +printk (KERN_INFO "\tdma_addr = 0x%llx\n" , (u64 )dma_addr); +printk (KERN_INFO "\tTable = 0x%llx\n" , (u64 )tbl); +printk (KERN_INFO "\tbus# = 0x%llx\n" , (u64 )tbl->it_busno); +printk (KERN_INFO "\tsize = 0x%llx\n" , (u64 )tbl->it_size); +printk (KERN_INFO "\tstartOff = 0x%llx\n" , (u64 )tbl->it_offset); +printk (KERN_INFO "\tindex = 0x%llx\n" , (u64 )tbl->it_index);WARN_ON (1 ); }return ;
arch/powerpc/kernel/lparcfg.c +5 -5
@@ -240,7 +240,7 @@ static void parse_ppp_data(struct seq_fiif (rc)return ; -seq_printf (m,"partition_entitled_capacity=%ld\n" , +seq_printf (m,"partition_entitled_capacity=%lld\n" , ppp_data.entitlement);seq_printf (m,"group=%d\n" , ppp_data.group_num); seq_printf(m, "system_active_processors=%d\n",
@@ -265,7 +265,7 @@ static void parse_ppp_data(struct seq_fi ppp_data.unallocated_weight);seq_printf (m,"capacity_weight=%d\n" , ppp_data.weight);seq_printf (m,"capped=%d\n" , ppp_data.capped); -seq_printf (m,"unallocated_capacity=%ld\n" , +seq_printf (m,"unallocated_capacity=%lld\n" , ppp_data.unallocated_entitlement); }
@@ -509,10 +509,10 @@ static ssize_t update_ppp(u64 *entitleme }else return -EINVAL ; -pr_debug ("%s: current_entitled = %lu, current_weight = %u\n" , +pr_debug ("%s: current_entitled = %llu, current_weight = %u\n" , __func__, ppp_data.entitlement, ppp_data.weight); -pr_debug ("%s: new_entitled = %lu, new_weight = %u\n" , +pr_debug ("%s: new_entitled = %llu, new_weight = %u\n" , __func__, new_entitled, new_weight); retval =plpar_hcall_norets (H_SET_PPP , new_entitled, new_weight);
@@ -558,7 +558,7 @@ static ssize_t update_mpp(u64 *entitlemepr_debug ("%s: current_entitled = %lu, current_weight = %u\n" , __func__, mpp_data.entitled_mem, mpp_data.mem_weight); -pr_debug ("%s: new_entitled = %lu, new_weight = %u\n" , +pr_debug ("%s: new_entitled = %llu, new_weight = %u\n" , __func__, new_entitled, new_weight); rc =plpar_hcall_norets (H_SET_MPP , new_entitled, new_weight);
arch/powerpc/kernel/prom.c +2 -2
@@ -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 );if (lprop) crashk_res.end = crashk_res.start + *lprop -1 ;#endif
arch/powerpc/kernel/prom_init.c +1 -1
@@ -1210,7 +1210,7 @@ static void __init prom_initialize_tce_t/* Initialize the table to have a one-to-one mapping * over the allocated size. */ - tce_entryp = (unsigned long *)base; + tce_entryp = (u64 *)base;for (i =0 ; i < (minsize >>3 ) ;tce_entryp++, i++) { tce_entry = (i <<PAGE_SHIFT ); tce_entry |=0x3 ;
arch/powerpc/kernel/setup_64.c +3 -3
@@ -433,8 +433,8 @@ void __init setup_system(void)printk ("Starting Linux PPC64 %s\n" ,init_utsname ()->version);printk ("-----------------------------------------------------\n" ); -printk ("ppc64_pft_size = 0x%lx\n" , ppc64_pft_size); -printk ("physicalMemorySize = 0x%lx\n" ,lmb_phys_mem_size ()); +printk ("ppc64_pft_size = 0x%llx\n" , ppc64_pft_size); +printk ("physicalMemorySize = 0x%llx\n" ,lmb_phys_mem_size ());if (ppc64_caches.dline_size !=0x80 )printk ("ppc64_caches.dcache_line_size = 0x%x\n" , ppc64_caches.dline_size);
@@ -492,7 +492,7 @@ static void __init emergency_stack_init(* bringup, we need to get at them in real mode. This means they * must also be within the RMO region. */ - limit =min (0x10000000UL , lmb.rmo_size); + limit =min (0x10000000ULL , lmb.rmo_size);for_each_possible_cpu (i) {unsigned long sp;
arch/powerpc/mm/stab.c +2 -2
@@ -251,8 +251,8 @@ void __init stabs_alloc(void) paca[cpu].stab_addr = newstab; paca[cpu].stab_real =virt_to_abs (newstab); -printk (KERN_INFO "Segment table for CPU %d at 0x%lx " -"virtual, 0x%lx absolute\n" , +printk (KERN_INFO "Segment table for CPU %d at 0x%llx " +"virtual, 0x%llx absolute\n" , cpu, paca[cpu].stab_addr, paca[cpu].stab_real); } }
arch/powerpc/oprofile/cell/vma_map.c +1 -1
@@ -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) {static const unsigned char expected[EI_PAD ] = { [EI_MAG0 ] =ELFMAG0 ,
arch/powerpc/oprofile/op_model_pa6t.c +3 -3
@@ -132,7 +132,7 @@ static int pa6t_reg_setup(struct op_counfor (pmc =0 ; pmc < cur_cpu_spec->num_pmcs; pmc++) {/* counters are 40 bit. Move to cputable at some point? */ reset_value[pmc] = (0x1UL <<39 ) - ctr[pmc].count; -pr_debug ("reset_value for pmc%u inited to 0x%lx\n" , +pr_debug ("reset_value for pmc%u inited to 0x%llx\n" , pmc, reset_value[pmc]); }
@@ -177,7 +177,7 @@ static int pa6t_start(struct op_counter_ oprofile_running =1 ; -pr_debug ("start on cpu %d, mmcr0 %lx\n" ,smp_processor_id (), mmcr0); +pr_debug ("start on cpu %d, mmcr0 %llx\n" ,smp_processor_id (), mmcr0);return 0 ; }
@@ -193,7 +193,7 @@ static void pa6t_stop(void) oprofile_running =0 ; -pr_debug ("stop on cpu %d, mmcr0 %lx\n" ,smp_processor_id (), mmcr0); +pr_debug ("stop on cpu %d, mmcr0 %llx\n" ,smp_processor_id (), mmcr0); }/* handle the perfmon overflow vector */
arch/powerpc/platforms/cell/beat_htab.c +11 -10
@@ -44,8 +44,8 @@ static DEFINE_SPINLOCK(beat_htab_lock);static inline unsigned int beat_read_mask (unsigned hpte_group) { -unsigned long hpte_v[5 ];unsigned long rmask =0 ; +u64 hpte_v[5 ];beat_read_htab_entries (0 , hpte_group +0 , hpte_v);if (!(hpte_v[0 ] &HPTE_V_BOLTED ))
@@ -93,8 +93,7 @@ static long beat_lpar_hpte_insert(unsign int psize, int ssize) {unsigned long lpar_rc; -unsigned long slot; -unsigned long hpte_v, hpte_r; +u64 hpte_v, hpte_r, slot;/* same as iseries */ if (vflags &HPTE_V_SECONDARY )
@@ -153,8 +152,9 @@ static long beat_lpar_hpte_remove(unsignstatic unsigned long beat_lpar_hpte_getword0 (unsigned long slot) { -unsigned long dword0, dword[5 ]; +unsigned long dword0;unsigned long lpar_rc; +u64 dword[5 ]; lpar_rc =beat_read_htab_entries (0 , slot & ~3UL , dword);
@@ -170,7 +170,7 @@ static void beat_lpar_hptab_clear(void)unsigned long size_bytes =1UL << ppc64_pft_size;unsigned long hpte_count = size_bytes >>4 ;int i; -unsigned long dummy0, dummy1; +u64 dummy0, dummy1;/* TODO: Use bulk call */ for (i =0 ; i < hpte_count; i++)
@@ -189,7 +189,8 @@ static long beat_lpar_hpte_updatepp(unsi int psize, int ssize, int local) { unsigned long lpar_rc; -unsigned long dummy0, dummy1, want_v; +u64 dummy0, dummy1; +unsigned long want_v; want_v =hpte_encode_v (va, psize,MMU_SEGSIZE_256M );
@@ -255,7 +256,8 @@ static void beat_lpar_hpte_updateboltedpunsigned long ea, int psize, int ssize) { - unsigned long lpar_rc, slot, vsid, va, dummy0, dummy1; + unsigned long lpar_rc, slot, vsid, va; +u64 dummy0, dummy1; vsid =get_kernel_vsid (ea,MMU_SEGSIZE_256M ); va = (vsid <<28 ) | (ea &0x0fffffff );
@@ -276,7 +278,7 @@ static void beat_lpar_hpte_invalidate(un {unsigned long want_v;unsigned long lpar_rc; -unsigned long dummy1, dummy2; +u64 dummy1, dummy2;unsigned long flags; DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
@@ -315,8 +317,7 @@ static long beat_lpar_hpte_insert_v3(uns int psize, int ssize) {unsigned long lpar_rc; -unsigned long slot; -unsigned long hpte_v, hpte_r; +u64 hpte_v, hpte_r, slot;/* same as iseries */ if (vflags &HPTE_V_SECONDARY )
arch/powerpc/platforms/cell/beat_interrupt.c +1 -1
@@ -99,7 +99,7 @@ static void beatic_end_irq(unsigned int err =beat_downcount_of_interrupt (irq_plug);if (err !=0 ) {if ((err &0xFFFFFFFF ) !=0xFFFFFFF5 )/* -11: wrong state */ -panic ("Failed to downcount IRQ! Error = %16lx" , err); +panic ("Failed to downcount IRQ! Error = %16llx" , err);printk (KERN_ERR "IRQ over-downcounted, plug %d\n" , irq_plug); }
arch/powerpc/platforms/cell/beat_udbg.c +2 -2
@@ -40,8 +40,8 @@ static void udbg_putc_beat(char c) }/* Buffered chars getc */ -static long inbuflen; -static long inbuf[2 ];/* must be 2 longs */ +static u64 inbuflen; +static u64 inbuf[2 ];/* must be 2 longs */ static int udbg_getc_poll_beat (void ) {
arch/powerpc/platforms/cell/celleb_scc_epci.c +2 -2
@@ -405,7 +405,7 @@ static int __init celleb_setup_epci(stru hose->cfg_addr =ioremap (r.start, (r.end - r.start +1 ));if (!hose->cfg_addr) goto error; -pr_debug ("EPCI: cfg_addr map 0x%016lx->0x%016lx + 0x%016lx\n" , +pr_debug ("EPCI: cfg_addr map 0x%016llx->0x%016lx + 0x%016llx\n" , r.start, (unsigned long )hose->cfg_addr, (r.end - r.start +1 ));if (of_address_to_resource (node,2 , &r))
@@ -413,7 +413,7 @@ static int __init celleb_setup_epci(stru hose->cfg_data =ioremap (r.start, (r.end - r.start +1 ));if (!hose->cfg_data) goto error; -pr_debug ("EPCI: cfg_data map 0x%016lx->0x%016lx + 0x%016lx\n" , +pr_debug ("EPCI: cfg_data map 0x%016llx->0x%016lx + 0x%016llx\n" , r.start, (unsigned long )hose->cfg_data, (r.end - r.start +1 )); hose->ops = &celleb_epci_ops;
arch/powerpc/platforms/cell/interrupt.c +1 -1
@@ -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);if (!(pending.flags &CBE_IIC_IRQ_VALID ))return NO_IRQ ; virq =irq_linear_revmap (iic_host,iic_pending_to_hwnum (pending));
arch/powerpc/platforms/cell/io-workarounds.c +1 -1
@@ -130,7 +130,7 @@ static const struct ppc_pci_io __devinit }; -static void __iomem *iowa_ioremap (unsigned long addr,unsigned long size, +static void __iomem *iowa_ioremap (phys_addr_t addr,unsigned long size,unsigned long flags) {struct iowa_bus *bus;
arch/powerpc/platforms/cell/iommu.c +3 -3
@@ -150,7 +150,7 @@ static int cbe_nr_iommus;static void invalidate_tce_cache (struct cbe_iommu *iommu,unsigned long *pte,long n_ptes) { -unsigned long __iomem *reg; +u64 __iomem *reg;unsigned long val;long n;
@@ -855,7 +855,7 @@ static int __init cell_iommu_init_disabl*/ if (np && size <lmb_end_of_DRAM ()) {printk (KERN_WARNING "iommu: force-enabled, dma window" -" (%ldMB) smaller than total memory (%ldMB)\n" , +" (%ldMB) smaller than total memory (%lldMB)\n" , size >>20 ,lmb_end_of_DRAM () >>20 );return -ENODEV ; }
@@ -985,7 +985,7 @@ static void cell_dma_dev_setup_fixed(str addr =cell_iommu_get_fixed_address (dev) + dma_iommu_fixed_base; archdata->dma_data = (void *)addr; -dev_dbg (dev,"iommu: fixed addr = %lx\n" , addr); +dev_dbg (dev,"iommu: fixed addr = %llx\n" , addr); } static void insert_16M_pte(unsigned long addr, unsigned long *ptab,
arch/powerpc/platforms/cell/ras.c +4 -4
@@ -38,16 +38,16 @@ static void dump_fir(int cpu)/* Todo: do some nicer parsing of bits and based on them go down * to other sub-units FIRs and not only IIC */ -printk (KERN_ERR "Global Checkstop FIR : 0x%016lx\n" , +printk (KERN_ERR "Global Checkstop FIR : 0x%016llx\n" ,in_be64 (&pregs->checkstop_fir)); -printk (KERN_ERR "Global Recoverable FIR : 0x%016lx\n" , +printk (KERN_ERR "Global Recoverable FIR : 0x%016llx\n" ,in_be64 (&pregs->checkstop_fir)); -printk (KERN_ERR "Global MachineCheck FIR : 0x%016lx\n" , +printk (KERN_ERR "Global MachineCheck FIR : 0x%016llx\n" ,in_be64 (&pregs->spec_att_mchk_fir));if (iregs ==NULL )return ; -printk (KERN_ERR "IOC FIR : 0x%016lx\n" , +printk (KERN_ERR "IOC FIR : 0x%016llx\n" ,in_be64 (&iregs->ioc_fir)); }
arch/powerpc/platforms/cell/spu_base.c +4 -4
@@ -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);mb (); } }
@@ -151,7 +151,7 @@ static inline void spu_load_slb(struct s {struct spu_priv2 __iomem *priv2 = spu->priv2; -pr_debug ("%s: adding SLB[%d] 0x%016lx 0x%016lx\n" , +pr_debug ("%s: adding SLB[%d] 0x%016llx 0x%016llx\n" , __func__, slbe, slb->vsid, slb->esid);out_be64 (&priv2->slb_index_W, slbe);
@@ -221,7 +221,7 @@ static int __spu_trap_data_map(struct sp {int ret; -pr_debug ("%s, %lx, %lx\n" , __func__, dsisr, ea); +pr_debug ("%s, %llx, %lx\n" , __func__, dsisr, ea);/* * Handle kernel space hash faults immediately. User hash
arch/powerpc/platforms/cell/spu_callbacks.c +1 -1
@@ -54,7 +54,7 @@ long spu_sys_callback(struct spu_syscalllong (*syscall)(u64 a1,u64 a2,u64 a3,u64 a4,u64 a5,u64 a6);if (s->nr_ret >=ARRAY_SIZE (spu_syscall_table)) { -pr_debug ("%s: invalid syscall #%ld" , __func__, s->nr_ret); +pr_debug ("%s: invalid syscall #%lld" , __func__, s->nr_ret);return -ENOSYS ; }
arch/powerpc/platforms/iseries/iommu.c +2 -2
@@ -66,7 +66,7 @@ static int tce_build_iSeries(struct iomm rc =HvCallXm_setTce ((u64 )tbl->it_index, (u64 )index, tce);if (rc) -panic ("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n" , +panic ("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n" , rc); index++; uaddr +=TCE_PAGE_SIZE ;
@@ -81,7 +81,7 @@ static void tce_free_iSeries(struct iommwhile (npages--) { rc =HvCallXm_setTce ((u64 )tbl->it_index, (u64 )index,0 );if (rc) -panic ("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%lx\n" , +panic ("PCI_DMA: HvCallXm_setTce failed, Rc: 0x%llx\n" , rc); index++; }
arch/powerpc/platforms/pasemi/cpufreq.c +1 -1
@@ -112,7 +112,7 @@ static int get_gizmo_latency(void)static void set_astate (int cpu,unsigned int astate) { -u64 flags; +unsigned long flags;/* Return if called before init has run */ if (unlikely (!sdcasr_mapbase))
arch/powerpc/platforms/pseries/iommu.c +17 -18
@@ -127,10 +127,10 @@ static int tce_build_pSeriesLP(struct io }if (rc &&printk_ratelimit ()) { -printk ("tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld\n" , rc); -printk ("\tindex = 0x%lx\n" , (u64 )tbl->it_index); -printk ("\ttcenum = 0x%lx\n" , (u64 )tcenum); -printk ("\ttce val = 0x%lx\n" , tce ); +printk ("tce_build_pSeriesLP: plpar_tce_put failed. rc=%lld\n" , rc); +printk ("\tindex = 0x%llx\n" , (u64 )tbl->it_index); +printk ("\ttcenum = 0x%llx\n" , (u64 )tcenum); +printk ("\ttce val = 0x%llx\n" , tce );show_stack (current, (unsigned long *)__get_SP ()); }
@@ -210,10 +210,10 @@ static int tce_buildmulti_pSeriesLP(stru }if (rc &&printk_ratelimit ()) { -printk ("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%ld\n" , rc); -printk ("\tindex = 0x%lx\n" , (u64 )tbl->it_index); -printk ("\tnpages = 0x%lx\n" , (u64 )npages); -printk ("\ttce[0] val = 0x%lx\n" , tcep[0 ]); +printk ("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%lld\n" , rc); +printk ("\tindex = 0x%llx\n" , (u64 )tbl->it_index); +printk ("\tnpages = 0x%llx\n" , (u64 )npages); +printk ("\ttce[0] val = 0x%llx\n" , tcep[0 ]);show_stack (current, (unsigned long *)__get_SP ()); }return ret;
@@ -227,9 +227,9 @@ static void tce_free_pSeriesLP(struct io rc =plpar_tce_put ((u64 )tbl->it_index, (u64 )tcenum <<12 ,0 );if (rc &&printk_ratelimit ()) { -printk ("tce_free_pSeriesLP: plpar_tce_put failed. rc=%ld\n" , rc); -printk ("\tindex = 0x%lx\n" , (u64 )tbl->it_index); -printk ("\ttcenum = 0x%lx\n" , (u64 )tcenum); +printk ("tce_free_pSeriesLP: plpar_tce_put failed. rc=%lld\n" , rc); +printk ("\tindex = 0x%llx\n" , (u64 )tbl->it_index); +printk ("\ttcenum = 0x%llx\n" , (u64 )tcenum);show_stack (current, (unsigned long *)__get_SP ()); }
@@ -246,9 +246,9 @@ static void tce_freemulti_pSeriesLP(struif (rc &&printk_ratelimit ()) {printk ("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n" ); -printk ("\trc = %ld\n" , rc); -printk ("\tindex = 0x%lx\n" , (u64 )tbl->it_index); -printk ("\tnpages = 0x%lx\n" , (u64 )npages); +printk ("\trc = %lld\n" , rc); +printk ("\tindex = 0x%llx\n" , (u64 )tbl->it_index); +printk ("\tnpages = 0x%llx\n" , (u64 )npages);show_stack (current, (unsigned long *)__get_SP ()); } }
@@ -261,10 +261,9 @@ static unsigned long tce_get_pSeriesLP(s rc =plpar_tce_get ((u64 )tbl->it_index, (u64 )tcenum <<12 , &tce_ret);if (rc &&printk_ratelimit ()) { -printk ("tce_get_pSeriesLP: plpar_tce_get failed. rc=%ld\n" , - rc); -printk ("\tindex = 0x%lx\n" , (u64 )tbl->it_index); -printk ("\ttcenum = 0x%lx\n" , (u64 )tcenum); +printk ("tce_get_pSeriesLP: plpar_tce_get failed. rc=%lld\n" , rc); +printk ("\tindex = 0x%llx\n" , (u64 )tbl->it_index); +printk ("\ttcenum = 0x%llx\n" , (u64 )tcenum);show_stack (current, (unsigned long *)__get_SP ()); }
arch/powerpc/sysdev/mpic.c +1 -1
@@ -435,7 +435,7 @@ static void __init mpic_scan_ht_msi(stru addr = addr | ((u64 )readl (base +HT_MSI_ADDR_HI ) <<32 ); } -printk (KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%lx\n" , +printk (KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%llx\n" ,PCI_SLOT (devfn),PCI_FUNC (devfn), flags &HT_MSI_FLAGS_ENABLE ?"enabled" :"disabled" , addr);
drivers/char/hvc_beat.c +2 -2
@@ -44,7 +44,7 @@ static int hvc_beat_get_chars(uint32_t v static unsigned char q[sizeof(unsigned long) * 2] __attribute__((aligned(sizeof(unsigned long))));static int qlen =0 ; -unsigned long got; +u64 got; again:if (qlen) {
@@ -63,7 +63,7 @@ again: } }if (beat_get_term_char (vtermno, &got, - ((unsigned long *)q), ((unsigned long *)q) +1 ) ==0 ) { + ((u64 *)q), ((u64 *)q) +1 ) ==0 ) { qlen = got; goto again; }
drivers/net/pasemi_mac.c +3 -3
@@ -712,7 +712,7 @@ static inline void pasemi_mac_rx_error(c rcmdsta =read_dma_reg (PAS_DMA_RXINT_RCMDSTA (mac->dma_if)); ccmdsta =read_dma_reg (PAS_DMA_RXCHAN_CCMDSTA (chan->chno)); -printk (KERN_ERR "pasemi_mac: rx error. macrx %016lx, rx status %lx\n" , +printk (KERN_ERR "pasemi_mac: rx error. macrx %016llx, rx status %llx\n" , macrx, *chan->status); printk(KERN_ERR "pasemi_mac: rcmdsta %08x ccmdsta %08x\n",
@@ -730,8 +730,8 @@ static inline void pasemi_mac_tx_error(c cmdsta =read_dma_reg (PAS_DMA_TXCHAN_TCMDSTA (chan->chno)); -printk (KERN_ERR "pasemi_mac: tx error. mactx 0x%016lx, " \ -"tx status 0x%016lx\n" , mactx, *chan->status); +printk (KERN_ERR "pasemi_mac: tx error. mactx 0x%016llx, " \ +"tx status 0x%016llx\n" , mactx, *chan->status);printk (KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n" , cmdsta); }
drivers/pcmcia/electra_cf.c +1 -1
@@ -297,7 +297,7 @@ static int __devinit electra_cf_probe(st goto fail3; } -dev_info (device,"at mem 0x%lx io 0x%lx irq %d\n" , +dev_info (device,"at mem 0x%lx io 0x%llx irq %d\n" , cf->mem_phys, io.start, cf->irq); cf->active =1 ;
drivers/scsi/ibmvscsi/ibmvscsi.c +6 -6
@@ -1060,7 +1060,7 @@ static int ibmvscsi_eh_abort_handler(str }sdev_printk (KERN_INFO , cmd->device, -"aborting command. lun 0x%lx, tag 0x%lx\n" , +"aborting command. lun 0x%llx, tag 0x%llx\n" , (((u64 ) lun) <<48 ), (u64 ) found_evt);wait_for_completion (&evt->comp);
@@ -1081,7 +1081,7 @@ static int ibmvscsi_eh_abort_handler(strif (rsp_rc) {if (printk_ratelimit ())sdev_printk (KERN_WARNING , cmd->device, -"abort code %d for task tag 0x%lx\n" , +"abort code %d for task tag 0x%llx\n" , rsp_rc, tsk_mgmt->task_tag);return FAILED ; }
@@ -1101,12 +1101,12 @@ static int ibmvscsi_eh_abort_handler(strif (found_evt ==NULL ) {spin_unlock_irqrestore (hostdata->host->host_lock, flags); -sdev_printk (KERN_INFO , cmd->device,"aborted task tag 0x%lx completed\n" , +sdev_printk (KERN_INFO , cmd->device,"aborted task tag 0x%llx completed\n" , tsk_mgmt->task_tag);return SUCCESS ; } -sdev_printk (KERN_INFO , cmd->device,"successfully aborted task tag 0x%lx\n" , +sdev_printk (KERN_INFO , cmd->device,"successfully aborted task tag 0x%llx\n" , tsk_mgmt->task_tag); cmd->result = (DID_ABORT <<16 );
@@ -1181,7 +1181,7 @@ static int ibmvscsi_eh_device_reset_handreturn FAILED ; } -sdev_printk (KERN_INFO , cmd->device,"resetting device. lun 0x%lx\n" , +sdev_printk (KERN_INFO , cmd->device,"resetting device. lun 0x%llx\n" , (((u64 ) lun) <<48 ));wait_for_completion (&evt->comp);
@@ -1202,7 +1202,7 @@ static int ibmvscsi_eh_device_reset_handif (rsp_rc) {if (printk_ratelimit ())sdev_printk (KERN_WARNING , cmd->device, -"reset code %d for task tag 0x%lx\n" , +"reset code %d for task tag 0x%llx\n" , rsp_rc, tsk_mgmt->task_tag);return FAILED ; }
Re: [patch] powerpc: change u64/s64 to a long long integer type
Quoted 1 line · On Mon, 22 Dec 2008 09:03:41 +0100 Ingo Molnar <[email protected]> wrote:
Subject: powerpc: change u64/s64 to a long long integer type
<applause>
There are lots of other architctures that need doing though.
Re: [patch] powerpc: change u64/s64 to a long long integer type
Quoted 8 lines · Andrew Morton
Quoted 1 line · On Mon, 22 Dec 2008 09:03:41 +0100 Ingo Molnar <[email protected]> wrote:
Subject: powerpc: change u64/s64 to a long long integer type
<applause>
There are lots of other architctures that need doing though.
I have missed the introduction.
Can you explain why?
I have done a bit of sparc hacking lately and was wondering if sparc needs something similar.
cd arch/sparc
git grep u64 | grep -v __u64 | wc -l
448
[On the unified tree]
Sam
Re: [patch] powerpc: change u64/s64 to a long long integer type
Quoted 12 lines · Sam Ravnborg
Quoted 7 lines · Andrew Morton
Quoted 1 line · On Mon, 22 Dec 2008 09:03:41 +0100 Ingo Molnar <[email protected]> wrote:
Subject: powerpc: change u64/s64 to a long long integer type
<applause>
There are lots of other architctures that need doing though.
I have missed the introduction.
Can you explain why?
Quoted 7 lines
I have done a bit of sparc hacking lately and was wondering if sparc needs something similar.
cd
arch/sparc
git grep u64 | grep -v__u64| wc -l
448
This should only affect 64-bit architectures.
-hpa
Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
Re: [patch] powerpc: change u64/s64 to a long long integer type
Quoted 16 lines · H. Peter Anvin
Quoted 15 lines · Sam Ravnborg
Quoted 7 lines · Andrew Morton
Quoted 1 line · On Mon, 22 Dec 2008 09:03:41 +0100 Ingo Molnar <[email protected]> wrote:
Subject: powerpc: change u64/s64 to a long long integer type
<applause>
There are lots of other architctures that need doing though.
I have missed the introduction.
Can you explain why?I have done a bit of sparc hacking lately and was wondering if sparc needs something similar.
Quoted 6 lines
Quoted 4 lines
cd
arch/sparc
git grep u64 | grep -v__u64| wc -l
448This should only affect 64-bit architectures.
In the sparc-next tree:
ls arch/sparc64
ls: arch/sparc64: No such file or directory
We have unified sparc and sparc64 so they are in the same arch directory now. This will hit mainline in the upcoming merge window.
This has happended over at the sparclinux mailing list as this was sparc/sparc64 specific stuff so no wonder you have not heard about it.
Sam
Re: [patch] powerpc: change u64/s64 to a long long integer type
In reply to Sam RavnborgQuoted 4 lines · On Tue, 23 Dec 2008 00:00:35 +0100 Sam Ravnborg <[email protected]> wrote:
Quoted 3 lines · Andrew Morton
On Mon, 22 Dec 2008 09:03:41 +0100
Ingo Molnar <[email protected]> wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Subject: powerpc: change u64/s64 to a long long integer type
<applause>
There are lots of other architctures that need doing though.
I have missed the introduction.
Can you explain why?
People keep on doing
printk("%llu", some_u64);testing it only on x86_64 and this generates a warning storm on powerpc, sparc64, etc. Because they use long', not long long'.
And not just a little bit - this bug gets repeated maybe ten times per week - it's insane.
If we make all architectures use `long long' then the above code becomes correct and warning-free on all architectures.
And we then get to remove all the open-coded (unsigned long long) casts which we added all over the tree (hundreds of them).
Quoted 8 lines
I have done a bit of sparc hacking lately and was wondering if sparc needs something similar.
cd
arch/sparc
git grep u64 | grep -v__u64| wc -l
448[On the unified tree]
Yes, quite a few 64-bit architectures are using long' for their s64/u64 types. We should convert them all to long long'.
That's quite trivial to do, but it causes a lot of warnings due to code in arch-speciic files which does
printk("%lu", some_u64);which will then generate a warning. Or an error if the archtiecture uses -Werror, which several do. So we need to simultaneously convert all those to %llu. (Or %Lu, which saves a byte :))
PATCH 1/1 sparc64: use unsigned long long for u64
Andrew Morton wrote:
People keep on doing
printk("%llu", some_u64);
testing it only on x86_64 and this generates a warning storm on powerpc, sparc64, etc. Because they use long', not long long'.
Quite a few 64-bit architectures are using long' for their s64/u64 types. We should convert them all to long long'.
Update types.h so we use unsigned long long for u64 and fix all warnings in sparc64 code.
Tested with an allnoconfig, defconfig and allmodconfig builds.
This patch introduces additional warnings in several drivers. These will be dealt with in separate patches.
---
It may take a few days before the drivers gets fixed. Christmas is approaching fast by now.
Sam
arch/sparc/include/asm/timer_64.h | 2 +- arch/sparc/include/asm/types.h | 2 +- arch/sparc/kernel/ds.c | 34 +++++++++++++++++----------------- arch/sparc/kernel/iommu.c | 2 +- arch/sparc/kernel/mdesc.c | 14 +++++++------- arch/sparc/kernel/of_device_64.c | 2 +- arch/sparc/kernel/pci.c | 2 +- arch/sparc/kernel/pci_common.c | 2 +- arch/sparc/kernel/pci_msi.c | 4 ++-- arch/sparc/kernel/pci_schizo.c | 2 +- arch/sparc/kernel/pci_sun4v.c | 2 +- arch/sparc/kernel/power.c | 2 +- arch/sparc/kernel/prom_irqtrans.c | 2 +- arch/sparc/kernel/psycho_common.c | 2 +- arch/sparc/kernel/smp_64.c | 4 ++-- arch/sparc/kernel/time_64.c | 12 ++++++------ arch/sparc/kernel/traps_64.c | 20 ++++++++++---------- arch/sparc/kernel/vio.c | 4 ++-- arch/sparc/mm/init_64.c | 16 ++++++++-------- 19 files changed, 65 insertions(+), 65 deletions(-)
arch/sparc/include/asm/timer_64.h +1 -1
@@ -10,7 +10,7 @@#include <linux/init.h> struct sparc64_tick_ops { -unsigned long (*get_tick)(void ); +unsigned long long (*get_tick)(void );int (*add_compare)(unsigned long );unsigned long softint_mask;void (*disable_irq)(void );
arch/sparc/include/asm/types.h +1 -1
@@ -11,7 +11,7 @@#if defined(__sparc__) && defined(__arch64__)/*** SPARC 64 bit ***/ -#include <asm-generic/int-l64.h> +#include <asm-generic/int-ll64.h> #ifndef __ASSEMBLY__
arch/sparc/kernel/ds.c +17 -17
@@ -286,7 +286,7 @@ static void md_update_data(struct ds_info *dp, rp = (struct ds_md_update_req *) (dpkt +1 ); -printk (KERN_INFO "ds-%lu: Machine description update.\n" , dp->id); +printk (KERN_INFO "ds-%llu: Machine description update.\n" , dp->id);mdesc_update ();
@@ -325,7 +325,7 @@ static void domain_shutdown_data(struct ds_info *dp, rp = (struct ds_shutdown_req *) (dpkt +1 ); -printk (KERN_ALERT "ds-%lu: Shutdown request from " +printk (KERN_ALERT "ds-%llu: Shutdown request from " "LDOM manager received.\n" , dp->id);memset (&pkt,0 ,sizeof (pkt));
@@ -365,7 +365,7 @@ static void domain_panic_data(struct ds_info *dp, rp = (struct ds_panic_req *) (dpkt +1 ); -printk (KERN_ALERT "ds-%lu: Panic request from " +printk (KERN_ALERT "ds-%llu: Panic request from " "LDOM manager received.\n" , dp->id);memset (&pkt,0 ,sizeof (pkt));
@@ -549,7 +549,7 @@ static int __cpuinit dr_cpu_configure(struct ds_info *dp,for_each_cpu_mask (cpu, *mask) {int err; -printk (KERN_INFO "ds-%lu: Starting cpu %d...\n" , +printk (KERN_INFO "ds-%llu: Starting cpu %d...\n" , dp->id, cpu); err =cpu_up (cpu);if (err) {
@@ -565,7 +565,7 @@ static int __cpuinit dr_cpu_configure(struct ds_info *dp, res =DR_CPU_RES_CPU_NOT_RESPONDING ; } -printk (KERN_INFO "ds-%lu: CPU startup failed err=%d\n" , +printk (KERN_INFO "ds-%llu: CPU startup failed err=%d\n" , dp->id, err);dr_cpu_mark (resp, cpu, ncpus, res, stat); }
@@ -605,7 +605,7 @@ static int dr_cpu_unconfigure(struct ds_info *dp,for_each_cpu_mask (cpu, *mask) {int err; -printk (KERN_INFO "ds-%lu: Shutting down cpu %d...\n" , +printk (KERN_INFO "ds-%llu: Shutting down cpu %d...\n" , dp->id, cpu); err =cpu_down (cpu);if (err)
@@ -684,7 +684,7 @@ static void ds_pri_data(struct ds_info *dp, rp = (struct ds_pri_msg *) (dpkt +1 ); -printk (KERN_INFO "ds-%lu: PRI REQ [%lx:%lx], len=%d\n" , +printk (KERN_INFO "ds-%llu: PRI REQ [%llx:%llx], len=%d\n" , dp->id, rp->req_num, rp->type, len); }
@@ -816,7 +816,7 @@ void ldom_set_var(const char *var, const char *value)if (ds_var_doorbell ==0 || ds_var_response !=DS_VAR_SUCCESS ) -printk (KERN_ERR "ds-%lu: var-config [%s:%s] " +printk (KERN_ERR "ds-%llu: var-config [%s:%s] " "failed, response(%d).\n" , dp->id, var, value, ds_var_response);
@@ -850,7 +850,7 @@ void ldom_power_off(void)static void ds_conn_reset (struct ds_info *dp) { -printk (KERN_ERR "ds-%lu: ds_conn_reset() from %p\n" , +printk (KERN_ERR "ds-%llu: ds_conn_reset() from %p\n" , dp->id,__builtin_return_address (0 )); }
@@ -912,11 +912,11 @@ static int ds_handshake(struct ds_info *dp, struct ds_msg_tag *pkt)struct ds_cap_state *cp =find_cap (dp, ap->handle);if (!cp) { -printk (KERN_ERR "ds-%lu: REG ACK for unknown " -"handle %lx\n" , dp->id, ap->handle); +printk (KERN_ERR "ds-%llu: REG ACK for unknown " +"handle %llx\n" , dp->id, ap->handle);return 0 ; } -printk (KERN_INFO "ds-%lu: Registered %s service.\n" , +printk (KERN_INFO "ds-%llu: Registered %s service.\n" , dp->id, cp->service_id); cp->state =CAP_STATE_REGISTERED ; }else if (pkt->type ==DS_REG_NACK ) {
@@ -924,8 +924,8 @@ static int ds_handshake(struct ds_info *dp, struct ds_msg_tag *pkt)struct ds_cap_state *cp =find_cap (dp, np->handle);if (!cp) { -printk (KERN_ERR "ds-%lu: REG NACK for " -"unknown handle %lx\n" , +printk (KERN_ERR "ds-%llu: REG NACK for " +"unknown handle %llx\n" , dp->id, np->handle);return 0 ; }
@@ -982,8 +982,8 @@ static void process_ds_work(void)int req_len = qp->req_len;if (!cp) { -printk (KERN_ERR "ds-%lu: Data for unknown " -"handle %lu\n" , +printk (KERN_ERR "ds-%llu: Data for unknown " +"handle %llu\n" , dp->id, dpkt->handle);spin_lock_irqsave (&ds_lock, flags);
@@ -1085,7 +1085,7 @@ static void ds_event(void *arg, int event) }if (event !=LDC_EVENT_DATA_READY ) { -printk (KERN_WARNING "ds-%lu: Unexpected LDC event %d\n" , +printk (KERN_WARNING "ds-%llu: Unexpected LDC event %d\n" , dp->id, event);spin_unlock_irqrestore (&ds_lock, flags);return ;
arch/sparc/kernel/iommu.c +1 -1
@@ -434,7 +434,7 @@ static void strbuf_flush(struct strbuf *strbuf, struct iommu *iommu, val =iommu_read (matchreg);if (unlikely (val)) {printk (KERN_WARNING "strbuf_flush: ctx flush " -"timeout matchreg[%lx] ctx[%lx]\n" , +"timeout matchreg[%llx] ctx[%lx]\n" , val, ctx); goto do_page_flush; }
arch/sparc/kernel/mdesc.c +7 -7
@@ -536,24 +536,24 @@ static void __init report_platform_properties(void) v =mdesc_get_property (hp, pn,"hostid" ,NULL );if (v) -printk ("PLATFORM: hostid [%08lx]\n" , *v); +printk ("PLATFORM: hostid [%08llx]\n" , *v); v =mdesc_get_property (hp, pn,"serial#" ,NULL );if (v) -printk ("PLATFORM: serial# [%08lx]\n" , *v); +printk ("PLATFORM: serial# [%08llx]\n" , *v); v =mdesc_get_property (hp, pn,"stick-frequency" ,NULL ); -printk ("PLATFORM: stick-frequency [%08lx]\n" , *v); +printk ("PLATFORM: stick-frequency [%08llx]\n" , *v); v =mdesc_get_property (hp, pn,"mac-address" ,NULL );if (v) -printk ("PLATFORM: mac-address [%lx]\n" , *v); +printk ("PLATFORM: mac-address [%llx]\n" , *v); v =mdesc_get_property (hp, pn,"watchdog-resolution" ,NULL );if (v) -printk ("PLATFORM: watchdog-resolution [%lu ms]\n" , *v); +printk ("PLATFORM: watchdog-resolution [%llu ms]\n" , *v); v =mdesc_get_property (hp, pn,"watchdog-max-timeout" ,NULL );if (v) -printk ("PLATFORM: watchdog-max-timeout [%lu ms]\n" , *v); +printk ("PLATFORM: watchdog-max-timeout [%llu ms]\n" , *v); v =mdesc_get_property (hp, pn,"max-cpus" ,NULL );if (v) -printk ("PLATFORM: max-cpus [%lu]\n" , *v); +printk ("PLATFORM: max-cpus [%llu]\n" , *v);#ifdef CONFIG_SMP {
arch/sparc/kernel/of_device_64.c +1 -1
@@ -554,7 +554,7 @@ static void __init build_device_resources(struct of_device *op,memset (r,0 ,sizeof (*r));if (of_resource_verbose) -printk ("%s reg[%d] -> %lx\n" , +printk ("%s reg[%d] -> %llx\n" , op->node->full_name, index, result);
arch/sparc/kernel/pci.c +1 -1
@@ -223,7 +223,7 @@ static void pci_parse_of_addrs(struct of_device *op,continue ; i = addrs[0 ] &0xff ;if (ofpci_verbose) -printk (" start: %lx, end: %lx, i: %x\n" , +printk (" start: %llx, end: %llx, i: %x\n" , op_res->start, op_res->end, i);if (PCI_BASE_ADDRESS_0 <= i && i <=PCI_BASE_ADDRESS_5 ) {
arch/sparc/kernel/pci_common.c +1 -1
@@ -457,7 +457,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm)prom_halt (); } -printk ("%s: PCI IO[%lx] MEM[%lx]\n" , +printk ("%s: PCI IO[%llx] MEM[%llx]\n" , pbm->name, pbm->io_space.start, pbm->mem_space.start);
arch/sparc/kernel/pci_msi.c +2 -2
@@ -426,8 +426,8 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm, pbm->name, pbm->msi_first, pbm->msi_num, pbm->msi_data_mask, pbm->msix_data_width); -printk (KERN_INFO "%s: MSI addr32[0x%lx:0x%x] " -"addr64[0x%lx:0x%x]\n" , +printk (KERN_INFO "%s: MSI addr32[0x%llx:0x%x] " +"addr64[0x%llx:0x%x]\n" , pbm->name, pbm->msi32_start, pbm->msi32_len, pbm->msi64_start, pbm->msi64_len);
arch/sparc/kernel/pci_schizo.c +1 -1
@@ -794,7 +794,7 @@ static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id) pbm->controller_regs + SCHIZO_SAFARI_ERRLOG);if (!(errlog &BUS_ERROR_UNMAP )) { -printk ("%s: Unexpected Safari/JBUS error interrupt, errlog[%016lx]\n" , +printk ("%s: Unexpected Safari/JBUS error interrupt, errlog[%016llx]\n" , pbm->name, errlog);return IRQ_HANDLED ;
arch/sparc/kernel/pci_sun4v.c +1 -1
@@ -73,7 +73,7 @@ static long iommu_batch_flush(struct iommu_batch *p)if (unlikely (num <0 )) {if (printk_ratelimit ())printk ("iommu_batch_flush: IOMMU map of " -"[%08lx:%08lx:%lx:%lx:%lx] failed with " +"[%08lx:%08llx:%lx:%lx:%lx] failed with " "status %ld\n" , devhandle,HV_PCI_TSBID (0 , entry), npages, prot,__pa (pglist), num);
arch/sparc/kernel/power.c +1 -1
@@ -40,7 +40,7 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id power_reg =of_ioremap (res,0 ,0x4 ,"power" ); -printk (KERN_INFO "%s: Control reg at %lx\n" , +printk (KERN_INFO "%s: Control reg at %llx\n" , op->node->name, res->start);if (has_button_interrupt (irq, op->node)) {
arch/sparc/kernel/prom_irqtrans.c +1 -1
@@ -346,7 +346,7 @@ static void tomatillo_wsync_handler(unsigned int ino, void *_arg1, void *_arg2)break ; }if (limit <=0 ) { -printk ("tomatillo_wsync_handler: DMA won't sync [%lx:%lx]\n" , +printk ("tomatillo_wsync_handler: DMA won't sync [%llx:%llx]\n" , val, mask); }
arch/sparc/kernel/psycho_common.c +1 -1
@@ -331,7 +331,7 @@ irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) (afsr &PSYCHO_PCIAFSR_BMSK ) >>32UL , (afsr &PSYCHO_PCIAFSR_MID ) >>25UL , (afsr & PSYCHO_PCIAFSR_BLK) ? 1 : 0); -printk (KERN_ERR "%s: PCI AFAR [%016lx]\n" , pbm->name, afar); +printk (KERN_ERR "%s: PCI AFAR [%016llx]\n" , pbm->name, afar);printk (KERN_ERR "%s: PCI Secondary errors [" , pbm->name); reported =0 ;if (afsr &PSYCHO_PCIAFSR_SMA ) {
arch/sparc/kernel/smp_64.c +2 -2
@@ -453,7 +453,7 @@ again: __asm__ __volatile__("wrpr %0, 0x0, %%pstate" : :"r" (pstate));if (stuck ==0 ) { -printk ("CPU[%d]: mondo stuckage result[%016lx]\n" , +printk ("CPU[%d]: mondo stuckage result[%016llx]\n" ,smp_processor_id (), result); }else {udelay (2 );
@@ -588,7 +588,7 @@ retry:/* Busy bits will not clear, continue instead * of freezing up on this cpu. */ -printk ("CPU[%d]: mondo stuckage result[%016lx]\n" , +printk ("CPU[%d]: mondo stuckage result[%016llx]\n" ,smp_processor_id (), dispatch_stat); }else {int i, this_busy_nack =0 ;
arch/sparc/kernel/time_64.c +6 -6
@@ -106,7 +106,7 @@ static void tick_init_tick(void)tick_disable_irq (); } -static unsigned long tick_get_tick (void ) +static unsigned long long tick_get_tick (void ) {unsigned long ret;
@@ -208,7 +208,7 @@ static void stick_init_tick(void)stick_disable_irq (); } -static unsigned long stick_get_tick (void ) +static unsigned long long stick_get_tick (void ) {unsigned long ret;
@@ -352,7 +352,7 @@ static void hbtick_init_tick(void)hbtick_disable_irq (); } -static unsigned long hbtick_get_tick (void ) +static unsigned long long hbtick_get_tick (void ) {return __hbird_read_stick () & ~TICK_PRIV_BIT ; }
@@ -422,7 +422,7 @@ static int __devinit rtc_probe(struct of_device *op, const struct of_device_id * {struct resource *r; -printk (KERN_INFO "%s: RTC regs at 0x%lx\n" , +printk (KERN_INFO "%s: RTC regs at 0x%llx\n" , op->node->full_name, op->resource[0 ].start);/* The CMOS RTC driver only accepts IORESOURCE_IO, so cons
@@ -478,7 +478,7 @@ static struct platform_device rtc_bq4802_device = {static int __devinit bq4802_probe (struct of_device *op,const struct of_device_id *match) { -printk (KERN_INFO "%s: BQ4802 regs at 0x%lx\n" , +printk (KERN_INFO "%s: BQ4802 regs at 0x%llx\n" , op->node->full_name, op->resource[0 ].start); rtc_bq4802_device.resource = &op->resource[0 ];
@@ -542,7 +542,7 @@ static int __devinit mostek_probe(struct of_device *op, const struct of_device_i strcmp(dp->parent->parent->name, "central") != 0)return -ENODEV ; -printk (KERN_INFO "%s: Mostek regs at 0x%lx\n" , +printk (KERN_INFO "%s: Mostek regs at 0x%llx\n" , dp->full_name, op->resource[0 ].start); m48t59_rtc.resource = &op->resource[0 ];
arch/sparc/kernel/traps_64.c +10 -10
@@ -1168,20 +1168,20 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in }/* Now dump the cache snapshots. */ -printk ("%s" "ERROR(%d): D-cache idx[%x] tag[%016lx] utag[%016lx] stag[%016lx]\n" , +printk ("%s" "ERROR(%d): D-cache idx[%x] tag[%016llx] utag[%016llx] stag[%016llx]\n" , (recoverable ?KERN_WARNING :KERN_CRIT ),smp_processor_id (), (int ) info->dcache_index, info->dcache_tag, info->dcache_utag, info->dcache_stag); -printk ("%s" "ERROR(%d): D-cache data0[%016lx] data1[%016lx] data2[%016lx] data3[%016lx]\n" , +printk ("%s" "ERROR(%d): D-cache data0[%016llx] data1[%016llx] data2[%016llx] data3[%016llx]\n" , (recoverable ?KERN_WARNING :KERN_CRIT ),smp_processor_id (), info->dcache_data[0 ], info->dcache_data[1 ], info->dcache_data[2 ], info->dcache_data[3 ]); - printk("%s" "ERROR(%d): I-cache idx[%x] tag[%016lx] utag[%016lx] stag[%016lx] " - "u[%016lx] l[%016lx]\n", + printk("%s" "ERROR(%d): I-cache idx[%x] tag[%016llx] utag[%016llx] stag[%016llx] " + "u[%016llx] l[%016llx]\n", (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), (int) info->icache_index, info->icache_tag,
@@ -1189,22 +1189,22 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in info->icache_stag, info->icache_upper, info->icache_lower); -printk ("%s" "ERROR(%d): I-cache INSN0[%016lx] INSN1[%016lx] INSN2[%016lx] INSN3[%016lx]\n" , +printk ("%s" "ERROR(%d): I-cache INSN0[%016llx] INSN1[%016llx] INSN2[%016llx] INSN3[%016llx]\n" , (recoverable ?KERN_WARNING :KERN_CRIT ),smp_processor_id (), info->icache_data[0 ], info->icache_data[1 ], info->icache_data[2 ], info->icache_data[3 ]); -printk ("%s" "ERROR(%d): I-cache INSN4[%016lx] INSN5[%016lx] INSN6[%016lx] INSN7[%016lx]\n" , +printk ("%s" "ERROR(%d): I-cache INSN4[%016llx] INSN5[%016llx] INSN6[%016llx] INSN7[%016llx]\n" , (recoverable ?KERN_WARNING :KERN_CRIT ),smp_processor_id (), info->icache_data[4 ], info->icache_data[5 ], info->icache_data[6 ], info->icache_data[7 ]); -printk ("%s" "ERROR(%d): E-cache idx[%x] tag[%016lx]\n" , +printk ("%s" "ERROR(%d): E-cache idx[%x] tag[%016llx]\n" , (recoverable ?KERN_WARNING :KERN_CRIT ),smp_processor_id (), (int ) info->ecache_index, info->ecache_tag); - printk("%s" "ERROR(%d): E-cache data0[%016lx] data1[%016lx] data2[%016lx] data3[%016lx]\n", + printk("%s" "ERROR(%d): E-cache data0[%016llx] data1[%016llx] data2[%016llx] data3[%016llx]\n", (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), info->ecache_data[0], info->ecache_data[1],
@@ -1794,7 +1794,7 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,int cnt;printk ("%s: Reporting on cpu %d\n" , pfx, cpu); - printk("%s: err_handle[%lx] err_stick[%lx] err_type[%08x:%s]\n", + printk("%s: err_handle[%llx] err_stick[%llx] err_type[%08x:%s]\n", pfx, ent->err_handle, ent->err_stick, ent->err_type,
@@ -1818,7 +1818,7 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, "privileged" : ""), ((ent->err_attrs &SUN4V_ERR_ATTRS_RES_QUEUE_FULL ) ? "queue-full" : "")); -printk ("%s: err_raddr[%016lx] err_size[%u] err_cpu[%u]\n" , +printk ("%s: err_raddr[%016llx] err_size[%u] err_cpu[%u]\n" , pfx, ent->err_raddr, ent->err_size, ent->err_cpu);
arch/sparc/kernel/vio.c +2 -2
@@ -263,10 +263,10 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,dev_set_name (&vdev->dev,"%s" , bus_id_name); vdev->dev_no = ~(u64 )0 ; }else if (!cfg_handle) { -dev_set_name (&vdev->dev,"%s-%lu" , bus_id_name, *id); +dev_set_name (&vdev->dev,"%s-%llu" , bus_id_name, *id); vdev->dev_no = *id; }else { -dev_set_name (&vdev->dev,"%s-%lu-%lu" , bus_id_name, +dev_set_name (&vdev->dev,"%s-%llu-%llu" , bus_id_name, *cfg_handle, *id); vdev->dev_no = *cfg_handle; }
arch/sparc/mm/init_64.c +8 -8
@@ -769,8 +769,8 @@ static int find_node(unsigned long addr)return -1 ; } -static unsigned long nid_range (unsigned long start,unsigned long end, -int *nid) +static unsigned long long nid_range (unsigned long long start, +unsigned long long end,int *nid) { *nid =find_node (start); start +=PAGE_SIZE ;
@@ -788,8 +788,8 @@ static unsigned long nid_range(unsigned long start, unsigned long end, return start; }#else -static unsigned long nid_range (unsigned long start,unsigned long end, -int *nid) +static unsigned long long nid_range (unsigned long long start, +unsigned long long end,int *nid) { *nid =0 ;return end;
@@ -1016,8 +1016,8 @@ static int __init grab_mlgroups(struct mdesc_handle *md) val =mdesc_get_property (md, node,"address-mask" ,NULL ); m->mask = *val; -numadbg ("MLGROUP[%d]: node[%lx] latency[%lx] " -"match[%lx] mask[%lx]\n" , +numadbg ("MLGROUP[%d]: node[%llx] latency[%llx] " +"match[%llx] mask[%llx]\n" , count -1 , m->node, m->latency, m->match, m->mask); }
@@ -1056,7 +1056,7 @@ static int __init grab_mblocks(struct mdesc_handle *md) "address-congruence-offset", NULL); m->offset = *val; -numadbg ("MBLOCK[%d]: base[%lx] size[%lx] offset[%lx]\n" , +numadbg ("MBLOCK[%d]: base[%llx] size[%llx] offset[%llx]\n" , count -1 , m->base, m->size, m->offset); }
@@ -1127,7 +1127,7 @@ static int __init numa_attach_mlgroup(struct mdesc_handle *md, u64 grp, n->mask = candidate->mask; n->val = candidate->match; -numadbg ("NUMA NODE[%d]: mask[%lx] val[%lx] (latency[%lx])\n" , +numadbg ("NUMA NODE[%d]: mask[%lx] val[%lx] (latency[%llx])\n" , index, n->mask, n->val, candidate->latency);return 0 ;
Signature · 1 line
1.6.0.2.GIT
PATCH 1/1 sparc64: fix unsigned long long warnings in drivers
Fix warnings caused by the unsigned long long usage in sparc specific drivers.
The drivers were considered sparc specific more or less from the filename alone.
---
This turned out easier than expected.
There were a few generic related warnings that I did not touch. I can split it up in smaller chunks if preferred.
Sam
drivers/block/sunvdc.c | 8 ++++---- drivers/char/hw_random/n2-drv.c | 2 +- drivers/net/sunvnet.c | 8 ++++---- drivers/sbus/char/display7seg.c | 2 +- sound/sparc/cs4231.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-)
drivers/block/sunvdc.c +4 -4
@@ -153,7 +153,7 @@ static int vdc_send_attr(struct vio_driver_state *vio) pkt.vdisk_block_size = port->vdisk_block_size; pkt.max_xfer_size = port->max_xfer_size; -viodbg (HS ,"SEND ATTR xfer_mode[0x%x] blksz[%u] max_xfer[%lu]\n" , +viodbg (HS ,"SEND ATTR xfer_mode[0x%x] blksz[%u] max_xfer[%llu]\n" , pkt.xfer_mode, pkt.vdisk_block_size, pkt.max_xfer_size);return vio_ldc_send (&port->vio, &pkt,sizeof (pkt));
@@ -164,8 +164,8 @@ static int vdc_handle_attr(struct vio_driver_state *vio, void *arg)struct vdc_port *port =to_vdc_port (vio);struct vio_disk_attr_info *pkt = arg; - viodbg(HS, "GOT ATTR stype[0x%x] ops[%lx] disk_size[%lu] disk_type[%x] " - "xfer_mode[0x%x] blksz[%u] max_xfer[%lu]\n", + viodbg(HS, "GOT ATTR stype[0x%x] ops[%llx] disk_size[%llu] disk_type[%x] " + "xfer_mode[0x%x] blksz[%u] max_xfer[%llu]\n", pkt->tag.stype, pkt->operations, pkt->vdisk_size, pkt->vdisk_type, pkt->xfer_mode, pkt->vdisk_block_size,
@@ -753,7 +753,7 @@ static int __devinit vdc_port_probe(struct vio_dev *vdev, err = -ENODEV ;if ((vdev->dev_no <<PARTITION_SHIFT ) & ~(u64 )MINORMASK ) { - printk(KERN_ERR PFX "Port id [%lu] too large.\n", + printk(KERN_ERR PFX "Port id [%llu] too large.\n", vdev->dev_no); goto err_out_release_mdesc; }
drivers/char/hw_random/n2-drv.c +1 -1
@@ -482,7 +482,7 @@ static void n2rng_dump_test_buffer(struct n2rng *np)int i;for (i =0 ; i <SELFTEST_BUFFER_WORDS ; i++) -dev_err (&np->op->dev,"Test buffer slot %d [0x%016lx]\n" , +dev_err (&np->op->dev,"Test buffer slot %d [0x%016llx]\n" , i, np->test_buffer[i]); }
drivers/net/sunvnet.c +4 -4
@@ -336,7 +336,7 @@ static int vnet_walk_rx_one(struct vnet_port *port,if (IS_ERR (desc))return PTR_ERR (desc); - viodbg(DATA, "vio_walk_rx_one desc[%02x:%02x:%08x:%08x:%lx:%lx]\n", + viodbg(DATA, "vio_walk_rx_one desc[%02x:%02x:%08x:%08x:%llx:%llx]\n", desc->hdr.state, desc->hdr.ack, desc->size, desc->ncookies, desc->cookies[0].cookie_addr,
@@ -394,14 +394,14 @@ static int vnet_rx(struct vnet_port *port, void *msgbuf)struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_RX_RING ];struct vio_driver_state *vio = &port->vio; -viodbg (DATA ,"vnet_rx stype_env[%04x] seq[%016lx] rcv_nxt[%016lx]\n" , +viodbg (DATA ,"vnet_rx stype_env[%04x] seq[%016llx] rcv_nxt[%016llx]\n" , pkt->tag.stype_env, pkt->seq, dr->rcv_nxt);if (unlikely (pkt->tag.stype_env !=VIO_DRING_DATA ))return 0 ;if (unlikely (pkt->seq != dr->rcv_nxt)) { - printk(KERN_ERR PFX "RX out of sequence seq[0x%lx] " - "rcv_nxt[0x%lx]\n", pkt->seq, dr->rcv_nxt); + printk(KERN_ERR PFX "RX out of sequence seq[0x%llx] " + "rcv_nxt[0x%llx]\n", pkt->seq, dr->rcv_nxt);return 0 ; }
drivers/sbus/char/display7seg.c +1 -1
@@ -214,7 +214,7 @@ static int __devinit d7s_probe(struct of_device *op,writeb (regs, p->regs); - printk(KERN_INFO PFX "7-Segment Display%s at [%s:0x%lx] %s\n", + printk(KERN_INFO PFX "7-Segment Display%s at [%s:0x%llx] %s\n", op->node->full_name, (regs &D7S_FLIP ) ?" (FLIPPED)" :"" , op->resource[0].start,
sound/sparc/cs4231.c +1 -1
@@ -2057,7 +2057,7 @@ static int __devinit cs4231_ebus_probe(struct of_device *op, const struct of_devif (err)return err; -sprintf (card->longname,"%s at 0x%lx, irq %d" , +sprintf (card->longname,"%s at 0x%llx, irq %d" , card->shortname, op->resource[0 ].start, op->irqs[0 ]);
Signature · 1 line
1.6.0.2.GIT
Re: [PATCH] sparc64: use unsigned long long for u64
In reply to Sam RavnborgQuoted 33 lines · Sam Ravnborg
Andrew Morton wrote:
People keep on doing
printk("%llu", some_u64);testing it only on
x86_64and this generates a warning storm on powerpc, sparc64, etc. Because they uselong', notlong long'.Quite a few 64-bit architectures are using
long' for their s64/u64 types. We should convert them all tolong long'.Update
types.hso we use unsigned long long for u64 and fix all warnings in sparc64 code.
Tested with an allnoconfig, defconfig and allmodconfig builds.This patch introduces additional warnings in several drivers. These will be dealt with in separate patches.
Signed-off-by Sam Ravnborg <[email protected]>Cc Andrew Morton <[email protected]>---
It may take a few days before the drivers gets fixed. Christmas is approaching fast by now.
Sam
arch/sparc/include/asm/timer_64.h +0
-0
arch/sparc/include/asm/timer_64.h line 13
Quoted 5 lines
arch/sparc/include/asm/timer_64.h +1
-1@@ -10,7 +10,7 @@#include <linux/init.h> struct sparc64_tick_ops { -unsigned long (*get_tick)(void ); +unsigned long long (*get_tick)(void );
wait, why does this need to be changed?
People having problem with:
u64 data;
seq_printf(m, "%llu ", data);This compiles fine with arch that defines u64 to unsigned long long (like x86), but generate compile time warning on arch that defines u64 to unsigned long.
Isn't that you just need to convert format string to %llu for u64 type?
- Ken
Re: [PATCH] sparc64: use unsigned long long for u64
Quoted 36 lines · Ken Chen
Quoted 35 lines · Sam Ravnborg
Andrew Morton wrote:
People keep on doing
printk("%llu", some_u64);testing it only on
x86_64and this generates a warning storm on powerpc, sparc64, etc. Because they uselong', notlong long'.Quite a few 64-bit architectures are using
long' for their s64/u64 types. We should convert them all tolong long'.Update
types.hso we use unsigned long long for u64 and fix all warnings in sparc64 code.
Tested with an allnoconfig, defconfig and allmodconfig builds.This patch introduces additional warnings in several drivers. These will be dealt with in separate patches.
Signed-off-by Sam Ravnborg <[email protected]>Cc Andrew Morton <[email protected]>---
It may take a few days before the drivers gets fixed. Christmas is approaching fast by now.
Sam
arch/sparc/include/asm/timer_64.h +0
-0@@ -10,7 +10,7 @@#include <linux/init.h>
Quoted 5 lines
arch/sparc/include/asm/timer_64.h line 13
Quoted 3 lines
arch/sparc/include/asm/timer_64.h +1
-1struct sparc64_tick_ops { -unsigned long (*get_tick)(void ); +unsigned long long (*get_tick)(void );wait, why does this need to be changed?
We have:
clocksource_tick.read = tick_ops->get_tick;
And clocksource_tick is of type clocksource:
struct clocksource {
...
cycle_t (*read)(void);And cycle_t is:
/* clocksource cycle base type */
typedef u64 cycle_t;
And u64 is now:
unsigned long long - thus we need to fix prototype of get_tick to fix the warnings.
A cast could do it - but fixing the real problem
is better here.
Sam
Re: [PATCH] sparc64: use unsigned long long for u64
Quoted 15 lines · Sam Ravnborg
Quoted 1 line
wait, why does this need to be changed?
We have:
clocksource_tick.read = tick_ops->get_tick;And
clocksource_tickis of type clocksource:struct clocksource { ... cycle_t (*read)(void);And
cycle_tis:
/* clocksource cycle base type */
typedef u64cycle_t;
Quoted 6 lines
And u64 is now:
unsigned long long - thus we need to fix prototype ofget_tickto fix the warnings.A cast could do it - but fixing the real problem
is better here.
Sounds good to me. It was just a question. Thank you for the explanation.
- Ken
Re: [PATCH] sparc64: use unsigned long long for u64
Quoted 16 lines · Ken Chen
Quoted 15 lines · Sam Ravnborg
Quoted 1 line
wait, why does this need to be changed?
We have:
clocksource_tick.read = tick_ops->get_tick;And
clocksource_tickis of type clocksource:struct clocksource { ... cycle_t (*read)(void);And
cycle_tis:
/* clocksource cycle base type */
typedef u64cycle_t;
Quoted 8 lines
Quoted 6 lines
And u64 is now:
unsigned long long - thus we need to fix prototype ofget_tickto fix the warnings.A cast could do it - but fixing the real problem
is better here.Sounds good to me. It was just a question. Thank you for the explanation.
Hey - it triggered me to take a deeper look at it.
And thanks for actually reading the patch - it's always good that an extra pair of eyes look over it even it is only quick browsing.
Sam
David Miller
maintainerRe: [PATCH] sparc64: use unsigned long long for u64
In reply to Sam RavnborgFrom: Sam Ravnborg <[email protected]>
Date: Tue, 23 Dec 2008 14:17:46 +0100
Quoted 2 lines
It may take a few days before the drivers gets fixed. Christmas is approaching fast by now.
Even with this and your driver patch applied, the tree doesn't build successfully:
cc1: warnings being treated as errorsarch/sparc/kernel/psycho_common.c: In function ‘psycho_check_stc_error’:arch/sparc/kernel/psycho_common.c:104: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 4 has type ‘long long unsigned int’
Did you remove sparc's -Werror when doing test builds of these changes? :-)
Either way these need some work before they should be added to any tree.
Andrew you probably want to toss these from your tree since at a minimum they will break the sparc64 build.
Sam will fix them up and resubmit, and I'll apply them, don't worry. :)
Re: [PATCH] sparc64: use unsigned long long for u64
Quoted 9 lines · David Miller
From: Sam Ravnborg <[email protected]>
Date: Tue, 23 Dec 2008 14:17:46 +0100Quoted 2 lines
It may take a few days before the drivers gets fixed. Christmas is approaching fast by now.
Even with this and your driver patch applied, the tree doesn't build successfully:
Quoted 6 lines
cc1: warnings being treated as errors
arch/sparc/kernel/psycho_common.c: In function ‘psycho_check_stc_error’:arch/sparc/kernel/psycho_common.c:104: warning: format ‘%016lx’ expects type ‘long unsigned int’, but argument 4 has type ‘long long unsigned int’Did you remove sparc's -Werror when doing test builds of these changes? :-)
No - it is worse than that.
My gcc does not complain about the above.
Just to check that I was not fouled by some preprocessor magic here is the preprocessed code:
printk("<3>" "%s: STC_TAG(%d)[PA(%016lx)VA(%08lx)"
"V(%d)W(%d)]\n",
pbm->name,
i,
((tagval & 0x0fffffff00000000UL) >> 19UL),
(tagval & 0x00000000ffffe000UL),
((tagval & 0x0000000000000002UL) ? 1 : 0),
((tagval & 0x0000000000000001UL) ? 1 : 0));tagval is u64.
So it looks like my gcc does not promote:
((tagval & 0x0fffffff00000000UL) >> 19UL) to unsigned long long int but your gcc does?
My gcc (build with Dan Kegel's crosstool):
$ /opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/bin/sparc64-unknown-linux-gnu-gcc -v Reading specs from /opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/lib/gcc/sparc64-unknown-linux-gnu/3.4.5/specs Configured with: /home/sam/devel/crosstool-0.43/build/sparc64-unknown-linux-gnu/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure --target=sparc64-unknown-linux-gnu --host=i686-host_pc-linux-gnu --prefix=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu --disable-multilib --with-cpu=ultrasparc3 --enable-cxx-flags=-mcpu=ultrasparc3 --with-headers=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/sparc64-unknown-linux-gnu/include --with-local-prefix=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/sparc64-unknown-linux-gnu --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --enable-shared --enable-c99 --enable-long-long Thread model: posix gcc version 3.4.5
Quoted 9 lines
Either way these need some work before they should be added to any tree.
Andrew you probably want to toss these from your tree since at a minimum they will break the sparc64 build.
Sam will fix them up and resubmit, and I'll apply them, don't worry. :)
Yup - I added Andrew on cc: only as information.
Sam
David Miller
maintainerRe: [PATCH] sparc64: use unsigned long long for u64
From: Sam Ravnborg <[email protected]>
Date: Sat, 27 Dec 2008 10:24:04 +0100
Quoted 10 lines
So it looks like my gcc does not promote:
((tagval &0x0fffffff00000000UL) >> 19UL) to unsigned long long int but your gcc does?My gcc (build with Dan Kegel's crosstool):
$ /opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/bin/sparc64-unknown-linux-gnu-gcc -v Reading specs from /opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/lib/gcc/sparc64-unknown-linux-gnu/3.4.5/specs Configured with: /home/sam/devel/crosstool-0.43/build/sparc64-unknown-linux-gnu/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure --target=sparc64-unknown-linux-gnu --host=i686-host_pc-linux-gnu --prefix=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu --disable-multilib --with-cpu=ultrasparc3 --enable-cxx-flags=-mcpu=ultrasparc3 --with-headers=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/sparc64-unknown-linux-gnu/include --with-local-prefix=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/sparc64-unknown-linux-gnu --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --enable-shared --enable-c99 --enable-long-long Thread model: posix gcc version 3.4.5
I'm using a native gcc-4.1.3 here:
gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
When you cross build 32-bit to 64-bit, a small but non-zero number of warning checks and optimizations are not performed and I think that is what you're hitting here.
Re: [PATCH] sparc64: use unsigned long long for u64
Quoted 14 lines · David Miller
From: Sam Ravnborg <[email protected]>
Date: Sat, 27 Dec 2008 10:24:04 +0100Quoted 10 lines
So it looks like my gcc does not promote:
((tagval &0x0fffffff00000000UL) >> 19UL) to unsigned long long int but your gcc does?My gcc (build with Dan Kegel's crosstool):
$ /opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/bin/sparc64-unknown-linux-gnu-gcc -v Reading specs from /opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/lib/gcc/sparc64-unknown-linux-gnu/3.4.5/specs Configured with: /home/sam/devel/crosstool-0.43/build/sparc64-unknown-linux-gnu/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure --target=sparc64-unknown-linux-gnu --host=i686-host_pc-linux-gnu --prefix=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu --disable-multilib --with-cpu=ultrasparc3 --enable-cxx-flags=-mcpu=ultrasparc3 --with-headers=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/sparc64-unknown-linux-gnu/include --with-local-prefix=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/sparc64-unknown-linux-gnu/sparc64-unknown-linux-gnu --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --enable-shared --enable-c99 --enable-long-long Thread model: posix gcc version 3.4.5
Quoted 7 lines
I'm using a native gcc-4.1.3 here:
gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
When you cross build 32-bit to 64-bit, a small but non-zero number of warning checks and optimizations are not performed and I think that is what you're hitting here.
OK.
I have ordered a used Sun Blade 100(*) that should show up before new eve.
So when I have it and it is up and running I will redo this patch set. That will likely take a few weeks though.
(*) Any distribution recommendations? I will only use it for
sparc kernel development so nothing fancy...
Sam
David Miller
maintainerRe: [PATCH] sparc64: use unsigned long long for u64
From: Sam Ravnborg <[email protected]>
Date: Sat, 27 Dec 2008 10:49:55 +0100
Quoted 4 lines
I have ordered a used Sun Blade 100(*) that should show up before new eve.
So when I have it and it is up and running I will redo this patch set. That will likely take a few weeks though.
Another option, of course, is to use 64-bit cross tools on an x86_64 system if you have access to one of those.
Quoted 2 lines
(*) Any distribution recommendations? I will only use it for
sparc kernel development so nothing fancy...
Debian testing works fine, and that's what I'm typing this on.
Re: [PATCH] sparc64: use unsigned long long for u64
Quoted 10 lines · David Miller
From: Sam Ravnborg <[email protected]>
Date: Sat, 27 Dec 2008 10:49:55 +0100Quoted 4 lines
I have ordered a used Sun Blade 100(*) that should show up before new eve.
So when I have it and it is up and running I will redo this patch set. That will likely take a few weeks though.Another option, of course, is to use 64-bit cross tools on an
x86_64system if you have access to one of those.
It needs a new motherboard and I used my savings on a Sun blade...
Quoted 6 lines
Quoted 3 lines
(*) Any distribution recommendations? I will only use it for
sparc kernel development so nothing fancy...Debian testing works fine, and that's what I'm typing this on.
Thanks!
Sam
Re: [patch] powerpc: change u64/s64 to a long long integer type
In reply to Ingo MolnarHi Ingo,
Quoted 14 lines · On Mon, 22 Dec 2008 09:03:41 +0100 Ingo Molnar <[email protected]> wrote:
Subject: powerpc: change u64/s64 to a long long integer type
From: Ingo Molnar <[email protected]>
Date: Mon Dec 22 08:32:41 CET 2008Convert
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>
Quoted 4 lines
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.
Quoted 5 lines
Index:
linux/arch/powerpc/kernel/prom.c
===================================================================
arch/powerpc/kernel/prom.c static int __init early_init_dt_scan_cho · line 831
Quoted 10 lines
arch/powerpc/kernel/prom.c +2
-2@@ -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 *".
arch/powerpc/oprofile/cell/vma_map.c vma_map_add(struct vma_to_fileoffset_map · line 95
Quoted 10 lines
Index:
linux/arch/powerpc/oprofile/cell/vma_map.c
===================================================================arch/powerpc/oprofile/cell/vma_map.c +1
-1@@ -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")?
arch/powerpc/platforms/cell/interrupt.c static unsigned int iic_get_irq(void) · line 151
Quoted 10 lines
Index:
linux/arch/powerpc/platforms/cell/interrupt.c
===================================================================arch/powerpc/platforms/cell/interrupt.c +1
-1@@ -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".
Quoted 5 lines
Index:
linux/arch/powerpc/platforms/cell/spu_base.c
===================================================================
arch/powerpc/platforms/cell/spu_base.c static void spu_restart_dma(struct spu * · line 145
Quoted 9 lines
arch/powerpc/platforms/cell/spu_base.c +2
-2@@ -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)?
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Re: [patch] powerpc: change u64/s64 to a long long integer type
Quoted 2 lines · Stephen Rothwell
So, would you like me to push this along - including splitting it up a bit (keeping your Signed-off-by, of course)?
Sure, feel free - this should really be done by someone with more PowerPC interest/experience than me.
Ingo
Quoted 5 lines · Ingo Molnar
the real solution is something like the patch below. That generates new (but harmless) warnings within the powerpc code but those are a one-off effort to fix and are not reoccuring.
Cc -ed Paul Mackerras - Paul, am i missing anything?
That does change the formal types of things exported to userland, and hence technically breaks the ABI, which is why I am cautious about this idea. Whether or not that causes real problems in practice I'm not sure, but I would want to at least check with the glibc developers first.
One solution to might be to use an #ifdef __KERNEL__ so that userland still sees the long types but kernel code sees long longs.
Paul.
Quoted 8 lines · Paul Mackerras
Quoted 5 lines · Ingo Molnar
the real solution is something like the patch below. That generates new (but harmless) warnings within the powerpc code but those are a one-off effort to fix and are not reoccuring.
Cc -ed Paul Mackerras - Paul, am i missing anything?
Quoted 8 lines
That does change the formal types of things exported to userland, and hence technically breaks the ABI, which is why I am cautious about this idea. Whether or not that causes real problems in practice I'm not sure, but I would want to at least check with the glibc developers first.
One solution to might be to use an #ifdef
__KERNEL__so that userland still sees the long types but kernel code sees long longs.
which APIs do you mean exactly, could you give me an example please and the type of breakage you suspect?
I cannot see how the binary representation could ever change from this. (and that is all that an ABI is about - it is an application Binary interface. I.e. there's no ABI breakage.)
Ingo
Quoted 2 lines · Ingo Molnar
which APIs do you mean exactly, could you give me an example please and the type of breakage you suspect?
Any struct with a __u64 or __s64 in it that gets exported to userland will have a different type signature with the change, hence has the potential to cause compile warnings or errors on correct code (e.g. warnings on printf's that use %ld to print an __s64 field on ppc64). It's possible that C++ stuff will fail to link because of mangled names coming out differently. And so on.
Quoted 3 lines
I cannot see how the binary representation could ever change from this. (and that is all that an ABI is about - it is an application Binary interface. I.e. there's no ABI breakage.)
Yes, the bits are the same, but that doesn't mean the types are the same. And we do export type definitions.
I once wanted to change the ppc32 size_t definition from unsigned int to unsigned long to match up with ppc64. That caused more pain than it was worth because of exactly this issue (and also because gcc has fixed ideas about size_t) so I abandoned it. That's why I'm cautious about changing user-visible types. I'm not saying we can't do it, I'm saying we shouldn't do it unilaterally.
Paul.
Quoted 7 lines · Paul Mackerras
Quoted 3 lines
I cannot see how the binary representation could ever change from this. (and that is all that an ABI is about - it is an application Binary interface. I.e. there's no ABI breakage.)
Yes, the bits are the same, but that doesn't mean the types are the same. And we do export type definitions.
Quoted 6 lines
I once wanted to change the ppc32
size_tdefinition from unsigned int to unsigned long to match up with ppc64. That caused more pain than it was worth because of exactly this issue (and also because gcc has fixed ideas aboutsize_t) so I abandoned it. That's why I'm cautious about changing user-visible types. I'm not saying we can't do it, I'm saying we shouldn't do it unilaterally.
okay, so what's the timeline to double check those details and to get this fix upstream?
Ingo
Quoted 2 lines · Ingo Molnar
okay, so what's the timeline to double check those details and to get this fix upstream?
Dunno - I have sent a query to our glibc guys, but it is vacation season, which may delay things...
Paul.