linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: move the dereference below the NULL test
@ 2012-09-07  7:04 Wei Yongjun
  2012-09-07  8:47 ` yongjun_wei
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2012-09-07  7:04 UTC (permalink / raw)
  To: grant.likely, rob.herring; +Cc: yongjun_wei, linux-kernel, devicetree-discuss

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>
---
 drivers/block/swim3.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 89ddab1..25a522d 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -1090,13 +1090,14 @@ static const struct block_device_operations floppy_fops = {
 static void swim3_mb_event(struct macio_dev* mdev, int mb_state)
 {
 	struct floppy_state *fs = macio_get_drvdata(mdev);
-	struct swim3 __iomem *sw = fs->swim3;
+	struct swim3 __iomem *sw;
 
 	if (!fs)
 		return;
 	if (mb_state != MB_FD)
 		return;
 
+	sw = fs->swim3;
 	/* Clear state */
 	out_8(&sw->intr_enable, 0);
 	in_8(&sw->intr);


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

* RE: [PATCH] block: move the dereference below the NULL test
  2012-09-07  7:04 [PATCH] block: move the dereference below the NULL test Wei Yongjun
@ 2012-09-07  8:47 ` yongjun_wei
  0 siblings, 0 replies; 2+ messages in thread
From: yongjun_wei @ 2012-09-07  8:47 UTC (permalink / raw)
  To: grant.likely, rob.herring; +Cc: linux-kernel, devicetree-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 1151 bytes --]

Sorry, I see the patch fix this issue has already exists in the maillist,
please ignore it, thanks.

-----Original Message-----
From: Wei Yongjun [mailto:weiyj.lk@gmail.com] 
Sent: 2012Äê9ÔÂ7ÈÕ 15:04
To: grant.likely@secretlab.ca; rob.herring@calxeda.com
Cc: Yongjun Wei (RD-CN); linux-kernel@vger.kernel.org; devicetree-discuss@lists.ozlabs.org
Subject: [PATCH] block: move the dereference below the NULL test

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



TREND MICRO EMAIL NOTICE
The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

end of thread, other threads:[~2012-09-07  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-07  7:04 [PATCH] block: move the dereference below the NULL test Wei Yongjun
2012-09-07  8:47 ` yongjun_wei

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