Skip to content

Commit

Permalink
intel_scu_ipc: move local memory initialization out of a mutex
Browse files Browse the repository at this point in the history
'{ }' 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>
  • Loading branch information
Christophe JAILLET authored and Darren Hart committed Jul 14, 2015
1 parent 0294100 commit 8642d7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/platform/x86/intel_scu_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8642d7f

Please sign in to comment.