All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] staging: ft1000: Use common return point.
@ 2011-01-25 11:08 Marek Belisko
  2011-01-25 11:08 ` [PATCH 02/12] staging: ft1000: Remove dead code Marek Belisko
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index 17546d8..696e319 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -127,7 +127,7 @@ static u32 check_usb_db (struct ft1000_device *ft1000dev)
 {
    int               loopcnt;
    u16            temp;
-   u32             status;
+   u32             status, ret_val = HANDSHAKE_MAG_TIMEOUT_VALUE;
 
    loopcnt = 0;
    while (loopcnt < 10)
@@ -166,7 +166,8 @@ static u32 check_usb_db (struct ft1000_device *ft1000dev)
       else
       {
          DEBUG("check_usb_db: door bell is cleared, return 0\n");
-         return 0;
+	ret_val = 0;
+	break;
       }
 #if 0
       // Check if Card is present
@@ -182,7 +183,7 @@ static u32 check_usb_db (struct ft1000_device *ft1000dev)
 #endif
    }
 
-   return HANDSHAKE_MAG_TIMEOUT_VALUE;
+	return ret_val;
 
 }
 
-- 
1.7.1


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

* [PATCH 02/12] staging: ft1000: Remove dead code.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  2011-01-25 11:08 ` [PATCH 03/12] staging: ft1000: Fix coding style Marek Belisko
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Remove code which was under #if 0.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |   63 +-------------------
 1 files changed, 1 insertions(+), 62 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index 696e319..edeabff 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -169,18 +169,6 @@ static u32 check_usb_db (struct ft1000_device *ft1000dev)
 	ret_val = 0;
 	break;
       }
-#if 0
-      // Check if Card is present
-      status = ft1000_read_register (ft1000dev, &temp, FT1000_REG_SUP_IMASK);
-      if (temp == 0x0000) {
-          break;
-      }
-
-      status = ft1000_read_register (ft1000dev, &temp, FT1000_REG_ASIC_ID);
-      if (temp == 0xffff) {
-         break;
-      }
-#endif
    }
 
 	return ret_val;
@@ -447,34 +435,6 @@ static long get_request_value(struct ft1000_device *ft1000dev)
 
 }
 
-#if 0
-static long get_request_value_usb(struct ft1000_device *ft1000dev)
-{
-   u32     value;
-   u16   tempword;
-   u32    status;
-   struct ft1000_info * pft1000info = netdev_priv(ft1000dev->net);
-
-       if (pft1000info->usbboot == 2) {
-          value = pft1000info->tempbuf[4];
-          tempword = pft1000info->tempbuf[5];
-       }
-       else {
-          value = 0;
-          status = ft1000_read_dpram16(ft1000dev, DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 1);
-       }
-
-       value |= (tempword << 16);
-       value = ntohl(value);
-
-   if (pft1000info->usbboot == 1)
-       pft1000info->usbboot = 2;
-
-   //DEBUG("get_request_value_usb: value is %x\n", value);
-   return value;
-
-}
-#endif
 
 //---------------------------------------------------------------------------
 // Function:    put_request_value
@@ -724,22 +684,7 @@ static u32 write_blk_fifo (struct ft1000_device *ft1000dev, u16 **pUsFile, u8 **
    if (byte_length < 64)
        byte_length = 68;
 
-#if 0
-   pblk = kzalloc(byte_length, GFP_KERNEL);
-   memcpy (pblk, *pUcFile, byte_length);
-
-   pipe = usb_sndbulkpipe (ft1000dev->dev, ft1000dev->bulk_out_endpointAddr);
 
-   Status = usb_bulk_msg (ft1000dev->dev,
-                          pipe,
-                          pblk,
-                          byte_length,
-                          &cnt,
-                          10);
-   DEBUG("write_blk_fifo Status = 0x%8x Bytes Transfer = %d Data = 0x%x\n", Status, cnt, *pblk);
-
-   kfree(pblk);
-#else
     usb_init_urb(ft1000dev->tx_urb);
     memcpy (ft1000dev->tx_buf, *pUcFile, byte_length);
     usb_fill_bulk_urb(ft1000dev->tx_urb,
@@ -751,7 +696,6 @@ static u32 write_blk_fifo (struct ft1000_device *ft1000dev, u16 **pUsFile, u8 **
                       (void*)ft1000dev);
 
     usb_submit_urb(ft1000dev->tx_urb, GFP_ATOMIC);
-#endif
 
    *pUsFile = *pUsFile + (word_length << 1);
    *pUcFile = *pUcFile + (word_length << 2);
@@ -1001,15 +945,10 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32  FileLeng
                   status = STATUS_FAILURE;
                   break;
                }
-#if 0
-               word_length = get_request_value_usb(ft1000dev);
-               //DEBUG("FT1000:download:word_length = %d\n", (int)word_length);
-               if (word_length > MAX_LENGTH/2)
-#else
+
                word_length = get_request_value(ft1000dev);
                //DEBUG("FT1000:download:word_length = %d\n", (int)word_length);
                if (word_length > MAX_LENGTH)
-#endif
                {
                   DEBUG("FT1000:download:Download error: Max length exceeded\n");
                   status = STATUS_FAILURE;
-- 
1.7.1


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

* [PATCH 03/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
  2011-01-25 11:08 ` [PATCH 02/12] staging: ft1000: Remove dead code Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  2011-01-25 11:21   ` Greg KH
  2011-01-25 11:08 ` [PATCH 04/12] " Marek Belisko
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Fix coding style in check_usb_db() function.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |   87 +++++++++----------
 1 files changed, 41 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index edeabff..30501f5 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -125,54 +125,49 @@ struct dsp_image_info {
 //---------------------------------------------------------------------------
 static u32 check_usb_db (struct ft1000_device *ft1000dev)
 {
-   int               loopcnt;
-   u16            temp;
-   u32             status, ret_val = HANDSHAKE_MAG_TIMEOUT_VALUE;
-
-   loopcnt = 0;
-   while (loopcnt < 10)
-   {
-
-      status = ft1000_read_register (ft1000dev, &temp, FT1000_REG_DOORBELL);
-      DEBUG("check_usb_db: read FT1000_REG_DOORBELL value is %x\n", temp);
-      if (temp & 0x0080)
-      {
-           DEBUG("FT1000:Got checkusb doorbell\n");
-           status = ft1000_write_register (ft1000dev, 0x0080, FT1000_REG_DOORBELL);
-           status = ft1000_write_register (ft1000dev, 0x0100, FT1000_REG_DOORBELL);
-           status = ft1000_write_register (ft1000dev,  0x8000, FT1000_REG_DOORBELL);
-           break;
-      }
-      else
-      {
-           loopcnt++;
-           msleep (10);
-      }
-
-   } //end of while
-
-
-   loopcnt = 0;
-   while (loopcnt < 20)
-   {
-
-      status = ft1000_read_register (ft1000dev, &temp, FT1000_REG_DOORBELL);
-      DEBUG("FT1000:check_usb_db:Doorbell = 0x%x\n", temp);
-      if (temp & 0x8000)
-      {
-         loopcnt++;
-         msleep (10);
-      }
-      else
-      {
-         DEBUG("check_usb_db: door bell is cleared, return 0\n");
-	ret_val = 0;
-	break;
-      }
-   }
+	int loopcnt;
+	u16 temp;
+	u32 status, ret_val = HANDSHAKE_MAG_TIMEOUT_VALUE;
+
+	loopcnt = 0;
+	while (loopcnt < 10) {
+
+		status = ft1000_read_register(ft1000dev, &temp,
+						FT1000_REG_DOORBELL);
+		DEBUG("check_usb_db: read FT1000_REG_DOORBELL value is %x\n",
+			temp);
+		if (temp & 0x0080) {
+			DEBUG("FT1000:Got checkusb doorbell\n");
+			status = ft1000_write_register(ft1000dev, 0x0080,
+							FT1000_REG_DOORBELL);
+			status = ft1000_write_register(ft1000dev, 0x0100,
+							FT1000_REG_DOORBELL);
+			status = ft1000_write_register(ft1000dev,  0x8000,
+							FT1000_REG_DOORBELL);
+			break;
+		} else {
+			loopcnt++;
+			msleep(10);
+		}
+	}
+
+	loopcnt = 0;
+	while (loopcnt < 20) {
+
+		status = ft1000_read_register(ft1000dev, &temp,
+						FT1000_REG_DOORBELL);
+		DEBUG("FT1000:check_usb_db:Doorbell = 0x%x\n", temp);
+		if (temp & 0x8000) {
+			loopcnt++;
+			msleep(10);
+		} else {
+			DEBUG("check_usb_db: door bell is cleared,return 0\n");
+			ret_val = 0;
+			break;
+		}
+	}
 
 	return ret_val;
-
 }
 
 //---------------------------------------------------------------------------
-- 
1.7.1


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

* [PATCH 04/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
  2011-01-25 11:08 ` [PATCH 02/12] staging: ft1000: Remove dead code Marek Belisko
  2011-01-25 11:08 ` [PATCH 03/12] staging: ft1000: Fix coding style Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  2011-01-25 11:08 ` [PATCH 05/12] " Marek Belisko
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Fix coding style in put_handshake() function.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |   29 ++++++++++---------
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index 30501f5..21b42f9 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -255,20 +255,21 @@ static u16 get_handshake(struct ft1000_device *ft1000dev, u16 expected_value)
 //---------------------------------------------------------------------------
 static void put_handshake(struct ft1000_device *ft1000dev,u16 handshake_value)
 {
-    u32 tempx;
-    u16 tempword;
-    u32 status;
-
-
-
-        tempx = (u32)handshake_value;
-        tempx = ntohl(tempx);
-
-        tempword = (u16)(tempx & 0xffff);
-        status = ft1000_write_dpram16 (ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, tempword, 0);
-        tempword = (u16)(tempx >> 16);
-        status = ft1000_write_dpram16 (ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, tempword, 1);
-        status = ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX, FT1000_REG_DOORBELL);
+	u32 tempx;
+	u16 tempword;
+	u32 status;
+
+	tempx = (u32)handshake_value;
+	tempx = ntohl(tempx);
+
+	tempword = (u16)(tempx & 0xffff);
+	status = ft1000_write_dpram16(ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC,
+					tempword, 0);
+	tempword = (u16)(tempx >> 16);
+	status = ft1000_write_dpram16(ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC,
+					tempword, 1);
+	status = ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX,
+					FT1000_REG_DOORBELL);
 }
 
 static u16 get_handshake_usb(struct ft1000_device *ft1000dev, u16 expected_value)
-- 
1.7.1


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

* [PATCH 05/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
                   ` (2 preceding siblings ...)
  2011-01-25 11:08 ` [PATCH 04/12] " Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  2011-01-25 11:08 ` [PATCH 06/12] " Marek Belisko
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Fix coding style in get_handshake_usb() function.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |   73 +++++++++++---------
 1 files changed, 40 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index 21b42f9..c3f86be 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -274,42 +274,49 @@ static void put_handshake(struct ft1000_device *ft1000dev,u16 handshake_value)
 
 static u16 get_handshake_usb(struct ft1000_device *ft1000dev, u16 expected_value)
 {
-   u16            handshake;
-   int               loopcnt;
-   u16            temp;
-   u32             status=0;
+	u16 handshake, temp;
+	int loopcnt;
+	u32 status = 0;
 
 	struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);
-   loopcnt = 0;
-   handshake = 0;
-   while (loopcnt < 100)
-   {
-       if (pft1000info->usbboot == 2) {
-           status = ft1000_read_dpram32 (ft1000dev, 0, (u8 *)&(pft1000info->tempbuf[0]), 64);
-           for (temp=0; temp<16; temp++)
-               DEBUG("tempbuf %d = 0x%x\n", temp, pft1000info->tempbuf[temp]);
-           status = ft1000_read_dpram16 (ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, (u8 *)&handshake, 1);
-           DEBUG("handshake from read_dpram16 = 0x%x\n", handshake);
-           if (pft1000info->dspalive == pft1000info->tempbuf[6])
-               handshake = 0;
-           else {
-               handshake = pft1000info->tempbuf[1];
-               pft1000info->dspalive = pft1000info->tempbuf[6];
-           }
-       }
-       else {
-           status = ft1000_read_dpram16 (ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, (u8 *)&handshake, 1);
-       }
-       loopcnt++;
-       msleep(10);
-       handshake = ntohs(handshake);
-       if ((handshake == expected_value) || (handshake == HANDSHAKE_RESET_VALUE_USB))
-       {
-           return handshake;
-       }
-   }
+	loopcnt = 0;
+	handshake = 0;
+
+	while (loopcnt < 100) {
+		if (pft1000info->usbboot == 2) {
+			status = ft1000_read_dpram32(ft1000dev, 0,
+					(u8 *)&(pft1000info->tempbuf[0]), 64);
+			for (temp = 0; temp < 16; temp++) {
+				DEBUG("tempbuf %d = 0x%x\n", temp,
+					pft1000info->tempbuf[temp]);
+			}
+			status = ft1000_read_dpram16(ft1000dev,
+						DWNLD_MAG1_HANDSHAKE_LOC,
+						(u8 *)&handshake, 1);
+			DEBUG("handshake from read_dpram16 = 0x%x\n",
+				handshake);
+			if (pft1000info->dspalive == pft1000info->tempbuf[6]) {
+				handshake = 0;
+			} else {
+				handshake = pft1000info->tempbuf[1];
+				pft1000info->dspalive =
+						pft1000info->tempbuf[6];
+			}
+		} else {
+			status = ft1000_read_dpram16(ft1000dev,
+						DWNLD_MAG1_HANDSHAKE_LOC,
+						(u8 *)&handshake, 1);
+		}
 
-   return HANDSHAKE_TIMEOUT_VALUE;
+		loopcnt++;
+		msleep(10);
+		handshake = ntohs(handshake);
+		if ((handshake == expected_value) ||
+		    (handshake == HANDSHAKE_RESET_VALUE_USB))
+			return handshake;
+	}
+
+	return HANDSHAKE_TIMEOUT_VALUE;
 }
 
 static void put_handshake_usb(struct ft1000_device *ft1000dev,u16 handshake_value)
-- 
1.7.1


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

* [PATCH 06/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
                   ` (3 preceding siblings ...)
  2011-01-25 11:08 ` [PATCH 05/12] " Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  2011-01-25 11:08 ` [PATCH 07/12] " Marek Belisko
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Fix conding style in put_handshake_usb() funntion. Probably will be
removed just keep backward compatibility.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index c3f86be..a1d5592 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -321,7 +321,7 @@ static u16 get_handshake_usb(struct ft1000_device *ft1000dev, u16 expected_value
 
 static void put_handshake_usb(struct ft1000_device *ft1000dev,u16 handshake_value)
 {
-   int i;
+	int i;
 
         for (i=0; i<1000; i++);
 }
-- 
1.7.1


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

* [PATCH 07/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
                   ` (4 preceding siblings ...)
  2011-01-25 11:08 ` [PATCH 06/12] " Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  2011-01-25 11:08 ` [PATCH 08/12] " Marek Belisko
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Fix coding style in get_request_type() function.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |   38 +++++++++-----------
 1 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index a1d5592..bf20e64 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -340,30 +340,26 @@ static void put_handshake_usb(struct ft1000_device *ft1000dev,u16 handshake_valu
 //---------------------------------------------------------------------------
 static u16 get_request_type(struct ft1000_device *ft1000dev)
 {
-   u16   request_type;
-   u32    status;
-   u16   tempword;
-   u32    tempx;
+	u16   request_type;
+	u32    status;
+	u16   tempword;
+	u32    tempx;
 	struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);
 
-   if ( pft1000info->bootmode == 1)
-   {
-       status = fix_ft1000_read_dpram32 (ft1000dev, DWNLD_MAG1_TYPE_LOC, (u8 *)&tempx);
-       tempx = ntohl(tempx);
-   }
-   else
-   {
-       tempx = 0;
-
-       status = ft1000_read_dpram16 (ft1000dev, DWNLD_MAG1_TYPE_LOC, (u8 *)&tempword, 1);
-       tempx |= (tempword << 16);
-       tempx = ntohl(tempx);
-   }
-   request_type = (u16)tempx;
-
-   //DEBUG("get_request_type: request_type is %x\n", request_type);
-   return request_type;
+	if (pft1000info->bootmode == 1) {
+		status = fix_ft1000_read_dpram32(ft1000dev,
+				DWNLD_MAG1_TYPE_LOC, (u8 *)&tempx);
+		tempx = ntohl(tempx);
+	} else {
+		tempx = 0;
+		status = ft1000_read_dpram16(ft1000dev,
+				DWNLD_MAG1_TYPE_LOC, (u8 *)&tempword, 1);
+		tempx |= (tempword << 16);
+		tempx = ntohl(tempx);
+	}
+	request_type = (u16)tempx;
 
+	return request_type;
 }
 
 static u16 get_request_type_usb(struct ft1000_device *ft1000dev)
-- 
1.7.1


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

* [PATCH 08/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
                   ` (5 preceding siblings ...)
  2011-01-25 11:08 ` [PATCH 07/12] " Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  2011-01-25 11:08 ` [PATCH 09/12] " Marek Belisko
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Fix coding style for get_request_type_usb() function.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |   48 +++++++++----------
 1 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index bf20e64..3b56661 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -364,34 +364,32 @@ static u16 get_request_type(struct ft1000_device *ft1000dev)
 
 static u16 get_request_type_usb(struct ft1000_device *ft1000dev)
 {
-   u16   request_type;
-   u32    status;
-   u16   tempword;
-   u32    tempx;
+	u16   request_type;
+	u32    status;
+	u16   tempword;
+	u32    tempx;
 	struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);
-   if ( pft1000info->bootmode == 1)
-   {
-       status = fix_ft1000_read_dpram32 (ft1000dev, DWNLD_MAG1_TYPE_LOC, (u8 *)&tempx);
-       tempx = ntohl(tempx);
-   }
-   else
-   {
-       if (pft1000info->usbboot == 2) {
-          tempx = pft1000info->tempbuf[2];
-          tempword = pft1000info->tempbuf[3];
-       }
-       else {
-          tempx = 0;
-          status = ft1000_read_dpram16 (ft1000dev, DWNLD_MAG1_TYPE_LOC, (u8 *)&tempword, 1);
-       }
-       tempx |= (tempword << 16);
-       tempx = ntohl(tempx);
-   }
-   request_type = (u16)tempx;
 
-   //DEBUG("get_request_type: request_type is %x\n", request_type);
-   return request_type;
+	if (pft1000info->bootmode == 1) {
+		status = fix_ft1000_read_dpram32(ft1000dev,
+				DWNLD_MAG1_TYPE_LOC, (u8 *)&tempx);
+		tempx = ntohl(tempx);
+	} else {
+		if (pft1000info->usbboot == 2) {
+			tempx = pft1000info->tempbuf[2];
+			tempword = pft1000info->tempbuf[3];
+		} else {
+			tempx = 0;
+			status = ft1000_read_dpram16(ft1000dev,
+					DWNLD_MAG1_TYPE_LOC,
+					(u8 *)&tempword, 1);
+		}
+		tempx |= (tempword << 16);
+		tempx = ntohl(tempx);
+	}
+	request_type = (u16)tempx;
 
+	return request_type;
 }
 
 //---------------------------------------------------------------------------
-- 
1.7.1


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

* [PATCH 09/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
                   ` (6 preceding siblings ...)
  2011-01-25 11:08 ` [PATCH 08/12] " Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  2011-01-25 11:08 ` [PATCH 10/12] " Marek Belisko
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Fix coding style for get_request_value() function.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |   37 +++++++++-----------
 1 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index 3b56661..a5dca6c 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -406,30 +406,27 @@ static u16 get_request_type_usb(struct ft1000_device *ft1000dev)
 //---------------------------------------------------------------------------
 static long get_request_value(struct ft1000_device *ft1000dev)
 {
-   u32     value;
-   u16   tempword;
-   u32    status;
+	u32     value;
+	u16   tempword;
+	u32    status;
 	struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);
 
 
-       if ( pft1000info->bootmode == 1)
-       {
-	   status = fix_ft1000_read_dpram32(ft1000dev, DWNLD_MAG1_SIZE_LOC, (u8 *)&value);
-	   value = ntohl(value);
-       }
-       else
-       {
-	   status = ft1000_read_dpram16(ft1000dev, DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 0);
-	   value = tempword;
-           status = ft1000_read_dpram16(ft1000dev, DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 1);
-	   value |= (tempword << 16);
-	   value = ntohl(value);
-       }
-
-
-   //DEBUG("get_request_value: value is %x\n", value);
-   return value;
+	if (pft1000info->bootmode == 1) {
+		status = fix_ft1000_read_dpram32(ft1000dev,
+				DWNLD_MAG1_SIZE_LOC, (u8 *)&value);
+		value = ntohl(value);
+	} else	{
+		status = ft1000_read_dpram16(ft1000dev,
+				DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 0);
+		value = tempword;
+		status = ft1000_read_dpram16(ft1000dev,
+				DWNLD_MAG1_SIZE_LOC, (u8 *)&tempword, 1);
+		value |= (tempword << 16);
+		value = ntohl(value);
+	}
 
+	return value;
 }
 
 
-- 
1.7.1


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

* [PATCH 10/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
                   ` (7 preceding siblings ...)
  2011-01-25 11:08 ` [PATCH 09/12] " Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  2011-01-25 11:08 ` [PATCH 11/12] " Marek Belisko
  2011-01-25 11:08 ` [PATCH 12/12] " Marek Belisko
  10 siblings, 0 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Fix coding style for put_request_value() function.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index a5dca6c..3c02144 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -445,16 +445,12 @@ static long get_request_value(struct ft1000_device *ft1000dev)
 //---------------------------------------------------------------------------
 static void put_request_value(struct ft1000_device *ft1000dev, long lvalue)
 {
-   u32    tempx;
-   u32    status;
-
-       tempx = ntohl(lvalue);
-       status = fix_ft1000_write_dpram32(ft1000dev, DWNLD_MAG1_SIZE_LOC, (u8 *)&tempx);
-
-
-
-   //DEBUG("put_request_value: value is %x\n", lvalue);
+	u32    tempx;
+	u32    status;
 
+	tempx = ntohl(lvalue);
+	status = fix_ft1000_write_dpram32(ft1000dev, DWNLD_MAG1_SIZE_LOC,
+					  (u8 *)&tempx);
 }
 
 
-- 
1.7.1


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

* [PATCH 11/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
                   ` (8 preceding siblings ...)
  2011-01-25 11:08 ` [PATCH 10/12] " Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  2011-01-25 11:08 ` [PATCH 12/12] " Marek Belisko
  10 siblings, 0 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Fix coding style for hdr_checksum() checksum.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index 3c02144..596c923 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -469,14 +469,14 @@ static void put_request_value(struct ft1000_device *ft1000dev, long lvalue)
 //---------------------------------------------------------------------------
 static u16 hdr_checksum(struct pseudo_hdr *pHdr)
 {
-   u16   *usPtr = (u16 *)pHdr;
-   u16   chksum;
+	u16   *usPtr = (u16 *)pHdr;
+	u16   chksum;
 
 
-  chksum = ((((((usPtr[0] ^ usPtr[1]) ^ usPtr[2]) ^ usPtr[3]) ^
-                    usPtr[4]) ^ usPtr[5]) ^ usPtr[6]);
+	chksum = ((((((usPtr[0] ^ usPtr[1]) ^ usPtr[2]) ^ usPtr[3]) ^
+	usPtr[4]) ^ usPtr[5]) ^ usPtr[6]);
 
-  return chksum;
+	return chksum;
 }
 
 
-- 
1.7.1


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

* [PATCH 12/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
                   ` (9 preceding siblings ...)
  2011-01-25 11:08 ` [PATCH 11/12] " Marek Belisko
@ 2011-01-25 11:08 ` Marek Belisko
  10 siblings, 0 replies; 13+ messages in thread
From: Marek Belisko @ 2011-01-25 11:08 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Marek Belisko

Fix coding style for get_handshake() function.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 .../staging/ft1000/ft1000-usb/ft1000_download.c    |   90 +++++++++-----------
 1 files changed, 41 insertions(+), 49 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
index 596c923..700a206 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -186,57 +186,49 @@ static u32 check_usb_db (struct ft1000_device *ft1000dev)
 //---------------------------------------------------------------------------
 static u16 get_handshake(struct ft1000_device *ft1000dev, u16 expected_value)
 {
-   u16            handshake;
-   int               loopcnt;
-   u32             status=0;
+	u16 handshake;
+	int loopcnt;
+	u32 status = 0;
 	struct ft1000_info *pft1000info = netdev_priv(ft1000dev->net);
 
-   loopcnt = 0;
-   while (loopcnt < 100)
-   {
+	loopcnt = 0;
 
-           // Need to clear downloader doorbell if Hartley ASIC
-           status = ft1000_write_register (ft1000dev,  FT1000_DB_DNLD_RX, FT1000_REG_DOORBELL);
-           //DEBUG("FT1000:get_handshake:doorbell = 0x%x\n", temp);
-               if (pft1000info->fcodeldr)
-               {
-                   DEBUG(" get_handshake: fcodeldr is %d\n", pft1000info->fcodeldr);
-                   pft1000info->fcodeldr = 0;
-                   status = check_usb_db(ft1000dev);
-                   if (status != STATUS_SUCCESS)
-                   {
-                       DEBUG("get_handshake: check_usb_db failed\n");
-                       status = STATUS_FAILURE;
-                       break;
-                   }
-                   status = ft1000_write_register (ft1000dev,  FT1000_DB_DNLD_RX, FT1000_REG_DOORBELL);
-               }
+	while (loopcnt < 100) {
+		/* Need to clear downloader doorbell if Hartley ASIC */
+		status = ft1000_write_register(ft1000dev,  FT1000_DB_DNLD_RX,
+						FT1000_REG_DOORBELL);
+		if (pft1000info->fcodeldr) {
+			DEBUG(" get_handshake: fcodeldr is %d\n",
+				pft1000info->fcodeldr);
+			pft1000info->fcodeldr = 0;
+			status = check_usb_db(ft1000dev);
+			if (status != STATUS_SUCCESS) {
+				DEBUG("get_handshake: check_usb_db failed\n");
+				status = STATUS_FAILURE;
+				break;
+			}
+			status = ft1000_write_register(ft1000dev,
+					FT1000_DB_DNLD_RX,
+					FT1000_REG_DOORBELL);
+		}
 
-                status = ft1000_read_dpram16 (ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, (u8 *)&handshake, 1);
-                //DEBUG("get_handshake: handshake is %x\n", tempx);
-                handshake = ntohs(handshake);
-                //DEBUG("get_handshake: after swap, handshake is %x\n", handshake);
-
-        if (status)
-           return HANDSHAKE_TIMEOUT_VALUE;
-
-        //DEBUG("get_handshake: handshake= %x\n", handshake);
-        if ((handshake == expected_value) || (handshake == HANDSHAKE_RESET_VALUE_USB))
-        {
-            //DEBUG("get_handshake: return handshake %x\n", handshake);
-            return handshake;
-        }
-        else
-        {
-            loopcnt++;
-            msleep (10);
-        }
-        //DEBUG("HANDSHKE LOOP: %d\n", loopcnt);
+		status = ft1000_read_dpram16(ft1000dev,
+				DWNLD_MAG1_HANDSHAKE_LOC, (u8 *)&handshake, 1);
+		handshake = ntohs(handshake);
 
-   }
+		if (status)
+			return HANDSHAKE_TIMEOUT_VALUE;
 
-   //DEBUG("get_handshake: return handshake time out\n");
-   return HANDSHAKE_TIMEOUT_VALUE;
+		if ((handshake == expected_value) ||
+		    (handshake == HANDSHAKE_RESET_VALUE_USB)) {
+			return handshake;
+		} else	{
+			loopcnt++;
+			msleep(10);
+		}
+	}
+
+	return HANDSHAKE_TIMEOUT_VALUE;
 }
 
 //---------------------------------------------------------------------------
-- 
1.7.1


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

* Re: [PATCH 03/12] staging: ft1000: Fix coding style.
  2011-01-25 11:08 ` [PATCH 03/12] staging: ft1000: Fix coding style Marek Belisko
@ 2011-01-25 11:21   ` Greg KH
  0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2011-01-25 11:21 UTC (permalink / raw)
  To: Marek Belisko; +Cc: devel, linux-kernel

On Tue, Jan 25, 2011 at 12:08:08PM +0100, Marek Belisko wrote:

You just sent me 11 patches with the same identical Subject line.
Please don't do that.

> Fix coding style in check_usb_db() function.

Now that's a line that could be in the Subject that might make it
unique.

Please redo these 12 patches and resend them.

thanks,

greg k-h

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

end of thread, other threads:[~2011-01-25 11:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 11:08 [PATCH 01/12] staging: ft1000: Use common return point Marek Belisko
2011-01-25 11:08 ` [PATCH 02/12] staging: ft1000: Remove dead code Marek Belisko
2011-01-25 11:08 ` [PATCH 03/12] staging: ft1000: Fix coding style Marek Belisko
2011-01-25 11:21   ` Greg KH
2011-01-25 11:08 ` [PATCH 04/12] " Marek Belisko
2011-01-25 11:08 ` [PATCH 05/12] " Marek Belisko
2011-01-25 11:08 ` [PATCH 06/12] " Marek Belisko
2011-01-25 11:08 ` [PATCH 07/12] " Marek Belisko
2011-01-25 11:08 ` [PATCH 08/12] " Marek Belisko
2011-01-25 11:08 ` [PATCH 09/12] " Marek Belisko
2011-01-25 11:08 ` [PATCH 10/12] " Marek Belisko
2011-01-25 11:08 ` [PATCH 11/12] " Marek Belisko
2011-01-25 11:08 ` [PATCH 12/12] " Marek Belisko

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.