* [PATCH] intel_scu_ipc: move local memory initialization out of a mutex
@ 2015-07-13 14:44 Christophe JAILLET
2015-07-14 19:47 ` Darren Hart
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2015-07-13 14:44 UTC (permalink / raw)
To: dvhart
Cc: platform-driver-x86, linux-kernel, kernel-janitors, Christophe JAILLET
'{ }' 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>
---
drivers/platform/x86/intel_scu_ipc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c
index 001b199..187d108 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;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] intel_scu_ipc: move local memory initialization out of a mutex
2015-07-13 14:44 [PATCH] intel_scu_ipc: move local memory initialization out of a mutex Christophe JAILLET
@ 2015-07-14 19:47 ` Darren Hart
0 siblings, 0 replies; 2+ messages in thread
From: Darren Hart @ 2015-07-14 19:47 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: platform-driver-x86, linux-kernel, kernel-janitors
On Mon, Jul 13, 2015 at 04:44:54PM +0200, Christophe JAILLET wrote:
> '{ }' 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>
Queued, thanks Christophe.
--
Darren Hart
Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-14 19:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-13 14:44 [PATCH] intel_scu_ipc: move local memory initialization out of a mutex Christophe JAILLET
2015-07-14 19:47 ` Darren Hart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).