Skip to content

Commit

Permalink
sparc64: Use unsigned long long for u64.
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sam Ravnborg authored and David S. Miller committed Jan 6, 2009
1 parent 0157141 commit 9018113
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion arch/sparc/include/asm/timer_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/include/asm/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__

Expand Down
34 changes: 17 additions & 17 deletions arch/sparc/kernel/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));
}

Expand Down Expand Up @@ -912,20 +912,20 @@ 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) {
struct ds_reg_nack *np = (struct ds_reg_nack *) 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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
14 changes: 7 additions & 7 deletions arch/sparc/kernel/mdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/of_device_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/pci_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions arch/sparc/kernel/pci_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/pci_schizo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/pci_sun4v.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/prom_irqtrans.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
14 changes: 7 additions & 7 deletions arch/sparc/kernel/psycho_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ static void psycho_check_stc_error(struct pci_pbm_info *pbm)
if (saw_error != 0) {
u64 tagval = stc_tag_buf[i];
u64 lineval = stc_line_buf[i];
printk(KERN_ERR "%s: STC_TAG(%d)[PA(%016lx)VA(%08lx)"
printk(KERN_ERR "%s: STC_TAG(%d)[PA(%016llx)VA(%08llx)"
"V(%d)W(%d)]\n",
pbm->name,
i,
((tagval & PSYCHO_STCTAG_PPN) >> 19UL),
(tagval & PSYCHO_STCTAG_VPN),
((tagval & PSYCHO_STCTAG_VALID) ? 1 : 0),
((tagval & PSYCHO_STCTAG_WRITE) ? 1 : 0));
printk(KERN_ERR "%s: STC_LINE(%d)[LIDX(%lx)SP(%lx)"
"LADDR(%lx)EP(%lx)V(%d)FOFN(%d)]\n",
printk(KERN_ERR "%s: STC_LINE(%d)[LIDX(%llx)SP(%llx)"
"LADDR(%llx)EP(%llx)V(%d)FOFN(%d)]\n",
pbm->name,
i,
((lineval & PSYCHO_STCLINE_LINDX) >> 21UL),
Expand Down Expand Up @@ -179,14 +179,14 @@ static void psycho_dump_iommu_tags_and_data(struct pci_pbm_info *pbm,
}

printk(KERN_ERR "%s: IOMMU TAG(%d)[error(%s) wr(%d) "
"str(%d) sz(%dK) vpg(%08lx)]\n",
"str(%d) sz(%dK) vpg(%08llx)]\n",
pbm->name, i, type_str,
((tag_val & PSYCHO_IOMMU_TAG_WRITE) ? 1 : 0),
((tag_val & PSYCHO_IOMMU_TAG_STREAM) ? 1 : 0),
((tag_val & PSYCHO_IOMMU_TAG_SIZE) ? 64 : 8),
(tag_val & PSYCHO_IOMMU_TAG_VPAGE) << IOMMU_PAGE_SHIFT);
printk(KERN_ERR "%s: IOMMU DATA(%d)[valid(%d) cache(%d) "
"ppg(%016lx)]\n",
"ppg(%016llx)]\n",
pbm->name, i,
((data_val & PSYCHO_IOMMU_DATA_VALID) ? 1 : 0),
((data_val & PSYCHO_IOMMU_DATA_CACHE) ? 1 : 0),
Expand Down Expand Up @@ -326,12 +326,12 @@ irqreturn_t psycho_pcierr_intr(int irq, void *dev_id)
"Excessive Retries" :
((error_bits & PSYCHO_PCIAFSR_PPERR) ?
"Parity Error" : "???"))))));
printk(KERN_ERR "%s: bytemask[%04lx] UPA_MID[%02lx] was_block(%d)\n",
printk(KERN_ERR "%s: bytemask[%04llx] UPA_MID[%02llx] was_block(%d)\n",
pbm->name,
(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) {
Expand Down
4 changes: 2 additions & 2 deletions arch/sparc/kernel/smp_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ static void spitfire_xcall_helper(u64 data0, u64 data1, u64 data2, u64 pstate, u
__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);
Expand Down Expand Up @@ -584,7 +584,7 @@ static void cheetah_xcall_deliver(struct trap_per_cpu *tb, int cnt)
/* 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;
Expand Down
12 changes: 6 additions & 6 deletions arch/sparc/kernel/time_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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];
Expand Down
Loading

0 comments on commit 9018113

Please sign in to comment.