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

Commit b8b36756 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: Change format used for printing pointers"

parents 3db302b1 0911ca4d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1956,8 +1956,8 @@ int diag_dci_write_proc(int peripheral, int pkt_type, char *buf, int len)

	if (!buf || (peripheral < 0 || peripheral > NUM_SMD_DCI_CHANNELS)
								|| len < 0) {
		pr_err("diag: In %s, invalid data 0x%x, peripheral: %d, len: %d\n",
				__func__, (unsigned int)buf, peripheral, len);
		pr_err("diag: In %s, invalid data 0x%p, peripheral: %d, len: %d\n",
				__func__, buf, peripheral, len);
		return -EINVAL;
	}

+20 −20
Original line number Diff line number Diff line
@@ -41,16 +41,16 @@ static ssize_t diag_dbgfs_read_status(struct file *file, char __user *ubuf,
	}

	ret = scnprintf(buf, DEBUG_BUF_SIZE,
		"modem ch: 0x%x\n"
		"lpass ch: 0x%x\n"
		"riva ch: 0x%x\n"
		"modem dci ch: 0x%x\n"
		"lpass dci ch: 0x%x\n"
		"modem cntl_ch: 0x%x\n"
		"lpass cntl_ch: 0x%x\n"
		"riva cntl_ch: 0x%x\n"
		"modem cmd ch: 0x%x\n"
		"modem dci cmd ch: 0x%x\n"
		"modem ch: 0x%p\n"
		"lpass ch: 0x%p\n"
		"riva ch: 0x%p\n"
		"modem dci ch: 0x%p\n"
		"lpass dci ch: 0x%p\n"
		"modem cntl_ch: 0x%p\n"
		"lpass cntl_ch: 0x%p\n"
		"riva cntl_ch: 0x%p\n"
		"modem cmd ch: 0x%p\n"
		"modem dci cmd ch: 0x%p\n"
		"CPU Tools id: %d\n"
		"Apps only: %d\n"
		"Apps master: %d\n"
@@ -111,16 +111,16 @@ static ssize_t diag_dbgfs_read_status(struct file *file, char __user *ubuf,
		"Received Feature mask from WCNSS: %d\n"
		"logging_mode: %d\n"
		"real_time_mode: %d\n",
		(unsigned int)driver->smd_data[MODEM_DATA].ch,
		(unsigned int)driver->smd_data[LPASS_DATA].ch,
		(unsigned int)driver->smd_data[WCNSS_DATA].ch,
		(unsigned int)driver->smd_dci[MODEM_DATA].ch,
		(unsigned int)driver->smd_dci[LPASS_DATA].ch,
		(unsigned int)driver->smd_cntl[MODEM_DATA].ch,
		(unsigned int)driver->smd_cntl[LPASS_DATA].ch,
		(unsigned int)driver->smd_cntl[WCNSS_DATA].ch,
		(unsigned int)driver->smd_cmd[MODEM_DATA].ch,
		(unsigned int)driver->smd_dci_cmd[MODEM_DATA].ch,
		driver->smd_data[MODEM_DATA].ch,
		driver->smd_data[LPASS_DATA].ch,
		driver->smd_data[WCNSS_DATA].ch,
		driver->smd_dci[MODEM_DATA].ch,
		driver->smd_dci[LPASS_DATA].ch,
		driver->smd_cntl[MODEM_DATA].ch,
		driver->smd_cntl[LPASS_DATA].ch,
		driver->smd_cntl[WCNSS_DATA].ch,
		driver->smd_cmd[MODEM_DATA].ch,
		driver->smd_dci_cmd[MODEM_DATA].ch,
		chk_config_get_id(),
		chk_apps_only(),
		chk_apps_master(),
+2 −2
Original line number Diff line number Diff line
@@ -288,8 +288,8 @@ static void diag_update_log_mask(int equip_id, uint8_t *buf, int num_items)
	driver->log_status = DIAG_CTRL_MASK_INVALID;
	if (!buf || (equip_id < 0 || equip_id >= MAX_EQUIP_ID) ||
							num_items < 1) {
		pr_err("diag: Invalid params in %s, buf: %x equip_id: %d, num_items: %d\n",
		       __func__, (unsigned int)buf, equip_id, num_items);
		pr_err("diag: Invalid params in %s, buf: %p equip_id: %d, num_items: %d\n",
		       __func__, buf, equip_id, num_items);
		mutex_unlock(&driver->log_mask_mutex);
		return;
	}
+8 −5
Original line number Diff line number Diff line
@@ -1135,7 +1135,7 @@ long diagchar_ioctl(struct file *filp,
	return result;
}

static int diagchar_read(struct file *file, char __user *buf, size_t count,
static ssize_t diagchar_read(struct file *file, char __user *buf, size_t count,
			  loff_t *ppos)
{
	struct diag_dci_client_tbl *entry;
@@ -1432,7 +1432,7 @@ exit:
	return ret;
}

static int diagchar_write(struct file *file, const char __user *buf,
static ssize_t diagchar_write(struct file *file, const char __user *buf,
				size_t count, loff_t *ppos)
{
	int err, ret = 0, pkt_type, token_offset = 0;
@@ -1846,8 +1846,8 @@ static int diagchar_write(struct file *file, const char __user *buf,
	/* This is to check if after HDLC encoding, we are still within the
	 limits of aggregation buffer. If not, we write out the current buffer
	and start aggregation in a newly allocated buffer */
	if ((unsigned int) enc.dest >=
		 (unsigned int)(buf_hdlc + HDLC_OUT_BUF_SIZE)) {
	if ((uintptr_t)enc.dest >=
		 (uintptr_t)(buf_hdlc + HDLC_OUT_BUF_SIZE)) {
		err = diag_device_write(buf_hdlc, APPS_DATA, NULL);
		if (err) {
			ret = -EIO;
@@ -1867,7 +1867,10 @@ static int diagchar_write(struct file *file, const char __user *buf,
		diag_hdlc_encode(&send, &enc);
	}

	driver->used = (uint32_t) enc.dest - (uint32_t) buf_hdlc;
	driver->used = ((uintptr_t)enc.dest - (uintptr_t)buf_hdlc <
						HDLC_OUT_BUF_SIZE) ?
			((uintptr_t)enc.dest - (uintptr_t)buf_hdlc) :
						HDLC_OUT_BUF_SIZE;
	if (pkt_type == DATA_TYPE_RESPONSE) {
		err = diag_device_write(buf_hdlc, APPS_DATA, NULL);
		if (err) {
+2 −2
Original line number Diff line number Diff line
@@ -242,8 +242,8 @@ int crc_check(uint8_t *buf, uint16_t len)
	 * of data and 3 bytes for CRC
	 */
	if (!buf || len < 4) {
		pr_err_ratelimited("diag: In %s, invalid packet or length, buf: 0x%x, len: %d",
				   __func__, (int)buf, len);
		pr_err_ratelimited("diag: In %s, invalid packet or length, buf: 0x%p, len: %d",
				   __func__, buf, len);
		return -EIO;
	}