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

Commit c5f269d2 authored by Surendar karka's avatar Surendar karka Committed by Gerrit - the friendly Code Review server
Browse files

mfd: wcd9xxx-slimslave: Change slim driver to use %pK



Change slimslave driver to use %pK instead
of %p. %pK hides addresses when the users doesn't
have kernel permissions. If address information
is needed echo 0 > /proc/sys/kernel/kptr_restrict.

Change-Id: I319f7a4f71e779963c4d31eb5a0f91637cf805d2
Signed-off-by: default avatarSurendar karka <sukark@codeaurora.org>
parent df63c2df
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -266,7 +266,7 @@ int wcd9xxx_cfg_slim_sch_rx(struct wcd9xxx *wcd9xxx,

	list_for_each_entry(rx, wcd9xxx_ch_list, list) {
		codec_port = rx->port;
		pr_debug("%s: codec_port %d rx 0x%p, payload %d\n"
		pr_debug("%s: codec_port %d rx 0x%pK, payload %d\n"
			 "sh_ch.rx_port_ch_reg_base0 0x%x\n"
			 "sh_ch.port_rx_cfg_reg_base 0x%x\n",
			 __func__, codec_port, rx, payload,
@@ -373,7 +373,7 @@ int wcd9xxx_cfg_slim_sch_tx(struct wcd9xxx *wcd9xxx,
	pr_debug("%s: ch_cnt[%d] rate[%d]\n", __func__, ch_cnt, rate);
	list_for_each_entry(tx, wcd9xxx_ch_list, list) {
		codec_port = tx->port;
		pr_debug("%s: codec_port %d tx 0x%p, payload 0x%x\n",
		pr_debug("%s: codec_port %d tx 0x%pK, payload 0x%x\n",
			 __func__, codec_port, tx, payload);
		/* write to interface device */
		ret = wcd9xxx_interface_reg_write(wcd9xxx,
@@ -595,7 +595,7 @@ int wcd9xxx_slim_ch_master_open(struct wcd9xxx *wcd9xxx,
		 __func__, rate, bit_sz);

	if (wcd9xxx == NULL || handle == NULL) {
		pr_err("%s: Invalid params, wcd9xxx(%p) handle(%p)\n",
		pr_err("%s: Invalid params, wcd9xxx(%pK) handle(%pK)\n",
			__func__, wcd9xxx, handle);
		return -EINVAL;
	}
@@ -658,12 +658,12 @@ int wcd9xxx_slim_ch_master_open(struct wcd9xxx *wcd9xxx,
	*handle = (struct wcd9xxx_master_cfg *)tx_master;
	tx_master->slim_s.handle = *handle;
	init_completion(&tx_master->slim_s.sb_comp);
	pr_debug("%s: Handle %p slim_cfg->ph1 %x slim grp handle %x\n"
	pr_debug("%s: Handle %pK slim_cfg->ph1 %x slim grp handle %x\n"
		 "chanh %x\n", __func__, tx_master->slim_s.handle,
		 tx_master->slim_cfg->ph1, tx_master->slim_cfg->grph,
		 tx_master->slim_cfg->chanh);
	mutex_unlock(&tx_master->lock);
	pr_debug("%s: Handle %p slim_cfg->ph1 %x slim grp\n"
	pr_debug("%s: Handle %pK slim_cfg->ph1 %x slim grp\n"
		 "handle %x chanh %x ref count %x\n",
		 __func__, tx_master->slim_s.handle,
		 tx_master->slim_cfg->ph1,
@@ -687,14 +687,14 @@ int wcd9xxx_slim_ch_master_close(struct wcd9xxx *wcd9xxx, void **handle)
	struct wcd9xxx_slim_master_prop *slim_cfg;

	if (wcd9xxx == NULL || handle == NULL) {
		pr_err("%s: Invalid params, wcd9xxx(%p) handle(%p)\n",
		pr_err("%s: Invalid params, wcd9xxx(%pK) handle(%pK)\n",
			__func__, wcd9xxx, handle);
		return -EINVAL;
	}

	tx_master = &slim_tx_master;
	if (*handle != tx_master->slim_s.handle) {
		pr_err("%s: handle(%p) not matching slim_hdl(%p)\n",
		pr_err("%s: handle(%pK) not matching slim_hdl(%pK)\n",
			__func__, *handle, tx_master->slim_s.handle);
		return -EINVAL;
	}
@@ -751,7 +751,7 @@ int wcd9xxx_slim_ch_master_status(struct wcd9xxx *wcd9xxx, void *handle,
	}
	tx_master = &slim_tx_master;
	if (handle != tx_master->slim_s.handle) {
		pr_err("%s: handle(%p) not matching slim_hdl(%p)\n",
		pr_err("%s: handle(%pK) not matching slim_hdl(%pK)\n",
			__func__, handle, tx_master->slim_s.handle);
		return -EINVAL;
	}
@@ -775,17 +775,17 @@ int wcd9xxx_slim_ch_master_enable_read(struct wcd9xxx *wcd9xxx, void *handle)
	int rc = 0;
	struct wcd9xxx_master_cfg *tx_master;
	struct wcd9xxx_slim_master_prop *slim_cfg;
	pr_debug("%s:handle = %p\n", __func__, handle);
	pr_debug("%s:handle = %pK\n", __func__, handle);

	if (wcd9xxx == NULL || handle == NULL) {
		pr_err("%s: Invalid params, wcd9xxx(%p) handle(%p)\n",
		pr_err("%s: Invalid params, wcd9xxx(%pK) handle(%pK)\n",
			__func__, wcd9xxx, handle);
		return -EINVAL;
	}

	tx_master = &slim_tx_master;
	if (handle != tx_master->slim_s.handle) {
		pr_err("%s: handle(%p) not matching slim_hdl(%p)\n",
		pr_err("%s: handle(%pK) not matching slim_hdl(%pK)\n",
			__func__, handle, tx_master->slim_s.handle);
		return -EINVAL;
	}
@@ -822,7 +822,7 @@ int wcd9xxx_slim_ch_master_read(struct wcd9xxx *wcd9xxx, void *handle,
	struct wcd9xxx_slim_master_prop *slim_cfg;
	struct completion *sb_comp;

	pr_debug("%s: handle %p len %x\n",
	pr_debug("%s: handle %pK len %x\n",
		  __func__, handle, read_len);

	if (wcd9xxx == NULL || handle == NULL) {
@@ -832,7 +832,7 @@ int wcd9xxx_slim_ch_master_read(struct wcd9xxx *wcd9xxx, void *handle,

	tx_master = &slim_tx_master;
	if (handle != tx_master->slim_s.handle) {
		pr_err("%s: handle(%p) not matching slim_hdl(%p)\n",
		pr_err("%s: handle(%pK) not matching slim_hdl(%pK)\n",
			__func__, handle, tx_master->slim_s.handle);
		return -EINVAL;
	}