driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8712: Fix CHECK reported by checkpatch
@ 2019-07-14  0:20 christianluciano.m
  2019-07-15 19:42 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: christianluciano.m @ 2019-07-14  0:20 UTC (permalink / raw)
  To: gregkh, Larry.Finger, florian.c.schilhabel, driverdev-devel,
	christianluciano.m

From: Christian Luciano Moreno <christianluciano.m@gmail.com>

Change local variable name to avoid CamelCase.
Align code to the open parenthesis to fix alignment issues.

Signed-off-by: Christian Luciano Moreno <christianluciano.m@gmail.com>
---
 drivers/staging/rtl8712/rtl8712_efuse.c | 67 ++++++++++++-------------
 1 file changed, 33 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_efuse.c b/drivers/staging/rtl8712/rtl8712_efuse.c
index 00babd011a62..62aad2f7259d 100644
--- a/drivers/staging/rtl8712/rtl8712_efuse.c
+++ b/drivers/staging/rtl8712/rtl8712_efuse.c
@@ -65,7 +65,7 @@ void r8712_efuse_reg_uninit(struct _adapter *padapter)
 
 static u8 efuse_one_byte_read(struct _adapter *padapter, u16 addr, u8 *data)
 {
-	u8 tmpidx = 0, bResult;
+	u8 tmpidx = 0, b_result;
 
 	/* -----------------e-fuse reg ctrl --------------------------------- */
 	r8712_write8(padapter, EFUSE_CTRL + 1, (u8)(addr & 0xFF)); /* address */
@@ -78,17 +78,17 @@ static u8 efuse_one_byte_read(struct _adapter *padapter, u16 addr, u8 *data)
 		tmpidx++;
 	if (tmpidx < 100) {
 		*data = r8712_read8(padapter, EFUSE_CTRL);
-		bResult = true;
+		b_result = true;
 	} else {
 		*data = 0xff;
-		bResult = false;
+		b_result = false;
 	}
-	return bResult;
+	return b_result;
 }
 
 static u8 efuse_one_byte_write(struct _adapter *padapter, u16 addr, u8 data)
 {
-	u8 tmpidx = 0, bResult;
+	u8 tmpidx = 0, b_result;
 
 	/* -----------------e-fuse reg ctrl -------------------------------- */
 	r8712_write8(padapter, EFUSE_CTRL + 1, (u8)(addr & 0xFF)); /* address */
@@ -101,16 +101,16 @@ static u8 efuse_one_byte_write(struct _adapter *padapter, u16 addr, u8 data)
 	       (tmpidx < 100))
 		tmpidx++;
 	if (tmpidx < 100)
-		bResult = true;
+		b_result = true;
 	else
-		bResult = false;
-	return bResult;
+		b_result = false;
+	return b_result;
 }
 
 static u8 efuse_one_byte_rw(struct _adapter *padapter, u8 bRead, u16 addr,
 			    u8 *data)
 {
-	u8 tmpidx = 0, tmpv8 = 0, bResult;
+	u8 tmpidx = 0, tmpv8 = 0, b_result;
 
 	/* -----------------e-fuse reg ctrl --------------------------------- */
 	r8712_write8(padapter, EFUSE_CTRL + 1, (u8)(addr & 0xFF)); /* address */
@@ -124,10 +124,10 @@ static u8 efuse_one_byte_rw(struct _adapter *padapter, u8 bRead, u16 addr,
 			tmpidx++;
 		if (tmpidx < 100) {
 			*data = r8712_read8(padapter, EFUSE_CTRL);
-			bResult = true;
+			b_result = true;
 		} else {
 			*data = 0;
-			bResult = false;
+			b_result = false;
 		}
 	} else {
 		r8712_write8(padapter, EFUSE_CTRL, *data); /* data */
@@ -136,11 +136,11 @@ static u8 efuse_one_byte_rw(struct _adapter *padapter, u8 bRead, u16 addr,
 		       (tmpidx < 100))
 			tmpidx++;
 		if (tmpidx < 100)
-			bResult = true;
+			b_result = true;
 		else
-			bResult = false;
+			b_result = false;
 	}
-	return bResult;
+	return b_result;
 }
 
 static u8 efuse_is_empty(struct _adapter *padapter, u8 *empty)
@@ -208,20 +208,21 @@ static void pgpacket_copy_data(const u8 word_en, const u8 *sourdata,
 
 u16 r8712_efuse_get_current_size(struct _adapter *padapter)
 {
-	int bContinual = true;
+	int b_continual = true;
 	u16 efuse_addr = 0;
 	u8 hworden = 0;
 	u8 efuse_data, word_cnts = 0;
 
-	while (bContinual && efuse_one_byte_read(padapter, efuse_addr,
-	       &efuse_data) && (efuse_addr < efuse_available_max_size)) {
+	while (b_continual &&
+	       efuse_one_byte_read(padapter, efuse_addr, &efuse_data) &&
+	       (efuse_addr < efuse_available_max_size)) {
 		if (efuse_data != 0xFF) {
 			hworden =  efuse_data & 0x0F;
 			word_cnts = calculate_word_cnts(hworden);
 			/* read next header */
 			efuse_addr = efuse_addr + (word_cnts * 2) + 1;
 		} else {
-			bContinual = false;
+			b_continual = false;
 		}
 	}
 	return efuse_addr;
@@ -300,18 +301,16 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
 		for (i = 0; i < PGPKG_MAX_WORDS; i++) {
 			if (BIT(i) & word_en) {
 				if (BIT(i) & pkt.word_en) {
-					if (efuse_one_byte_read(
-							padapter, addr,
-							&value))
+					if (efuse_one_byte_read(padapter,
+								addr,
+								&value))
 						pkt.data[i * 2] = value;
 					else
 						return false;
-					if (efuse_one_byte_read(
-							padapter,
-							addr + 1,
-							&value))
-						pkt.data[i * 2 + 1] =
-							value;
+					if (efuse_one_byte_read(padapter,
+								addr + 1,
+								&value))
+						pkt.data[i * 2 + 1] = value;
 					else
 						return false;
 				}
@@ -360,7 +359,7 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset,
 	u8 efuse_data, target_word_cnts = 0;
 	int repeat_times;
 	int sub_repeat;
-	u8 bResult = true;
+	u8 b_result = true;
 
 	/* check if E-Fuse Clock Enable and E-Fuse Clock is 40M */
 	efuse_data = r8712_read8(padapter, EFUSE_CLK_CTRL);
@@ -382,7 +381,7 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset,
 		while (!efuse_one_byte_read(padapter, efuse_addr,
 					    &efuse_data)) {
 			if (++sub_repeat > _REPEAT_THRESHOLD_) {
-				bResult = false; /* continue to blind write */
+				b_result = false; /* continue to blind write */
 				break; /* continue to blind write */
 			}
 		}
@@ -400,16 +399,16 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset,
 				if (!efuse_one_byte_read(padapter,
 							 efuse_addr + i,
 							 &efuse_data))
-					bResult = false;
+					b_result = false;
 				else if (*(data + i) != efuse_data) /* fail */
-					bResult = false;
+					b_result = false;
 			}
 			break;
 		}
 		/* write header fail */
-		bResult = false;
+		b_result = false;
 		if (efuse_data == 0xFF)
-			return bResult; /* nothing damaged. */
+			return b_result; /* nothing damaged. */
 		/* call rescue procedure */
 		if (!fix_header(padapter, efuse_data, efuse_addr))
 			return false; /* rescue fail */
@@ -418,7 +417,7 @@ u8 r8712_efuse_pg_packet_write(struct _adapter *padapter, const u8 offset,
 			break;
 		/* otherwise, take another risk... */
 	}
-	return bResult;
+	return b_result;
 }
 
 u8 r8712_efuse_access(struct _adapter *padapter, u8 bRead, u16 start_addr,
-- 
2.22.0

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] staging: rtl8712: Fix CHECK reported by checkpatch
  2019-07-14  0:20 [PATCH] staging: rtl8712: Fix CHECK reported by checkpatch christianluciano.m
@ 2019-07-15 19:42 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-07-15 19:42 UTC (permalink / raw)
  To: christianluciano.m; +Cc: florian.c.schilhabel, driverdev-devel, Larry.Finger

On Sat, Jul 13, 2019 at 09:20:05PM -0300, christianluciano.m@gmail.com wrote:
> From: Christian Luciano Moreno <christianluciano.m@gmail.com>
> 
> Change local variable name to avoid CamelCase.
> Align code to the open parenthesis to fix alignment issues.

That is two different things, right?

So it should be 2 patches.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2019-07-15 19:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-14  0:20 [PATCH] staging: rtl8712: Fix CHECK reported by checkpatch christianluciano.m
2019-07-15 19:42 ` Greg KH

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