LOCAL / bcm2835: fix wrong type casting for arm64 12/149912/2
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 13 Sep 2017 11:43:11 +0000 (20:43 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 14 Sep 2017 03:48:34 +0000 (03:48 +0000)
On arm64, there are many wrong type casting from pointer and
dma_addr_t. Fix the wrong type casting for arm64 to remove
build warnings.

NOTE: fixed castings are only for debug message and 32bit variable,
so there is no functional change.

Change-Id: I2f1afcd29d2e20e6e8538162f08ef58c300d642b
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/clk/bcm/clk-bcm2835.c
drivers/gpu/drm/vc4/vc4_firmware_kms.c
drivers/input/touchscreen/rpi-ft5406.c
drivers/mmc/host/bcm2835-sdhost.c
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
sound/arm/bcm2835.c

index db3ba74..0861cb0 100644 (file)
@@ -2292,7 +2292,7 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
                return ret;
 
        /* note that we have registered all the clocks */
-       dev_dbg(dev, "registered %d clocks\n", asize);
+       dev_dbg(dev, "registered %zu clocks\n", asize);
 
        return 0;
 }
index c85cae7..68fd04f 100644 (file)
@@ -160,14 +160,14 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane,
                WARN_ON_ONCE(vc4_plane->pitch != fb->pitches[0]);
        }
 
-       DRM_DEBUG_ATOMIC("[PLANE:%d:%s] primary update %dx%d@%d +%d,%d 0x%08x/%d\n",
+       DRM_DEBUG_ATOMIC("[PLANE:%d:%s] primary update %dx%d@%d +%d,%d 0x%08lx/%d\n",
                         plane->base.id, plane->name,
                         state->crtc_w,
                         state->crtc_h,
                         bpp,
                         state->crtc_x,
                         state->crtc_y,
-                        bo->paddr + fb->offsets[0],
+                        (unsigned long)(bo->paddr + fb->offsets[0]),
                         fb->pitches[0]);
 
        ret = rpi_firmware_transaction(vc4->firmware,
@@ -211,13 +211,13 @@ static void vc4_cursor_plane_atomic_update(struct drm_plane *plane,
        WARN_ON_ONCE(fb->pitches[0] != state->crtc_w * 4);
        WARN_ON_ONCE(fb->bits_per_pixel != 32);
 
-       DRM_DEBUG_ATOMIC("[PLANE:%d:%s] update %dx%d cursor at %d,%d (0x%08x/%d)",
+       DRM_DEBUG_ATOMIC("[PLANE:%d:%s] update %dx%d cursor at %d,%d (0x%08lx/%d)",
                         plane->base.id, plane->name,
                         state->crtc_w,
                         state->crtc_h,
                         state->crtc_x,
                         state->crtc_y,
-                        bo->paddr + fb->offsets[0],
+                        (unsigned long)(bo->paddr + fb->offsets[0]),
                         fb->pitches[0]);
 
        /* add on the top/left offsets when overscan is active */
index 36874f5..343b21f 100644 (file)
@@ -229,7 +229,7 @@ static int ft5406_probe(struct platform_device *pdev)
        }
 
        if (!ts->ts_base) {
-               dev_warn(dev, "set failed, trying get (err:%d touchbuf:%x virt:%p bus:%x)\n", err, touchbuf, ts->ts_base, ts->bus_addr);
+               dev_warn(dev, "set failed, trying get (err:%d touchbuf:%x virt:%p bus:%pad)\n", err, touchbuf, ts->ts_base, &ts->bus_addr);
 
                err = rpi_firmware_property(fw, RPI_FIRMWARE_FRAMEBUFFER_GET_TOUCHBUF,
                                    &touchbuf, sizeof(touchbuf));
index a9bc79b..1c47020 100644 (file)
@@ -241,8 +241,8 @@ static void log_init(struct device *dev, u32 bus_to_phys)
        sdhost_log_buf = dma_zalloc_coherent(dev, LOG_SIZE, &sdhost_log_addr,
                                             GFP_KERNEL);
        if (sdhost_log_buf) {
-               pr_info("sdhost: log_buf @ %p (%x)\n",
-                       sdhost_log_buf, sdhost_log_addr);
+               pr_info("sdhost: log_buf @ %p (%pad)\n",
+                       sdhost_log_buf, &sdhost_log_addr);
                timer_base = ioremap_nocache(bus_to_phys + 0x7e003000, SZ_4K);
                if (!timer_base)
                        pr_err("sdhost: failed to remap timer\n");
@@ -522,7 +522,7 @@ static void bcm2835_sdhost_dma_complete(void *param)
        unsigned long flags;
 
        spin_lock_irqsave(&host->lock, flags);
-       log_event("DMA<", (u32)host->data, bcm2835_sdhost_read(host, SDHSTS));
+       log_event("DMA<", (u32)(uintptr_t)host->data, bcm2835_sdhost_read(host, SDHSTS));
        log_event("DMA ", bcm2835_sdhost_read(host, SDCMD),
                  bcm2835_sdhost_read(host, SDEDM));
 
@@ -554,7 +554,7 @@ static void bcm2835_sdhost_dma_complete(void *param)
 
        bcm2835_sdhost_finish_data(host);
 
-       log_event("DMA>", (u32)host->data, 0);
+       log_event("DMA>", (u32)(uintptr_t)host->data, 0);
        spin_unlock_irqrestore(&host->lock, flags);
 }
 
@@ -743,7 +743,7 @@ static void bcm2835_sdhost_transfer_pio(struct bcm2835_host *host)
        u32 sdhsts;
        bool is_read;
        BUG_ON(!host->data);
-       log_event("XFP<", (u32)host->data, host->blocks);
+       log_event("XFP<", (u32)(uintptr_t)host->data, host->blocks);
 
        is_read = (host->data->flags & MMC_DATA_READ) != 0;
        if (is_read)
@@ -768,7 +768,7 @@ static void bcm2835_sdhost_transfer_pio(struct bcm2835_host *host)
                       sdhsts);
                host->data->error = -ETIMEDOUT;
        }
-       log_event("XFP>", (u32)host->data, host->blocks);
+       log_event("XFP>", (u32)(uintptr_t)host->data, host->blocks);
 }
 
 static void bcm2835_sdhost_prepare_dma(struct bcm2835_host *host,
@@ -778,7 +778,7 @@ static void bcm2835_sdhost_prepare_dma(struct bcm2835_host *host,
        struct dma_async_tx_descriptor *desc = NULL;
        struct dma_chan *dma_chan;
 
-       log_event("PRD<", (u32)data, 0);
+       log_event("PRD<", (u32)(uintptr_t)data, 0);
        pr_debug("bcm2835_sdhost_prepare_dma()\n");
 
        dma_chan = host->dma_chan_rxtx;
@@ -789,7 +789,7 @@ static void bcm2835_sdhost_prepare_dma(struct bcm2835_host *host,
                dir_data = DMA_TO_DEVICE;
                dir_slave = DMA_MEM_TO_DEV;
        }
-       log_event("PRD1", (u32)dma_chan, 0);
+       log_event("PRD1", (u32)(uintptr_t)dma_chan, 0);
 
        BUG_ON(!dma_chan->device);
        BUG_ON(!dma_chan->device->dev);
@@ -836,7 +836,7 @@ static void bcm2835_sdhost_prepare_dma(struct bcm2835_host *host,
                desc = dmaengine_prep_slave_sg(dma_chan, data->sg,
                                               len, dir_slave,
                                               DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
-       log_event("PRD3", (u32)desc, 0);
+       log_event("PRD3", (u32)(uintptr_t)desc, 0);
 
        if (desc) {
                desc->callback = bcm2835_sdhost_dma_complete;
@@ -845,12 +845,12 @@ static void bcm2835_sdhost_prepare_dma(struct bcm2835_host *host,
                host->dma_chan = dma_chan;
                host->dma_dir = dir_data;
        }
-       log_event("PDM>", (u32)data, 0);
+       log_event("PDM>", (u32)(uintptr_t)data, 0);
 }
 
 static void bcm2835_sdhost_start_dma(struct bcm2835_host *host)
 {
-       log_event("SDMA", (u32)host->data, (u32)host->dma_chan);
+       log_event("SDMA", (u32)(uintptr_t)host->data, (u32)(uintptr_t)host->dma_chan);
        dmaengine_submit(host->dma_desc);
        dma_async_issue_pending(host->dma_chan);
 }
@@ -1074,7 +1074,7 @@ static void bcm2835_sdhost_finish_data(struct bcm2835_host *host)
        data = host->data;
        BUG_ON(!data);
 
-       log_event("FDA<", (u32)host->mrq, (u32)host->cmd);
+       log_event("FDA<", (u32)(uintptr_t)host->mrq, (u32)(uintptr_t)host->cmd);
        pr_debug("finish_data(error %d, stop %d, sbc %d)\n",
               data->error, data->stop ? 1 : 0,
               host->mrq->sbc ? 1 : 0);
@@ -1097,7 +1097,7 @@ static void bcm2835_sdhost_finish_data(struct bcm2835_host *host)
        }
        else
                bcm2835_sdhost_transfer_complete(host);
-       log_event("FDA>", (u32)host->mrq, (u32)host->cmd);
+       log_event("FDA>", (u32)(uintptr_t)host->mrq, (u32)(uintptr_t)host->cmd);
 }
 
 static void bcm2835_sdhost_transfer_complete(struct bcm2835_host *host)
@@ -1111,7 +1111,7 @@ static void bcm2835_sdhost_transfer_complete(struct bcm2835_host *host)
        data = host->data;
        host->data = NULL;
 
-       log_event("TCM<", (u32)data, data->error);
+       log_event("TCM<", (u32)(uintptr_t)data, data->error);
        pr_debug("transfer_complete(error %d, stop %d)\n",
               data->error, data->stop ? 1 : 0);
 
@@ -1133,7 +1133,7 @@ static void bcm2835_sdhost_transfer_complete(struct bcm2835_host *host)
                bcm2835_sdhost_wait_transfer_complete(host);
                tasklet_schedule(&host->finish_tasklet);
        }
-       log_event("TCM>", (u32)data, 0);
+       log_event("TCM>", (u32)(uintptr_t)data, 0);
 }
 
 /* If irq_flags is valid, the caller is in a thread context and is allowed
@@ -1148,7 +1148,7 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host,
        int timediff = 0;
 #endif
 
-       log_event("FCM<", (u32)host->mrq, (u32)host->cmd);
+       log_event("FCM<", (u32)(uintptr_t)host->mrq, (u32)(uintptr_t)host->cmd);
        pr_debug("finish_command(%x)\n", bcm2835_sdhost_read(host, SDCMD));
 
        BUG_ON(!host->cmd || !host->mrq);
@@ -1296,7 +1296,7 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host,
                else if (host->data_complete)
                        bcm2835_sdhost_transfer_complete(host);
        }
-       log_event("FCM>", (u32)host->mrq, (u32)host->cmd);
+       log_event("FCM>", (u32)(uintptr_t)host->mrq, (u32)(uintptr_t)host->cmd);
 }
 
 static void bcm2835_sdhost_timeout(unsigned long data)
@@ -1335,7 +1335,7 @@ static void bcm2835_sdhost_timeout(unsigned long data)
 
 static void bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask)
 {
-       log_event("IRQB", (u32)host->cmd, intmask);
+       log_event("IRQB", (u32)(uintptr_t)host->cmd, intmask);
        if (!host->cmd) {
                pr_err("%s: got command busy interrupt 0x%08x even "
                        "though no command operation was in progress.\n",
@@ -1388,7 +1388,7 @@ static void bcm2835_sdhost_data_irq(struct bcm2835_host *host, u32 intmask)
           data/space available FIFO status bits. It is therefore not
           an error to get here when there is no data transfer in
           progress. */
-       log_event("IRQD", (u32)host->data, intmask);
+       log_event("IRQD", (u32)(uintptr_t)host->data, intmask);
        if (!host->data)
                return;
 
@@ -1425,7 +1425,7 @@ static void bcm2835_sdhost_data_irq(struct bcm2835_host *host, u32 intmask)
 
 static void bcm2835_sdhost_block_irq(struct bcm2835_host *host, u32 intmask)
 {
-       log_event("IRQK", (u32)host->data, intmask);
+       log_event("IRQK", (u32)(uintptr_t)host->data, intmask);
        if (!host->data) {
                pr_err("%s: got block interrupt 0x%08x even "
                        "though no data operation was in progress.\n",
@@ -1684,10 +1684,10 @@ static void bcm2835_sdhost_request(struct mmc_host *mmc, struct mmc_request *mrq
        edm = bcm2835_sdhost_read(host, SDEDM);
        fsm = edm & SDEDM_FSM_MASK;
 
-       log_event("REQ<", (u32)mrq, edm);
+       log_event("REQ<", (u32)(uintptr_t)mrq, edm);
        if ((fsm != SDEDM_FSM_IDENTMODE) &&
            (fsm != SDEDM_FSM_DATAMODE)) {
-               log_event("REQ!", (u32)mrq, edm);
+               log_event("REQ!", (u32)(uintptr_t)mrq, edm);
                if (host->debug) {
                        pr_warn("%s: previous command (%d) not complete (EDM %x)\n",
                               mmc_hostname(host->mmc),
@@ -1723,7 +1723,7 @@ static void bcm2835_sdhost_request(struct mmc_host *mmc, struct mmc_request *mrq
                   mrq->data ? (u32)mrq->data->blksz : 0);
        mmiowb();
 
-       log_event("REQ>", (u32)mrq, 0);
+       log_event("REQ>", (u32)(uintptr_t)mrq, 0);
        spin_unlock_irqrestore(&host->lock, flags);
 }
 
@@ -1779,7 +1779,7 @@ static void bcm2835_sdhost_cmd_wait_work(struct work_struct *work)
 
        spin_lock_irqsave(&host->lock, flags);
 
-       log_event("CWK<", (u32)host->cmd, (u32)host->mrq);
+       log_event("CWK<", (u32)(uintptr_t)host->cmd, (u32)(uintptr_t)host->mrq);
 
        /*
         * If this tasklet gets rescheduled while running, it will
@@ -1794,7 +1794,7 @@ static void bcm2835_sdhost_cmd_wait_work(struct work_struct *work)
 
        mmiowb();
 
-       log_event("CWK>", (u32)host->cmd, 0);
+       log_event("CWK>", (u32)(uintptr_t)host->cmd, 0);
 
        spin_unlock_irqrestore(&host->lock, flags);
 }
@@ -1810,7 +1810,7 @@ static void bcm2835_sdhost_tasklet_finish(unsigned long param)
 
        spin_lock_irqsave(&host->lock, flags);
 
-       log_event("TSK<", (u32)host->mrq, 0);
+       log_event("TSK<", (u32)(uintptr_t)host->mrq, 0);
        /*
         * If this tasklet gets rescheduled while running, it will
         * be run again afterwards but without any active request.
@@ -1878,7 +1878,7 @@ static void bcm2835_sdhost_tasklet_finish(unsigned long param)
        }
 
        mmc_request_done(host->mmc, mrq);
-       log_event("TSK>", (u32)mrq, 0);
+       log_event("TSK>", (u32)(uintptr_t)mrq, 0);
 }
 
 int bcm2835_sdhost_add_host(struct bcm2835_host *host)
index 7fd63cf..e11cacf 100644 (file)
@@ -806,7 +806,7 @@ queue_message(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service,
                                service_quota->slot_quota))) {
                        spin_unlock(&quota_spinlock);
                        vchiq_log_trace(vchiq_core_log_level,
-                               "%d: qm:%d %s,%zx - quota stall "
+                               "%d: qm:%d %s,%x - quota stall "
                                "(msg %d, slot %d)",
                                state->id, service->localport,
                                msg_type_str(type), size,
@@ -852,7 +852,7 @@ queue_message(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service,
                int slot_use_count;
 
                vchiq_log_info(vchiq_core_log_level,
-                       "%d: qm %s@%pK,%zx (%d->%d)",
+                       "%d: qm %s@%pK,%x (%d->%d)",
                        state->id, msg_type_str(VCHIQ_MSG_TYPE(msgid)),
                        header, size, VCHIQ_MSG_SRCPORT(msgid),
                        VCHIQ_MSG_DSTPORT(msgid));
@@ -907,7 +907,7 @@ queue_message(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service,
 
                if (slot_use_count)
                        vchiq_log_trace(vchiq_core_log_level,
-                               "%d: qm:%d %s,%zx - slot_use->%d (hdr %p)",
+                               "%d: qm:%d %s,%x - slot_use->%d (hdr %p)",
                                state->id, service->localport,
                                msg_type_str(VCHIQ_MSG_TYPE(msgid)), size,
                                slot_use_count, header);
@@ -916,7 +916,7 @@ queue_message(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service,
                VCHIQ_SERVICE_STATS_ADD(service, ctrl_tx_bytes, size);
        } else {
                vchiq_log_info(vchiq_core_log_level,
-                       "%d: qm %s@%pK,%zx (%d->%d)", state->id,
+                       "%d: qm %s@%pK,%x (%d->%d)", state->id,
                        msg_type_str(VCHIQ_MSG_TYPE(msgid)),
                        header, size, VCHIQ_MSG_SRCPORT(msgid),
                        VCHIQ_MSG_DSTPORT(msgid));
@@ -939,7 +939,7 @@ queue_message(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service,
                        : VCHIQ_MAKE_FOURCC('?', '?', '?', '?');
 
                vchiq_log_info(SRVTRACE_LEVEL(service),
-                       "Sent Msg %s(%u) to %c%c%c%c s:%u d:%d len:%zu",
+                       "Sent Msg %s(%u) to %c%c%c%c s:%u d:%d len:%d",
                        msg_type_str(VCHIQ_MSG_TYPE(msgid)),
                        VCHIQ_MSG_TYPE(msgid),
                        VCHIQ_FOURCC_AS_4CHARS(svc_fourcc),
index 7a2ed78..54a7bb2 100644 (file)
@@ -237,7 +237,7 @@ add_register_map:
                audio_info("bcm2835 ALSA card created!\n");
        } else {
                audio_info("bcm2835 ALSA chip created!\n");
-               platform_set_drvdata(pdev, (void *)dev);
+               platform_set_drvdata(pdev, (void *)(uintptr_t)dev);
        }
 
        dev++;
@@ -272,13 +272,13 @@ static int snd_bcm2835_alsa_remove(struct platform_device *pdev)
                g_card = NULL;
                g_chip = NULL;
        } else {
-               idx = (uint32_t) drv_data;
+               idx = (uint32_t)(uintptr_t) drv_data;
                if (g_card != NULL) {
                        BUG_ON(!g_chip);
                        /* We pass chip device numbers in audio ipc devices
                         * other than the one we registered our card with
                         */
-                       idx = (uint32_t) drv_data;
+                       idx = (uint32_t)(uintptr_t) drv_data;
                        BUG_ON(!idx || idx > MAX_SUBSTREAMS);
                        g_chip->avail_substreams &= ~(1 << idx);
                        /* There should be atleast one substream registered