Skip to contentSkip to conversation

intel_scu_ipc: fix signedness bug

PATCH In review Axel Lin 2 participants 2 messages Oct 28, 2010 – Nov 9, 2010

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 intel_scu_ipc: fix signedness bug

busy_loop() returns negative error code, thus change err variable from u32 to int to properly propagate correct error code.

Also remove unneeded initialization for err and i variables.

---
 drivers/platform/x86/intel_scu_ipc.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/platform/x86/intel_scu_ipc.c +3 -4
index 41a9e34..50f5cf3 100644
@@ -160,7 +160,7 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
 {
 	int i, nc, bytes, d;
 	u32 offset = 0;
-	u32 err = 0;
+	int err;
 	u8 cbuf[IPC_WWBUF_SIZE] = { };
 	u32 *wbuf = (u32 *)&cbuf;
 
@@ -403,7 +403,7 @@ EXPORT_SYMBOL(intel_scu_ipc_update_register);
  */
 int intel_scu_ipc_simple_command(int cmd, int sub)
 {
-	u32 err = 0;
+	int err;
 
 	mutex_lock(&ipclock);
 	if (ipcdev.pdev == NULL) {
@@ -433,8 +433,7 @@ EXPORT_SYMBOL(intel_scu_ipc_simple_command);
 int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen,
 							u32 *out, int outlen)
 {
-	u32 err = 0;
-	int i = 0;
+	int err, i;
 
 	mutex_lock(&ipclock);
 	if (ipcdev.pdev == NULL) {
Signature · 1 line
1.7.2
#1 lore raw
Quoted 6 lines · On Thu, 28 Oct 2010 14:08:39 +0800 Axel Lin <[email protected]> wrote:

busy_loop() returns negative error code, thus change err variable from u32 to int to properly propagate correct error code.

Also remove unneeded initialization for err and i variables.

This was already partly fixed in my tree but added the other fixes.

Thanks
Alan