All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <martinez.javier@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: [PATCH 1/4] staging: keucr: Use strncmp() instead of custom StringCmp() and some style cleanups
Date: Fri, 31 Dec 2010 09:19:21 +0000	[thread overview]
Message-ID: <1293787164-7056-2-git-send-email-martinez.javier@gmail.com> (raw)


Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
---
 drivers/staging/keucr/smilsub.c |   66 ++++++++++++++++++++-------------------
 1 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/keucr/smilsub.c b/drivers/staging/keucr/smilsub.c
index ce10cf2..6aa29d9 100644
--- a/drivers/staging/keucr/smilsub.c
+++ b/drivers/staging/keucr/smilsub.c
@@ -1482,54 +1482,56 @@ BYTE _Check_D_DevCode(BYTE dcode)
 //----- Check_D_ReadError() ----------------------------------------------
 int Check_D_ReadError(BYTE *redundant)
 {
-    // Driver 不做 ECC Check
-    return(SUCCESS);
-    if (!StringCmp((char *)(redundant+0x0D),(char *)EccBuf,3))
-        if (!StringCmp((char *)(redundant+0x08),(char *)(EccBuf+0x03),3))
-            return(SUCCESS);
-
-    return(ERROR);
+	/* Driver ECC Check */
+	return SUCCESS;
+	if (!strncmp((char *)(redundant+0x0D), (char *)EccBuf, 3))
+		if (!strncmp((char *)(redundant+0x08),
+			     (char *)(EccBuf+0x03), 3))
+			return SUCCESS;
+
+	return ERROR;
 }
 
 //----- Check_D_Correct() ----------------------------------------------
 int Check_D_Correct(BYTE *buf,BYTE *redundant)
 {
-    // Driver 不做 ECC Check
-    return(SUCCESS);
-    if (StringCmp((char *)(redundant+0x0D),(char *)EccBuf,3))
-        if (_Correct_D_SwECC(buf,redundant+0x0D,EccBuf))
-            return(ERROR);
-
-    buf+=0x100;
-    if (StringCmp((char *)(redundant+0x08),(char *)(EccBuf+0x03),3))
-        if (_Correct_D_SwECC(buf,redundant+0x08,EccBuf+0x03))
-            return(ERROR);
-
-    return(SUCCESS);
+	/* Driver ECC Check */
+	return SUCCESS;
+	if (strncmp((char *)(redundant+0x0D), (char *)EccBuf, 3))
+		if (_Correct_D_SwECC(buf, redundant+0x0D, EccBuf))
+			return ERROR;
+
+	buf += 0x100;
+	if (strncmp((char *)(redundant+0x08), (char *)(EccBuf+0x03), 3))
+		if (_Correct_D_SwECC(buf, redundant+0x08, EccBuf+0x03))
+			return ERROR;
+
+	return SUCCESS;
 }
 
 //----- Check_D_CISdata() ----------------------------------------------
 int Check_D_CISdata(BYTE *buf, BYTE *redundant)
 {
-    BYTE cis[]={0x01,0x03,0xD9,0x01,0xFF,0x18,0x02,0xDF,0x01,0x20};
+	BYTE cis[] = {0x01, 0x03, 0xD9, 0x01, 0xFF, 0x18, 0x02,
+		      0xDF, 0x01, 0x20};
 
-    if (!IsSSFDCCompliance && !IsXDCompliance)
-        return(SUCCESS);             // 目前為強制 SUCCESS [Arnold 02-08-23] SSFDC 測試, 不能強制 SUCCESS
+	if (!IsSSFDCCompliance && !IsXDCompliance)
+		return SUCCESS;
 
-    if (!StringCmp((char *)(redundant+0x0D),(char *)EccBuf,3))
-        return(StringCmp((char *)buf,(char *)cis,10));
+	if (!strncmp((char *)(redundant+0x0D), (char *)EccBuf, 3))
+		return strncmp((char *)buf, (char *)cis, 10);
 
-    if (!_Correct_D_SwECC(buf,redundant+0x0D,EccBuf))
-        return(StringCmp((char *)buf,(char *)cis,10));
+	if (!_Correct_D_SwECC(buf, redundant+0x0D, EccBuf))
+		return strncmp((char *)buf, (char *)cis, 10);
 
-    buf+=0x100;
-    if (!StringCmp((char *)(redundant+0x08),(char *)(EccBuf+0x03),3))
-        return(StringCmp((char *)buf,(char *)cis,10));
+	buf += 0x100;
+	if (!strncmp((char *)(redundant+0x08), (char *)(EccBuf+0x03), 3))
+		return strncmp((char *)buf, (char *)cis, 10);
 
-    if (!_Correct_D_SwECC(buf,redundant+0x08,EccBuf+0x03))
-        return(StringCmp((char *)buf,(char *)cis,10));
+	if (!_Correct_D_SwECC(buf, redundant+0x08, EccBuf+0x03))
+		return strncmp((char *)buf, (char *)cis, 10);
 
-    return(ERROR);
+	return ERROR;
 }
 
 //----- Set_D_RightECC() ----------------------------------------------
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2010-12-31  9:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-31  9:19 Javier Martinez Canillas [this message]
2010-12-31 10:09 ` [PATCH 1/4] staging: keucr: Use strncmp() instead of custom Dan Carpenter

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=1293787164-7056-2-git-send-email-martinez.javier@gmail.com \
    --to=martinez.javier@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.