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

Commit 61d08e24 authored by Jeff Hugo's avatar Jeff Hugo
Browse files

msm: smd: Update to current coding conventions and guidelines



Current coding conventions and guidelines indicate spaces and tabs should
not be intermixed, standard error code macros should be used where
appropiate, log strings should not be split onto multiple lines, and
single line if block bodies should not be wrapped in braces.

Update any non-conformant lines of code to the current coding conventions
and guidelines.

Change-Id: Iaeb6d1f351e5f763671bdda4bc3f576607ce654d
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
parent 912b94f9
Loading
Loading
Loading
Loading
+18 −23
Original line number Diff line number Diff line
/* arch/arm/mach-msm/smd.c
 *
 * Copyright (C) 2007 Google, Inc.
 * Copyright (c) 2008-2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2014, The Linux Foundation. All rights reserved.
 * Author: Brian Swetland <swetland@google.com>
 *
 * This software is licensed under the terms of the GNU General Public
@@ -1081,9 +1081,7 @@ static int ch_read(struct smd_channel *ch, void *_data, int len, int user_buf)
				}
				r = copy_to_user(data, ptr, n);
				if (r > 0) {
					pr_err("%s: "
						"copy_to_user could not copy "
						"%i bytes.\n",
					pr_err("%s: copy_to_user could not copy %i bytes.\n",
						__func__,
						r);
				}
@@ -1453,9 +1451,7 @@ static int smd_stream_write(smd_channel_t *ch, const void *_data, int len,
			}
			r = copy_from_user(ptr, buf, xfer);
			if (r > 0) {
				pr_err("%s: "
					"copy_from_user could not copy %i "
					"bytes.\n",
				pr_err("%s: copy_from_user could not copy %i bytes.\n",
					__func__,
					r);
			}
@@ -1497,16 +1493,16 @@ static int smd_packet_write(smd_channel_t *ch, const void *_data, int len,

	ret = smd_stream_write(ch, hdr, sizeof(hdr), 0);
	if (ret < 0 || ret != sizeof(hdr)) {
		SMD_DBG("%s failed to write pkt header: "
			"%d returned\n", __func__, ret);
		SMD_DBG("%s failed to write pkt header: %d returned\n",
								__func__, ret);
		return -1;
	}


	ret = smd_stream_write(ch, _data, len, user_buf);
	if (ret < 0 || ret != len) {
		SMD_DBG("%s failed to write pkt data: "
			"%d returned\n", __func__, ret);
		SMD_DBG("%s failed to write pkt data: %d returned\n",
								__func__, ret);
		return ret;
	}

@@ -1671,7 +1667,7 @@ static int smd_alloc(struct smd_channel *ch, int table_id,
 * @table_id: the id of the table this channel resides in. 1 = first table, 2 =
 *		seconds table, etc
 * @r_info: pointer to the info structure of the remote proc for this channel
 * @returns: -1 for failure; 0 for success
 * @returns: error code for failure; 0 for success
 */
static int smd_alloc_channel(struct smd_alloc_elm *alloc_elm, int table_id,
				struct remote_proc_info *r_info)
@@ -1681,14 +1677,14 @@ static int smd_alloc_channel(struct smd_alloc_elm *alloc_elm, int table_id,
	ch = kzalloc(sizeof(struct smd_channel), GFP_KERNEL);
	if (ch == 0) {
		pr_err("smd_alloc_channel() out of memory\n");
		return -1;
		return -ENOMEM;
	}
	ch->n = alloc_elm->cid;
	ch->type = SMD_CHANNEL_TYPE(alloc_elm->type);

	if (smd_alloc(ch, table_id, r_info)) {
		kfree(ch);
		return -1;
		return -ENODEV;
	}

	ch->fifo_mask = ch->fifo_size - 1;
@@ -1871,7 +1867,7 @@ int smd_close(smd_channel_t *ch)
	unsigned long flags;

	if (ch == 0)
		return -1;
		return -EINVAL;

	SMD_INFO("smd_close(%s)\n", ch->name);

@@ -1958,8 +1954,8 @@ int smd_write_segment(smd_channel_t *ch, void *data, int len, int user_buf)
		return -ENOEXEC;
	}
	if (ch->pending_pkt_sz - len < 0) {
		pr_err("%s: segment of size: %d will make packet go over "
			"length\n", __func__, len);
		pr_err("%s: segment of size: %d will make packet go over length\n",
								__func__, len);
		return -EINVAL;
	}

@@ -2622,11 +2618,10 @@ uint32_t smsm_get_state(uint32_t smsm_entry)
		return 0;
	}

	if (!smsm_info.state) {
	if (!smsm_info.state)
		pr_err("smsm_get_state <SM NO STATE>\n");
	} else {
	else
		rv = __raw_readl(SMSM_STATE_ADDR(smsm_entry));
	}

	return rv;
}
@@ -2706,8 +2701,8 @@ void notify_smsm_cb_clients_worker(struct work_struct *work)
			if (smsm_snapshot_count) {
				--smsm_snapshot_count;
				if (smsm_snapshot_count == 0) {
					SMSM_POWER_INFO("SMSM snapshot"
						   " wake unlock\n");
					SMSM_POWER_INFO(
						"SMSM snapshot wake unlock\n");
					__pm_relax(&smsm_snapshot_ws);
				}
			} else {