From: unsik Kim <donari75@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-BOOT][PATCH 1/3] mflash : Fix some style issue
Date: Tue, 17 Feb 2009 16:10:17 +0900 [thread overview]
Message-ID: <499A62D9.1050807@gmail.com> (raw)
Signed-off-by: unsik Kim <donari75@gmail.com>
---
common/env_mgdisk.c | 2 ++
drivers/block/mg_disk.c | 13 +++++--------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/common/env_mgdisk.c b/common/env_mgdisk.c
index 2b4949f..363ee68 100644
--- a/common/env_mgdisk.c
+++ b/common/env_mgdisk.c
@@ -72,11 +72,13 @@ OUT:
int saveenv(void)
{
unsigned int err;
+
env_ptr->crc = crc32(0, env_ptr->data, ENV_SIZE);
err = mg_disk_write(CONFIG_ENV_ADDR, (u_char *)env_ptr,
CONFIG_ENV_SIZE);
if (err)
puts ("*** Warning - mg_disk_write error\n\n");
+
return err;
}
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index 193a441..9ae8889 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -28,8 +28,6 @@
#include <asm/io.h>
#include "mg_disk_prv.h"
-#ifdef CONFIG_CMD_MG_DISK
-
#ifndef CONFIG_MG_DISK_RES
#define CONFIG_MG_DISK_RES 0
#endif
@@ -116,11 +114,11 @@ static void mg_ident_cpy (unsigned char *dst, unsigned char *src,
goto OUT;
/* skip leading white space */
- while ((*src) && (src<end) && (*src==' '))
+ while ((*src) && (src < end) && (*src == ' '))
++src;
/* copy string, omitting trailing white space */
- while ((*src) && (src<end)) {
+ while ((*src) && (src < end)) {
*dst++ = *src;
if (*src++ != ' ')
last = dst;
@@ -278,9 +276,9 @@ static unsigned int mg_out(unsigned int sect_num,
{
u32 err = MG_ERR_NONE;
- if ((err = mg_wait(MG_STAT_READY, 3000))) {
+ err = mg_wait(MG_STAT_READY, 3000);
+ if (err)
return err;
- }
writeb((u8)sect_cnt, MG_BASE + MG_REG_SECT_CNT);
writeb((u8)sect_num, MG_BASE + MG_REG_SECT_NUM);
@@ -289,6 +287,7 @@ static unsigned int mg_out(unsigned int sect_num,
writeb((u8)((sect_num >> 24) | MG_REG_HEAD_LBA_MODE),
MG_BASE + MG_REG_DRV_HEAD);
writeb(cmd, MG_BASE + MG_REG_COMMAND);
+
return err;
}
@@ -631,5 +630,3 @@ unsigned int mg_disk_init (void)
return err;
}
-
-#endif /* CONFIG_CMD_MG_DISK */
--
1.5.6.6
next reply other threads:[~2009-02-17 7:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-17 7:10 unsik Kim [this message]
2009-02-21 21:54 ` [U-Boot] [U-BOOT][PATCH 1/3] mflash : Fix some style issue Wolfgang Denk
2009-02-23 2:57 ` unsik Kim
2009-04-03 21:45 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=499A62D9.1050807@gmail.com \
--to=donari75@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox