diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2015-07-13 10:44:54 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2015-07-14 14:02:44 -0400 |
commit | 8642d7f8364d9fa84a83629129e78402c169c54a (patch) | |
tree | c3c47f0ce7ab0effb2684e6b529e3eef2675d0fa | |
parent | 02941007f59ce015233d4c0f7047776960bf0c17 (diff) |
intel_scu_ipc: move local memory initialization out of a mutex
'{ }' and memset will both reset the cbuf buffer.
Only once is enough and this can be done outside fo the mutex.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
-rw-r--r-- | drivers/platform/x86/intel_scu_ipc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 001b199a8c33..187d1086d15c 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c | |||
@@ -216,13 +216,13 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) | |||
216 | int nc; | 216 | int nc; |
217 | u32 offset = 0; | 217 | u32 offset = 0; |
218 | int err; | 218 | int err; |
219 | u8 cbuf[IPC_WWBUF_SIZE] = { }; | 219 | u8 cbuf[IPC_WWBUF_SIZE]; |
220 | u32 *wbuf = (u32 *)&cbuf; | 220 | u32 *wbuf = (u32 *)&cbuf; |
221 | 221 | ||
222 | mutex_lock(&ipclock); | ||
223 | |||
224 | memset(cbuf, 0, sizeof(cbuf)); | 222 | memset(cbuf, 0, sizeof(cbuf)); |
225 | 223 | ||
224 | mutex_lock(&ipclock); | ||
225 | |||
226 | if (ipcdev.pdev == NULL) { | 226 | if (ipcdev.pdev == NULL) { |
227 | mutex_unlock(&ipclock); | 227 | mutex_unlock(&ipclock); |
228 | return -ENODEV; | 228 | return -ENODEV; |