linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: davinci: dm644x: move the dereference below the NULL test
@ 2012-09-10  4:49 Wei Yongjun
  2012-10-26 10:15 ` Sekhar Nori
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2012-09-10  4:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

The dereference should be moved below the NULL test.

spatch with a semantic match is used to found this.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 arch/arm/mach-davinci/board-dm644x-evm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index d34ed55..b54dc03 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -518,13 +518,11 @@ static int dm6444evm_msp430_get_pins(void)
 	char buf[4];
 	struct i2c_msg msg[2] = {
 		{
-			.addr = dm6446evm_msp->addr,
 			.flags = 0,
 			.len = 2,
 			.buf = (void __force *)txbuf,
 		},
 		{
-			.addr = dm6446evm_msp->addr,
 			.flags = I2C_M_RD,
 			.len = 4,
 			.buf = buf,
@@ -535,6 +533,9 @@ static int dm6444evm_msp430_get_pins(void)
 	if (!dm6446evm_msp)
 		return -ENXIO;
 
+	msg[0].addr = dm6446evm_msp->addr;
+	msg[1].addr = dm6446evm_msp->addr;
+
 	/* Command 4 == get input state, returns port 2 and port3 data
 	 *   S Addr W [A] len=2 [A] cmd=4 [A]
 	 *   RS Addr R [A] [len=4] A [cmd=4] A [port2] A [port3] N P

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] ARM: davinci: dm644x: move the dereference below the NULL test
  2012-09-10  4:49 [PATCH] ARM: davinci: dm644x: move the dereference below the NULL test Wei Yongjun
@ 2012-10-26 10:15 ` Sekhar Nori
  0 siblings, 0 replies; 2+ messages in thread
From: Sekhar Nori @ 2012-10-26 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

On 9/10/2012 10:19 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> The dereference should be moved below the NULL test.
> 
> spatch with a semantic match is used to found this.
> (http://coccinelle.lip6.fr/)
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Queuing this for inclusion in v3.8

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-26 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-10  4:49 [PATCH] ARM: davinci: dm644x: move the dereference below the NULL test Wei Yongjun
2012-10-26 10:15 ` Sekhar Nori

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).