Skip to content

Commit 8642d7f

Browse files
tititiou36dvhart
authored andcommitted
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>
1 parent 0294100 commit 8642d7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/platform/x86/intel_scu_ipc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,13 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id)
216216
int nc;
217217
u32 offset = 0;
218218
int err;
219-
u8 cbuf[IPC_WWBUF_SIZE] = { };
219+
u8 cbuf[IPC_WWBUF_SIZE];
220220
u32 *wbuf = (u32 *)&cbuf;
221221

222-
mutex_lock(&ipclock);
223-
224222
memset(cbuf, 0, sizeof(cbuf));
225223

224+
mutex_lock(&ipclock);
225+
226226
if (ipcdev.pdev == NULL) {
227227
mutex_unlock(&ipclock);
228228
return -ENODEV;

0 commit comments

Comments
 (0)