* [PATCH] powerpc: change u64/s64 to a long long integer type @ 2009-01-07 0:26 Stephen Rothwell 0 siblings, 0 replies; 9+ messages in thread From: Stephen Rothwell @ 2009-01-07 0:26 UTC (permalink / raw) To: Benjamin Herrenschmidt; +Cc: ppc-dev, Ingo Molnar, paulus From: Ingo Molnar <mingo@elte.hu> 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. [Adjusted to not impact user mode (from paulus) - sfr] Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> --- arch/powerpc/include/asm/rtas.h | 2 +- arch/powerpc/include/asm/types.h | 7 ++++- arch/powerpc/kernel/dma-iommu.c | 4 +- arch/powerpc/kernel/iommu.c | 12 ++++---- arch/powerpc/kernel/lparcfg.c | 10 +++--- arch/powerpc/kernel/setup_64.c | 6 ++-- arch/powerpc/mm/stab.c | 4 +- arch/powerpc/oprofile/op_model_pa6t.c | 6 ++-- arch/powerpc/platforms/cell/beat_interrupt.c | 2 +- arch/powerpc/platforms/cell/celleb_scc_epci.c | 4 +- arch/powerpc/platforms/cell/iommu.c | 4 +- arch/powerpc/platforms/cell/ras.c | 8 +++--- arch/powerpc/platforms/cell/spu_base.c | 4 +- arch/powerpc/platforms/cell/spu_callbacks.c | 2 +- arch/powerpc/platforms/iseries/iommu.c | 4 +- arch/powerpc/platforms/pseries/iommu.c | 35 ++++++++++++------------- arch/powerpc/sysdev/mpic.c | 2 +- drivers/net/pasemi_mac.c | 6 ++-- drivers/pcmcia/electra_cf.c | 2 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 12 ++++---- 20 files changed, 70 insertions(+), 66 deletions(-) This patch depends on the preceding type fixup patches (or some errors, not just warnings, will result). This patch fixes most of the new warnings, but there are a few more following patches to clean up the ppc64_defconfig build. diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h index e0175be..0aa0315 100644 --- a/arch/powerpc/include/asm/rtas.h +++ b/arch/powerpc/include/asm/rtas.h @@ -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) diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index c004c13..7ce27a5 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h @@ -1,7 +1,12 @@ #ifndef _ASM_POWERPC_TYPES_H #define _ASM_POWERPC_TYPES_H -#ifdef __powerpc64__ +/* + * This is here because we used to use l64 for 64bit powerpc + * and we don't want to impact user mode with our change to ll64 + * in the kernel. + */ +#if defined(__powerpc64__) && !defined(__KERNEL__) # include <asm-generic/int-l64.h> #else # include <asm-generic/int-ll64.h> diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index 14183af..2983ada 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-iommu.c @@ -79,10 +79,10 @@ static int dma_iommu_dma_supported(struct device *dev, u64 mask) "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 diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 1bfa706..fd51578 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -239,12 +239,12 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, if (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; diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index d051e8c..182e0f6 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c @@ -240,7 +240,7 @@ static void parse_ppp_data(struct seq_file *m) if (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_file *m) 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 *entitlement, u8 *weight) } 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 *entitlement, u8 *weight) pr_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); diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index d8bd216..2d34196 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -434,8 +434,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); @@ -493,7 +493,7 @@ static void __init emergency_stack_init(void) * 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; diff --git a/arch/powerpc/mm/stab.c b/arch/powerpc/mm/stab.c index 60e6032..98cd1dc 100644 --- a/arch/powerpc/mm/stab.c +++ b/arch/powerpc/mm/stab.c @@ -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); } } diff --git a/arch/powerpc/oprofile/op_model_pa6t.c b/arch/powerpc/oprofile/op_model_pa6t.c index c40de46..42f778d 100644 --- a/arch/powerpc/oprofile/op_model_pa6t.c +++ b/arch/powerpc/oprofile/op_model_pa6t.c @@ -132,7 +132,7 @@ static int pa6t_reg_setup(struct op_counter_config *ctr, for (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_config *ctr) 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 */ diff --git a/arch/powerpc/platforms/cell/beat_interrupt.c b/arch/powerpc/platforms/cell/beat_interrupt.c index 192a935..7225484 100644 --- a/arch/powerpc/platforms/cell/beat_interrupt.c +++ b/arch/powerpc/platforms/cell/beat_interrupt.c @@ -99,7 +99,7 @@ static void beatic_end_irq(unsigned int irq_plug) 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); } diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c index 08c285b..48ec88a 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_epci.c +++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c @@ -405,7 +405,7 @@ static int __init celleb_setup_epci(struct device_node *node, 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(struct device_node *node, 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; diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index 88d94b5..ee5033e 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c @@ -855,7 +855,7 @@ static int __init cell_iommu_init_disabled(void) */ 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(struct device *dev) 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, diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c index 7b4cefa..5f961c4 100644 --- a/arch/powerpc/platforms/cell/ras.c +++ b/arch/powerpc/platforms/cell/ras.c @@ -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)); } diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index a5bdb89..e487ad6 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c @@ -151,7 +151,7 @@ static inline void spu_load_slb(struct spu *spu, int slbe, struct spu_slb *slb) { 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 spu *spu, unsigned long ea, u64 dsisr) { 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 diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c index 19f6bfd..fec1495 100644 --- a/arch/powerpc/platforms/cell/spu_callbacks.c +++ b/arch/powerpc/platforms/cell/spu_callbacks.c @@ -54,7 +54,7 @@ long spu_sys_callback(struct spu_syscall_block *s) long (*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; } diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c index bbe828f..6ed75bf 100644 --- a/arch/powerpc/platforms/iseries/iommu.c +++ b/arch/powerpc/platforms/iseries/iommu.c @@ -66,7 +66,7 @@ static int tce_build_iSeries(struct iommu_table *tbl, long index, long npages, 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 iommu_table *tbl, long index, long npages) while (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++; } diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index c90817a..3ee01b4 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -127,10 +127,10 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum, } 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(struct iommu_table *tbl, long tcenum, } 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 iommu_table *tbl, long tcenum, long npages 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(struct iommu_table *tbl, long tcenum, long n if (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(struct iommu_table *tbl, long tcenum) 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()); } diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index c82babb..d83597a 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -435,7 +435,7 @@ static void __init mpic_scan_ht_msi(struct mpic *mpic, u8 __iomem *devbase, 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); diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 5b7a574..d0349e7 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c @@ -712,7 +712,7 @@ static inline void pasemi_mac_rx_error(const struct pasemi_mac *mac, 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(const struct pasemi_mac *mac, 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); } diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c index a34284b..d187ba4 100644 --- a/drivers/pcmcia/electra_cf.c +++ b/drivers/pcmcia/electra_cf.c @@ -297,7 +297,7 @@ static int __devinit electra_cf_probe(struct of_device *ofdev, 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; diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 868d35e..3098c98 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -1060,7 +1060,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) } 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(struct scsi_cmnd *cmd) if (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(struct scsi_cmnd *cmd) if (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_handler(struct scsi_cmnd *cmd) return 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_handler(struct scsi_cmnd *cmd) if (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; } -- 1.6.0.5 -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ ^ permalink raw reply related [flat|nested] 9+ messages in thread
* linux-next: sched tree build warning @ 2008-12-22 4:22 Stephen Rothwell 2008-12-22 6:49 ` Ken Chen 0 siblings, 1 reply; 9+ messages in thread From: Stephen Rothwell @ 2008-12-22 4:22 UTC (permalink / raw) To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin; +Cc: linux-next, Ken Chen [-- Attachment #1: Type: text/plain, Size: 487 bytes --] 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"). -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: linux-next: sched tree build warning 2008-12-22 4:22 linux-next: sched tree build warning Stephen Rothwell @ 2008-12-22 6:49 ` Ken Chen 2008-12-22 7:04 ` Ingo Molnar 0 siblings, 1 reply; 9+ messages in thread From: Ken Chen @ 2008-12-22 6:49 UTC (permalink / raw) To: Stephen Rothwell; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, linux-next On Sun, Dec 21, 2008 at 8:22 PM, Stephen Rothwell wrote: > 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: linux-next: sched tree build warning 2008-12-22 6:49 ` Ken Chen @ 2008-12-22 7:04 ` Ingo Molnar 2008-12-22 7:19 ` Stephen Rothwell 0 siblings, 1 reply; 9+ messages in thread From: Ingo Molnar @ 2008-12-22 7:04 UTC (permalink / raw) To: Ken Chen, Paul Mackerras Cc: Stephen Rothwell, Thomas Gleixner, H. Peter Anvin, linux-next * Ken Chen <kenchen@google.com> wrote: > On Sun, Dec 21, 2008 at 8:22 PM, Stephen Rothwell wrote: > > 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. 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? Ingo ---------------> >From 3d835af97da5b6cb755ca4f8464f8e636cc321da Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> Date: Mon, 22 Dec 2008 08:02:06 +0100 Subject: [PATCH] powerpc: fix u64 Signed-off-by: Ingo Molnar <mingo@elte.hu> --- arch/powerpc/include/asm/types.h | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index c004c13..1cbfd7f 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h @@ -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__ ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: linux-next: sched tree build warning 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 0 siblings, 1 reply; 9+ messages in thread From: Stephen Rothwell @ 2008-12-22 7:19 UTC (permalink / raw) To: Ingo Molnar Cc: Ken Chen, Paul Mackerras, Thomas Gleixner, H. Peter Anvin, linux-next [-- Attachment #1: Type: text/plain, Size: 513 bytes --] Hi Ingo, On Mon, 22 Dec 2008 08:04:26 +0100 Ingo Molnar <mingo@elte.hu> 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? :-) -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* [patch] powerpc: change u64/s64 to a long long integer type 2008-12-22 7:19 ` Stephen Rothwell @ 2008-12-22 8:03 ` Ingo Molnar 2008-12-22 22:43 ` Andrew Morton 2008-12-31 4:40 ` Stephen Rothwell 0 siblings, 2 replies; 9+ messages in thread From: Ingo Molnar @ 2008-12-22 8:03 UTC (permalink / raw) To: Stephen Rothwell, linux-kernel Cc: Ken Chen, Paul Mackerras, Thomas Gleixner, H. Peter Anvin, linux-next * Stephen Rothwell <sfr@canb.auug.org.au> wrote: > Hi Ingo, > > On Mon, 22 Dec 2008 08:04:26 +0100 Ingo Molnar <mingo@elte.hu> 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 <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. Signed-off-by: Ingo Molnar <mingo@elte.hu> --- 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(-) Index: linux/arch/powerpc/include/asm/rtas.h =================================================================== --- linux.orig/arch/powerpc/include/asm/rtas.h +++ linux/arch/powerpc/include/asm/rtas.h @@ -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) Index: linux/arch/powerpc/include/asm/types.h =================================================================== --- linux.orig/arch/powerpc/include/asm/types.h +++ linux/arch/powerpc/include/asm/types.h @@ -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__ Index: linux/arch/powerpc/kernel/dma-iommu.c =================================================================== --- linux.orig/arch/powerpc/kernel/dma-iommu.c +++ linux/arch/powerpc/kernel/dma-iommu.c @@ -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 Index: linux/arch/powerpc/kernel/iommu.c =================================================================== --- linux.orig/arch/powerpc/kernel/iommu.c +++ linux/arch/powerpc/kernel/iommu.c @@ -239,12 +239,12 @@ static void __iommu_free(struct iommu_ta if (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; Index: linux/arch/powerpc/kernel/lparcfg.c =================================================================== --- linux.orig/arch/powerpc/kernel/lparcfg.c +++ linux/arch/powerpc/kernel/lparcfg.c @@ -240,7 +240,7 @@ static void parse_ppp_data(struct seq_fi if (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 *entitleme pr_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); 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); if (lprop) crashk_res.end = crashk_res.start + *lprop - 1; #endif Index: linux/arch/powerpc/kernel/prom_init.c =================================================================== --- linux.orig/arch/powerpc/kernel/prom_init.c +++ linux/arch/powerpc/kernel/prom_init.c @@ -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; Index: linux/arch/powerpc/kernel/setup_64.c =================================================================== --- linux.orig/arch/powerpc/kernel/setup_64.c +++ linux/arch/powerpc/kernel/setup_64.c @@ -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; Index: linux/arch/powerpc/mm/stab.c =================================================================== --- linux.orig/arch/powerpc/mm/stab.c +++ linux/arch/powerpc/mm/stab.c @@ -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); } } 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) { static const unsigned char expected[EI_PAD] = { [EI_MAG0] = ELFMAG0, Index: linux/arch/powerpc/oprofile/op_model_pa6t.c =================================================================== --- linux.orig/arch/powerpc/oprofile/op_model_pa6t.c +++ linux/arch/powerpc/oprofile/op_model_pa6t.c @@ -132,7 +132,7 @@ static int pa6t_reg_setup(struct op_coun for (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 */ Index: linux/arch/powerpc/platforms/cell/beat_htab.c =================================================================== --- linux.orig/arch/powerpc/platforms/cell/beat_htab.c +++ linux/arch/powerpc/platforms/cell/beat_htab.c @@ -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(unsign static 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_updateboltedp unsigned 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) Index: linux/arch/powerpc/platforms/cell/beat_interrupt.c =================================================================== --- linux.orig/arch/powerpc/platforms/cell/beat_interrupt.c +++ linux/arch/powerpc/platforms/cell/beat_interrupt.c @@ -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); } Index: linux/arch/powerpc/platforms/cell/beat_udbg.c =================================================================== --- linux.orig/arch/powerpc/platforms/cell/beat_udbg.c +++ linux/arch/powerpc/platforms/cell/beat_udbg.c @@ -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) { Index: linux/arch/powerpc/platforms/cell/celleb_scc_epci.c =================================================================== --- linux.orig/arch/powerpc/platforms/cell/celleb_scc_epci.c +++ linux/arch/powerpc/platforms/cell/celleb_scc_epci.c @@ -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; 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); if (!(pending.flags & CBE_IIC_IRQ_VALID)) return NO_IRQ; virq = irq_linear_revmap(iic_host, iic_pending_to_hwnum(pending)); Index: linux/arch/powerpc/platforms/cell/io-workarounds.c =================================================================== --- linux.orig/arch/powerpc/platforms/cell/io-workarounds.c +++ linux/arch/powerpc/platforms/cell/io-workarounds.c @@ -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; Index: linux/arch/powerpc/platforms/cell/iommu.c =================================================================== --- linux.orig/arch/powerpc/platforms/cell/iommu.c +++ linux/arch/powerpc/platforms/cell/iommu.c @@ -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, Index: linux/arch/powerpc/platforms/cell/ras.c =================================================================== --- linux.orig/arch/powerpc/platforms/cell/ras.c +++ linux/arch/powerpc/platforms/cell/ras.c @@ -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)); } 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); 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 Index: linux/arch/powerpc/platforms/cell/spu_callbacks.c =================================================================== --- linux.orig/arch/powerpc/platforms/cell/spu_callbacks.c +++ linux/arch/powerpc/platforms/cell/spu_callbacks.c @@ -54,7 +54,7 @@ long spu_sys_callback(struct spu_syscall long (*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; } Index: linux/arch/powerpc/platforms/iseries/iommu.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/iommu.c +++ linux/arch/powerpc/platforms/iseries/iommu.c @@ -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 iomm while (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++; } Index: linux/arch/powerpc/platforms/pasemi/cpufreq.c =================================================================== --- linux.orig/arch/powerpc/platforms/pasemi/cpufreq.c +++ linux/arch/powerpc/platforms/pasemi/cpufreq.c @@ -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)) Index: linux/arch/powerpc/platforms/pseries/iommu.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/iommu.c +++ linux/arch/powerpc/platforms/pseries/iommu.c @@ -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(stru if (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()); } Index: linux/arch/powerpc/sysdev/mpic.c =================================================================== --- linux.orig/arch/powerpc/sysdev/mpic.c +++ linux/arch/powerpc/sysdev/mpic.c @@ -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); Index: linux/drivers/char/hvc_beat.c =================================================================== --- linux.orig/drivers/char/hvc_beat.c +++ linux/drivers/char/hvc_beat.c @@ -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; } Index: linux/drivers/net/pasemi_mac.c =================================================================== --- linux.orig/drivers/net/pasemi_mac.c +++ linux/drivers/net/pasemi_mac.c @@ -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); } Index: linux/drivers/pcmcia/electra_cf.c =================================================================== --- linux.orig/drivers/pcmcia/electra_cf.c +++ linux/drivers/pcmcia/electra_cf.c @@ -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; Index: linux/drivers/scsi/ibmvscsi/ibmvscsi.c =================================================================== --- linux.orig/drivers/scsi/ibmvscsi/ibmvscsi.c +++ linux/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -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(str if (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(str if (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_hand return 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_hand if (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; } ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] powerpc: change u64/s64 to a long long integer type 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-31 4:40 ` Stephen Rothwell 1 sibling, 1 reply; 9+ messages in thread From: Andrew Morton @ 2008-12-22 22:43 UTC (permalink / raw) To: Ingo Molnar; +Cc: sfr, linux-kernel, kenchen, paulus, tglx, hpa, linux-next 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 <applause> There are lots of other architctures that need doing though. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] powerpc: change u64/s64 to a long long integer type 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 ` Andrew Morton 0 siblings, 2 replies; 9+ messages in thread From: Sam Ravnborg @ 2008-12-22 23:00 UTC (permalink / raw) To: Andrew Morton Cc: Ingo Molnar, sfr, linux-kernel, kenchen, paulus, tglx, hpa, linux-next, David Miller On Mon, Dec 22, 2008 at 02:43:19PM -0800, Andrew Morton wrote: > 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 > > <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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] powerpc: change u64/s64 to a long long integer type 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 1 sibling, 1 reply; 9+ messages in thread From: H. Peter Anvin @ 2008-12-22 23:03 UTC (permalink / raw) To: Sam Ravnborg Cc: Andrew Morton, Ingo Molnar, sfr, linux-kernel, kenchen, paulus, tglx, linux-next, David Miller Sam Ravnborg wrote: > On Mon, Dec 22, 2008 at 02:43:19PM -0800, Andrew Morton wrote: >> 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 >> <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 > This should only affect 64-bit architectures. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] powerpc: change u64/s64 to a long long integer type 2008-12-22 23:03 ` H. Peter Anvin @ 2008-12-22 23:13 ` Sam Ravnborg 0 siblings, 0 replies; 9+ messages in thread From: Sam Ravnborg @ 2008-12-22 23:13 UTC (permalink / raw) To: H. Peter Anvin Cc: Andrew Morton, Ingo Molnar, sfr, linux-kernel, kenchen, paulus, tglx, linux-next, David Miller On Mon, Dec 22, 2008 at 03:03:37PM -0800, H. Peter Anvin wrote: > Sam Ravnborg wrote: > > On Mon, Dec 22, 2008 at 02:43:19PM -0800, Andrew Morton wrote: > >> 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 > >> <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 > > > > This 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] powerpc: change u64/s64 to a long long integer type 2008-12-22 23:00 ` Sam Ravnborg 2008-12-22 23:03 ` H. Peter Anvin @ 2008-12-22 23:13 ` Andrew Morton 1 sibling, 0 replies; 9+ messages in thread From: Andrew Morton @ 2008-12-22 23:13 UTC (permalink / raw) To: Sam Ravnborg Cc: mingo, sfr, linux-kernel, kenchen, paulus, tglx, hpa, linux-next, davem On Tue, 23 Dec 2008 00:00:35 +0100 Sam Ravnborg <sam@ravnborg.org> wrote: > On Mon, Dec 22, 2008 at 02:43:19PM -0800, Andrew Morton wrote: > > 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 > > > > <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). > 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 :)) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] powerpc: change u64/s64 to a long long integer type 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-31 4:40 ` Stephen Rothwell 2008-12-31 7:52 ` Ingo Molnar 1 sibling, 1 reply; 9+ messages in thread From: Stephen Rothwell @ 2008-12-31 4:40 UTC (permalink / raw) To: Ingo Molnar Cc: linux-kernel, Ken Chen, Paul Mackerras, Thomas Gleixner, H. Peter Anvin, linux-next [-- 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 --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] powerpc: change u64/s64 to a long long integer type 2008-12-31 4:40 ` Stephen Rothwell @ 2008-12-31 7:52 ` Ingo Molnar 0 siblings, 0 replies; 9+ messages in thread From: Ingo Molnar @ 2008-12-31 7:52 UTC (permalink / raw) To: Stephen Rothwell Cc: linux-kernel, Ken Chen, Paul Mackerras, Thomas Gleixner, H. Peter Anvin, linux-next * Stephen Rothwell <sfr@canb.auug.org.au> wrote: > 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-01-07 0:26 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-01-07 0:26 [PATCH] powerpc: change u64/s64 to a long long integer type Stephen Rothwell -- strict thread matches above, loose matches on Subject: below -- 2008-12-22 4:22 linux-next: sched tree build warning Stephen Rothwell 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-31 4:40 ` Stephen Rothwell 2008-12-31 7:52 ` Ingo Molnar
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.