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

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

soc: qcom: Fix warnings in glink



Fix a handful of warnings in glink_probe.c and glink_pkt.c mainly
having to do with incorrect prink parameters but also a few instances
where there were too many or two few printk() arguments and one spot
where the error return value for a function was being incorrectly set.

Change-Id: Ic0dedbadb065fc43a0247d215464e47848d77b05
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 8e1d0d1f
Loading
Loading
Loading
Loading
+15 −14
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/platform_device.h>
#include <linux/platform_device.h>
@@ -259,7 +259,7 @@ int glink_pkt_open(struct inode *inode, struct file *file)
	refcount_inc(&gpdev->refcount);
	refcount_inc(&gpdev->refcount);
	get_device(dev);
	get_device(dev);


	GLINK_PKT_INFO("begin for %s by %s:%ld ref_cnt[%d]\n",
	GLINK_PKT_INFO("begin for %s by %s:%d ref_cnt[%d]\n",
		       gpdev->ch_name, current->comm,
		       gpdev->ch_name, current->comm,
		       task_pid_nr(current), refcount_read(&gpdev->refcount));
		       task_pid_nr(current), refcount_read(&gpdev->refcount));


@@ -267,13 +267,13 @@ int glink_pkt_open(struct inode *inode, struct file *file)
	if (ret <= 0) {
	if (ret <= 0) {
		refcount_dec(&gpdev->refcount);
		refcount_dec(&gpdev->refcount);
		put_device(dev);
		put_device(dev);
		GLINK_PKT_INFO("timeout for %s by %s:%ld\n", gpdev->ch_name,
		GLINK_PKT_INFO("timeout for %s by %s:%d\n", gpdev->ch_name,
			       current->comm, task_pid_nr(current));
			       current->comm, task_pid_nr(current));
		return -ETIMEDOUT;
		return -ETIMEDOUT;
	}
	}
	file->private_data = gpdev;
	file->private_data = gpdev;


	GLINK_PKT_INFO("end for %s by %s:%ld ref_cnt[%d]\n",
	GLINK_PKT_INFO("end for %s by %s:%d ref_cnt[%d]\n",
		       gpdev->ch_name, current->comm,
		       gpdev->ch_name, current->comm,
		       task_pid_nr(current), refcount_read(&gpdev->refcount));
		       task_pid_nr(current), refcount_read(&gpdev->refcount));


@@ -296,7 +296,7 @@ int glink_pkt_release(struct inode *inode, struct file *file)
	struct sk_buff *skb;
	struct sk_buff *skb;
	unsigned long flags;
	unsigned long flags;


	GLINK_PKT_INFO("for %s by %s:%ld ref_cnt[%d]\n",
	GLINK_PKT_INFO("for %s by %s:%d ref_cnt[%d]\n",
		       gpdev->ch_name, current->comm,
		       gpdev->ch_name, current->comm,
		       task_pid_nr(current), refcount_read(&gpdev->refcount));
		       task_pid_nr(current), refcount_read(&gpdev->refcount));


@@ -339,7 +339,7 @@ ssize_t glink_pkt_read(struct file *file, char __user *buf,
	int use;
	int use;


	if (!gpdev || refcount_read(&gpdev->refcount) == 1) {
	if (!gpdev || refcount_read(&gpdev->refcount) == 1) {
		GLINK_PKT_ERR("invalid device handle\n", __func__);
		GLINK_PKT_ERR("invalid device handle\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


@@ -348,7 +348,7 @@ ssize_t glink_pkt_read(struct file *file, char __user *buf,
		return -ENETRESET;
		return -ENETRESET;
	}
	}


	GLINK_PKT_INFO("begin for %s by %s:%ld ref_cnt[%d]\n",
	GLINK_PKT_INFO("begin for %s by %s:%d ref_cnt[%d]\n",
		       gpdev->ch_name, current->comm,
		       gpdev->ch_name, current->comm,
		       task_pid_nr(current), refcount_read(&gpdev->refcount));
		       task_pid_nr(current), refcount_read(&gpdev->refcount));


@@ -384,7 +384,7 @@ ssize_t glink_pkt_read(struct file *file, char __user *buf,


	kfree_skb(skb);
	kfree_skb(skb);


	GLINK_PKT_INFO("end for %s by %s:%ld ret[%d]\n", gpdev->ch_name,
	GLINK_PKT_INFO("end for %s by %s:%d ret[%d]\n", gpdev->ch_name,
		       current->comm, task_pid_nr(current), use);
		       current->comm, task_pid_nr(current), use);


	return use;
	return use;
@@ -410,7 +410,7 @@ ssize_t glink_pkt_write(struct file *file, const char __user *buf,


	gpdev = file->private_data;
	gpdev = file->private_data;
	if (!gpdev || refcount_read(&gpdev->refcount) == 1) {
	if (!gpdev || refcount_read(&gpdev->refcount) == 1) {
		GLINK_PKT_ERR("invalid device handle\n", __func__);
		GLINK_PKT_ERR("invalid device handle\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


@@ -460,7 +460,7 @@ static unsigned int glink_pkt_poll(struct file *file, poll_table *wait)


	gpdev = file->private_data;
	gpdev = file->private_data;
	if (!gpdev || refcount_read(&gpdev->refcount) == 1) {
	if (!gpdev || refcount_read(&gpdev->refcount) == 1) {
		GLINK_PKT_ERR("invalid device handle\n", __func__);
		GLINK_PKT_ERR("invalid device handle\n");
		return POLLERR;
		return POLLERR;
	}
	}
	if (!completion_done(&gpdev->ch_open)) {
	if (!completion_done(&gpdev->ch_open)) {
@@ -555,7 +555,7 @@ static long glink_pkt_ioctl(struct file *file, unsigned int cmd,


	gpdev = file->private_data;
	gpdev = file->private_data;
	if (!gpdev || refcount_read(&gpdev->refcount) == 1) {
	if (!gpdev || refcount_read(&gpdev->refcount) == 1) {
		GLINK_PKT_ERR("invalid device handle\n", __func__);
		GLINK_PKT_ERR("invalid device handle\n");
		return -EINVAL;
		return -EINVAL;
	}
	}
	if (mutex_lock_interruptible(&gpdev->lock))
	if (mutex_lock_interruptible(&gpdev->lock))
@@ -824,8 +824,8 @@ static int glink_pkt_probe(struct platform_device *pdev)
	}
	}
	glink_pkt_class = class_create(THIS_MODULE, "glinkpkt");
	glink_pkt_class = class_create(THIS_MODULE, "glinkpkt");
	if (IS_ERR(glink_pkt_class)) {
	if (IS_ERR(glink_pkt_class)) {
		GLINK_PKT_ERR("class_create failed ret:%d\n",
		ret = PTR_ERR(glink_pkt_class);
			      PTR_ERR(glink_pkt_class));
		GLINK_PKT_ERR("class_create failed ret:%d\n", ret);
		goto error_deinit;
		goto error_deinit;
	}
	}


@@ -866,7 +866,8 @@ static int __init glink_pkt_init(void)


	ret = platform_driver_register(&glink_pkt_driver);
	ret = platform_driver_register(&glink_pkt_driver);
	if (ret) {
	if (ret) {
		GLINK_PKT_ERR("%s: glink_pkt register failed %d\n", ret);
		GLINK_PKT_ERR("%s: glink_pkt register failed %d\n",
			__func__, ret);
		return ret;
		return ret;
	}
	}
	glink_pkt_ilctxt = ipc_log_context_create(GLINK_PKT_IPC_LOG_PAGE_CNT,
	glink_pkt_ilctxt = ipc_log_context_create(GLINK_PKT_IPC_LOG_PAGE_CNT,
+2 −2
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/of.h>
#include <linux/of.h>
@@ -256,7 +256,7 @@ static int glink_probe_ssr_cb(struct notifier_block *this,
{
{
	struct edge_info *einfo = container_of(this, struct edge_info, nb);
	struct edge_info *einfo = container_of(this, struct edge_info, nb);


	GLINK_INFO("received %d for %s", code, einfo->ssr_label);
	GLINK_INFO("received %ld for %s\n", code, einfo->ssr_label);


	switch (code) {
	switch (code) {
	case SUBSYS_AFTER_POWERUP:
	case SUBSYS_AFTER_POWERUP: