Commit ecb5646c authored by Axel Lin's avatar Axel Lin Committed by Linus Torvalds

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.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c723fdab
...@@ -161,7 +161,7 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) ...@@ -161,7 +161,7 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
{ {
int i, nc, bytes, d; int i, nc, bytes, d;
u32 offset = 0; u32 offset = 0;
u32 err = 0; int err;
u8 cbuf[IPC_WWBUF_SIZE] = { }; u8 cbuf[IPC_WWBUF_SIZE] = { };
u32 *wbuf = (u32 *)&cbuf; u32 *wbuf = (u32 *)&cbuf;
...@@ -404,7 +404,7 @@ EXPORT_SYMBOL(intel_scu_ipc_update_register); ...@@ -404,7 +404,7 @@ EXPORT_SYMBOL(intel_scu_ipc_update_register);
*/ */
int intel_scu_ipc_simple_command(int cmd, int sub) int intel_scu_ipc_simple_command(int cmd, int sub)
{ {
u32 err = 0; int err;
mutex_lock(&ipclock); mutex_lock(&ipclock);
if (ipcdev.pdev == NULL) { if (ipcdev.pdev == NULL) {
...@@ -434,8 +434,7 @@ EXPORT_SYMBOL(intel_scu_ipc_simple_command); ...@@ -434,8 +434,7 @@ EXPORT_SYMBOL(intel_scu_ipc_simple_command);
int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen,
u32 *out, int outlen) u32 *out, int outlen)
{ {
u32 err = 0; int i, err;
int i = 0;
mutex_lock(&ipclock); mutex_lock(&ipclock);
if (ipcdev.pdev == NULL) { if (ipcdev.pdev == NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment