Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce20ceb5 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

soc: qcom: Fix compile warnings



Fix the following compiler warning(s) from gcc 6.1.1 with -Werror enabled:

 drivers/soc/qcom/spcom.c:403:
   format '%zu' expects argument of type 'size_t', but argument 5 has type
     'uint32_t {aka unsigned int}' [-Werror=format=]
   pr_debug("pending data size [%zu], requested size [%zu], ch->txn_id %d\n",

 drivers/soc/qcom/spcom.c:898:
   format '%ld' expects argument of type 'long int', but argument 3 has type
     'uint32_t {aka unsigned int}' [-Werror=format=]
   pr_err("int overflow [%ld]\n", cmd->arg);

 drivers/soc/qcom/spcom.c:929:
   format '%x' expects argument of type 'unsigned int', but argument 7 has type
     'struct dma_buf *' [-Werror=format=]
    pr_debug("ch [%s] locked ion buf #%d fd [%d] dma_buf=0x%x\n",

 drivers/soc/qcom/spcom.c:967:
   format '%ld' expects argument of type 'long int', but argument 3 has type
     'uint32_t {aka unsigned int}' [-Werror=format=]
   pr_err("int overflow [%ld]\n", cmd->arg);

 drivers/soc/qcom/spcom.c:1003:
   format '%x' expects argument of type 'unsigned int', but argument 7 has
     type 'struct dma_buf *' [-Werror=format=]
   pr_debug("ch [%s] unlocked ion buf #%d fd [%d] dma_buf=0x%x\n",

 drivers/soc/qcom/spcom.c:1372:
   format '%d' expects argument of type 'int', but argument 5 has type 'size_t
     {aka long unsigned int}' [-Werror=format=]
   pr_debug("ch [%s] discarting unconsumed rx packet actual_rx_size=%d\n",

 drivers/soc/qcom/spcom.c:1886:
   format '%d' expects argument of type 'int', but argument 5 has type
     'size_t {aka long unsigned int}' [-Werror=format=]
   pr_debug("ch [%s] rx aborted free %d bytes\n",

 drivers/soc/qcom/spcom.c:1894:
   format '%d' expects argument of type 'int', but argument 4 has type
     'size_t {aka long unsigned int}' [-Werror=format=]
   pr_err("ch [%s] previous buffer not consumed %d bytes\n",

Fixes: 2f0b9d5e ("soc: qcom: add secure processor communication (spcom) driver")
Change-Id: Ic0dedbad118d50365052f832c9666dba7902ec61
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 0fe45088
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -400,7 +400,7 @@ static int spcom_rx(struct spcom_channel *ch,
			goto exit_err;
		}
	} else {
		pr_debug("pending data size [%zu], requested size [%zu], ch->txn_id %d\n",
		pr_debug("pending data size [%zu], requested size [%u], ch->txn_id %d\n",
			 ch->actual_rx_size, size, ch->txn_id);
	}
	if (!ch->rpmsg_rx_buf) {
@@ -895,7 +895,7 @@ static int spcom_handle_lock_ion_buf_command(struct spcom_channel *ch,
	}

	if (cmd->arg > (unsigned int)INT_MAX) {
		pr_err("int overflow [%ld]\n", cmd->arg);
		pr_err("int overflow [%u]\n", cmd->arg);
		return -EINVAL;
	}
	fd = cmd->arg;
@@ -926,7 +926,7 @@ static int spcom_handle_lock_ion_buf_command(struct spcom_channel *ch,
		if (ch->dmabuf_handle_table[i] == NULL) {
			ch->dmabuf_handle_table[i] = dma_buf;
			ch->dmabuf_fd_table[i] = fd;
			pr_debug("ch [%s] locked ion buf #%d fd [%d] dma_buf=0x%x\n",
			pr_debug("ch [%s] locked ion buf #%d fd [%d] dma_buf=0x%pK\n",
				ch->name, i,
				ch->dmabuf_fd_table[i],
				ch->dmabuf_handle_table[i]);
@@ -964,7 +964,7 @@ static int spcom_handle_unlock_ion_buf_command(struct spcom_channel *ch,
		return -EINVAL;
	}
	if (cmd->arg > (unsigned int)INT_MAX) {
		pr_err("int overflow [%ld]\n", cmd->arg);
		pr_err("int overflow [%u]\n", cmd->arg);
		return -EINVAL;
	}
	fd = cmd->arg;
@@ -1000,7 +1000,7 @@ static int spcom_handle_unlock_ion_buf_command(struct spcom_channel *ch,
			if (!ch->dmabuf_handle_table[i])
				continue;
			if (ch->dmabuf_handle_table[i] == dma_buf) {
				pr_debug("ch [%s] unlocked ion buf #%d fd [%d] dma_buf=0x%x\n",
				pr_debug("ch [%s] unlocked ion buf #%d fd [%d] dma_buf=0x%pK\n",
					ch->name, i,
					ch->dmabuf_fd_table[i],
					ch->dmabuf_handle_table[i]);
@@ -1369,7 +1369,7 @@ static int spcom_device_release(struct inode *inode, struct file *filp)
	ch->is_busy = false;
	ch->pid = 0;
	if (ch->rpmsg_rx_buf) {
		pr_debug("ch [%s] discarting unconsumed rx packet actual_rx_size=%d\n",
		pr_debug("ch [%s] discarting unconsumed rx packet actual_rx_size=%zd\n",
		       name, ch->actual_rx_size);
		kfree(ch->rpmsg_rx_buf);
		ch->rpmsg_rx_buf = NULL;
@@ -1884,7 +1884,7 @@ static void spcom_signal_rx_done(struct work_struct *ignored)

		if (ch->rpmsg_abort) {
			if (ch->rpmsg_rx_buf) {
				pr_debug("ch [%s] rx aborted free %d bytes\n",
				pr_debug("ch [%s] rx aborted free %zd bytes\n",
					ch->name, ch->actual_rx_size);
				kfree(ch->rpmsg_rx_buf);
				ch->actual_rx_size = 0;
@@ -1892,7 +1892,7 @@ static void spcom_signal_rx_done(struct work_struct *ignored)
			goto rx_aborted;
		}
		if (ch->rpmsg_rx_buf) {
			pr_err("ch [%s] previous buffer not consumed %d bytes\n",
			pr_err("ch [%s] previous buffer not consumed %zd bytes\n",
			       ch->name, ch->actual_rx_size);
			kfree(ch->rpmsg_rx_buf);
			ch->rpmsg_rx_buf = NULL;