ASoc: msm: Improve error checking in code

Improve code by adding more error checking,
fixing case statments and removing unnecessary
logic.

Change-Id: I95dd72639e7d4eab5aad80b3d1ec5e64b3f88ac0
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
diff --git a/arch/arm/mach-msm/qdsp6v2/rtac.c b/arch/arm/mach-msm/qdsp6v2/rtac.c
index a3a14c4..4fd20d0 100644
--- a/arch/arm/mach-msm/qdsp6v2/rtac.c
+++ b/arch/arm/mach-msm/qdsp6v2/rtac.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2011-2012, Code Aurora Forum. 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
@@ -443,7 +443,6 @@
 
 
 	if (payload_size > MAX_PAYLOAD_SIZE) {
-
 			pr_err("%s: Invalid payload size = %d\n",
 				__func__, payload_size);
 		goto done;
@@ -614,7 +613,6 @@
 	}
 
 	if (payload_size > MAX_PAYLOAD_SIZE) {
-
 			pr_err("%s: Invalid payload size = %d\n",
 				__func__, payload_size);
 		goto done;
@@ -625,17 +623,15 @@
 			__func__);
 		goto done;
 	}
-	if (session_id > (SESSION_MAX + 1)) {
+	if (session_id > SESSION_MAX) {
 		pr_err("%s: Invalid Session = %d\n", __func__, session_id);
 		goto done;
 	}
 
 	mutex_lock(&rtac_asm_apr_mutex);
-	if (session_id < SESSION_MAX+1) {
-		if (rtac_asm_apr_data[session_id].apr_handle == NULL) {
-			pr_err("%s: APR not initialized\n", __func__);
-			goto err;
-		}
+	if (rtac_asm_apr_data[session_id].apr_handle == NULL) {
+		pr_err("%s: APR not initialized\n", __func__);
+		goto err;
 	}
 
 	/* Set globals for copy of returned payload */