diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2015-07-13 16:44:54 +0200 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2015-07-14 11:02:44 -0700 |
commit | 8642d7f8364d9fa84a83629129e78402c169c54a (patch) | |
tree | c3c47f0ce7ab0effb2684e6b529e3eef2675d0fa /drivers/platform | |
parent | 02941007f59ce015233d4c0f7047776960bf0c17 (diff) | |
download | linux-8642d7f8364d9fa84a83629129e78402c169c54a.tar.bz2 |
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>
Diffstat (limited to 'drivers/platform')
-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) int nc; u32 offset = 0; int err; - u8 cbuf[IPC_WWBUF_SIZE] = { }; + u8 cbuf[IPC_WWBUF_SIZE]; u32 *wbuf = (u32 *)&cbuf; - mutex_lock(&ipclock); - memset(cbuf, 0, sizeof(cbuf)); + mutex_lock(&ipclock); + if (ipcdev.pdev == NULL) { mutex_unlock(&ipclock); return -ENODEV; |