Re: [PATCH 5/5] staging: r8712u: Merging Realtek's latest (v2.6.6). Various fixes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/23/2011 12:42 PM, Ali Bahar wrote:

On Tue, Aug 23, 2011 at 11:37:21AM -0500, Larry Finger wrote:
On 08/23/2011 12:53 AM, Ali Bahar wrote:
Merged the changes from Realtek's v2.6.6.0.20110401 release.
Its Release Notes listed the fixes, though not all may have been
merged into this commit. They include:



diff --git a/drivers/staging/rtl8712/rtl8712_efuse.c b/drivers/staging/rtl8712/rtl8712_efuse.c
index 1dc12b7..8f81d51 100644
--- a/drivers/staging/rtl8712/rtl8712_efuse.c
+++ b/drivers/staging/rtl8712/rtl8712_efuse.c
@@ -302,55 +302,70 @@ static u8 fix_header(struct _adapter *padapter, u8 header, u16 header_addr)
  		}
  		offset = GET_EFUSE_OFFSET(value);
  		word_en = GET_EFUSE_WORD_EN(value);
-		if (pkt.offset != offset) {
+		if (pkt.offset == offset) {
+			for (i = 0; i<   PGPKG_MAX_WORDS; i++) {
+				if (BIT(i)&   word_en) {
+					if (BIT(i)&   pkt.word_en) {

The two if statements above should be collapsed into

if ((BIT(i)&   word_en)&&  (BIT(i)&   pkt.word_en)) {

OK.



That will get rid of one level on indentation. It still gets a lot
on indentation, but probably not worth refactoring.

The '&&' does not save any indentation.

Yes it does. Compare

	if (a) {
		if (b) {
			stuff;
		}
	}

with

	if (a && b) {
		stuff
	}

Of course, it only works if both if statements do not have an else clause, but that is the case here.

Larry

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


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux