2012-10-12 16:37:40

by Adil Mujeeb

[permalink] [raw]
Subject: [PATCH 0/9] Staging: winbond: Fixed coding style issues


winbond directory files have lots of coding style issues. The patch set tries to remove *most* (if not all) of the coding style issues. checkpatch.pl script is still complaining (like 80 characters limit) but major part of the serious coding style issues have been rectified.


2012-10-12 16:37:49

by Adil Mujeeb

[permalink] [raw]
Subject: [PATCH 1/9] Staging: winbond: wbusb: Fixed coding style issue

Removed unnecessary printk and pr_debug tracing calls

Signed-off-by: Adil Mujeeb <[email protected]>
---
linux-3.6-rc7/drivers/staging/winbond/wbusb.c | 14 --------------
1 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/linux-3.6-rc7/drivers/staging/winbond/wbusb.c b/linux-3.6-rc7/drivers/staging/winbond/wbusb.c
index 0ca857a..a0497ea 100644
--- a/linux-3.6-rc7/drivers/staging/winbond/wbusb.c
+++ b/linux-3.6-rc7/drivers/staging/winbond/wbusb.c
@@ -79,18 +79,15 @@ static int wbsoft_add_interface(struct ieee80211_hw *dev,
static void wbsoft_remove_interface(struct ieee80211_hw *dev,
struct ieee80211_vif *vif)
{
- printk("wbsoft_remove interface called\n");
}

static void wbsoft_stop(struct ieee80211_hw *hw)
{
- printk(KERN_INFO "%s called\n", __func__);
}

static int wbsoft_get_stats(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats)
{
- printk(KERN_INFO "%s called\n", __func__);
return 0;
}

@@ -177,12 +174,9 @@ static void hal_set_current_channel_ex(struct hw_data *pHwData, struct chan_info
if (pHwData->SurpriseRemove)
return;

- printk("Going to channel: %d/%d\n", channel.band, channel.ChanNo);
-
RFSynthesizer_SwitchingChannel(pHwData, channel); /* Switch channel */
pHwData->Channel = channel.ChanNo;
pHwData->band = channel.band;
- pr_debug("Set channel is %d, band =%d\n", pHwData->Channel, pHwData->band);
reg->M28_MacControl &= ~0xff; /* Clean channel information field */
reg->M28_MacControl |= channel.ChanNo;
Wb35Reg_WriteWithCallbackValue(pHwData, 0x0828, reg->M28_MacControl,
@@ -262,8 +256,6 @@ static int wbsoft_config(struct ieee80211_hw *dev, u32 changed)
struct wbsoft_priv *priv = dev->priv;
struct chan_info ch;

- printk("wbsoft_config called\n");
-
/* Should use channel_num, or something, as that is already pre-translated */
ch.band = 1;
ch.ChanNo = 1;
@@ -280,7 +272,6 @@ static int wbsoft_config(struct ieee80211_hw *dev, u32 changed)

static u64 wbsoft_get_tsf(struct ieee80211_hw *dev, struct ieee80211_vif *vif)
{
- printk("wbsoft_get_tsf called\n");
return 0;
}

@@ -714,7 +705,6 @@ static int wb35_hw_init(struct ieee80211_hw *hw)
}

priv->sLocalPara.bAntennaNo = hal_get_antenna_number(pHwData);
- pr_debug("Driver init, antenna no = %d\n", priv->sLocalPara.bAntennaNo);
hal_get_hw_radio_off(pHwData);

/* Waiting for HAL setting OK */
@@ -780,9 +770,6 @@ static int wb35_probe(struct usb_interface *intf,
interface = intf->cur_altsetting;
endpoint = &interface->endpoint[0].desc;

- if (endpoint[2].wMaxPacketSize == 512)
- printk("[w35und] Working on USB 2.0\n");
-
err = wb35_hw_init(dev);
if (err)
goto error_free_hw;
@@ -834,7 +821,6 @@ static void wb35_hw_halt(struct wbsoft_priv *adapter)
{
/* Turn off Rx and Tx hardware ability */
hal_stop(&adapter->sHwData);
- pr_debug("[w35und] Hal_stop O.K.\n");
/* Waiting Irp completed */
msleep(100);

--
1.7.7.3

2012-10-12 16:37:58

by Adil Mujeeb

[permalink] [raw]
Subject: [PATCH 2/9] Staging: winbond: phy_calibration: Fixed coding style issue

Removed checkpatch.pl script reported ERRORs

Signed-off-by: Adil Mujeeb <[email protected]>
---
.../drivers/staging/winbond/phy_calibration.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-3.6-rc7/drivers/staging/winbond/phy_calibration.c b/linux-3.6-rc7/drivers/staging/winbond/phy_calibration.c
index 77a3fff..b881980 100644
--- a/linux-3.6-rc7/drivers/staging/winbond/phy_calibration.c
+++ b/linux-3.6-rc7/drivers/staging/winbond/phy_calibration.c
@@ -22,7 +22,7 @@
#define LOOP_TIMES 20
#define US 1000/* MICROSECOND*/

-#define AG_CONST 0.6072529350
+#define AG_CONST (0.6072529350)
#define FIXED(X) ((s32)((X) * 32768.0))
#define DEG2RAD(X) (0.017453 * (X))

@@ -296,7 +296,7 @@ void _sin_cos(s32 angle, s32 *sin, s32 *cos)
}
}

-static unsigned char hal_get_dxx_reg(struct hw_data *pHwData, u16 number, u32 * pValue)
+static unsigned char hal_get_dxx_reg(struct hw_data *pHwData, u16 number, u32 *pValue)
{
if (number < 0x1000)
number += 0x1000;
--
1.7.7.3

2012-10-12 16:38:08

by Adil Mujeeb

[permalink] [raw]
Subject: [PATCH 3/9] Staging: winbond: mds: Fixed coding style issues

Removed printk tracing call

Signed-off-by: Adil Mujeeb <[email protected]>
---
linux-3.6-rc7/drivers/staging/winbond/mds.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/linux-3.6-rc7/drivers/staging/winbond/mds.c b/linux-3.6-rc7/drivers/staging/winbond/mds.c
index c9f0e8f..d76172e 100644
--- a/linux-3.6-rc7/drivers/staging/winbond/mds.c
+++ b/linux-3.6-rc7/drivers/staging/winbond/mds.c
@@ -476,11 +476,8 @@ Mds_Tx(struct wbsoft_priv *adapter)
/* 931130.5.b */
FragmentCount = PacketSize/FragmentThreshold + 1;
stmp = PacketSize + FragmentCount*32 + 8; /* 931130.5.c 8:MIC */
- if ((XmitBufSize + stmp) >= MAX_USB_TX_BUFFER) {
- printk("[Mds_Tx] Excess max tx buffer.\n");
+ if ((XmitBufSize + stmp) >= MAX_USB_TX_BUFFER)
break; /* buffer is not enough */
- }
-

/*
* Start transmitting
--
1.7.7.3

2012-10-12 16:38:14

by Adil Mujeeb

[permalink] [raw]
Subject: [PATCH 4/9] Staging: winbond: sem_api: Fixed coding style issue

Fixed checkpatch.pl reported ERROR

Signed-off-by: Adil Mujeeb <[email protected]>
---
linux-3.6-rc7/drivers/staging/winbond/sme_api.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/linux-3.6-rc7/drivers/staging/winbond/sme_api.h b/linux-3.6-rc7/drivers/staging/winbond/sme_api.h
index 8f4596c..47b7238 100644
--- a/linux-3.6-rc7/drivers/staging/winbond/sme_api.h
+++ b/linux-3.6-rc7/drivers/staging/winbond/sme_api.h
@@ -138,7 +138,7 @@ s8 sme_set_txrate_policy(void *pcore_data, u8 policy);
s8 sme_get_txrate_policy(void *pcore_data, u8 *policy);
s8 sme_get_cwmin_value(void *pcore_data, u8 *cwmin);
s8 sme_get_cwmax_value(void *pcore_data, u16 *cwmax);
-s8 sme_get_ms_radio_mode(void *pcore_data, u8 * pMsRadioOff);
+s8 sme_get_ms_radio_mode(void *pcore_data, u8 *pMsRadioOff);
s8 sme_set_ms_radio_mode(void *pcore_data, u8 boMsRadioOff);

void sme_get_tx_power_level(void *pcore_data, u32 *TxPower);
--
1.7.7.3

2012-10-12 16:38:24

by Adil Mujeeb

[permalink] [raw]
Subject: [PATCH 5/9] Staging: winbond: wb35reg: Fixed coding style issues

Fixed some of checkpatch.pl reported ERRORs and WARNING of similar types:
1. trailing statements should be on next line
2. no spaces at the start of a line

Signed-off-by: Adil Mujeeb <[email protected]>
---
linux-3.6-rc7/drivers/staging/winbond/wb35reg.c | 142 +++++++++++++++++------
1 files changed, 106 insertions(+), 36 deletions(-)

diff --git a/linux-3.6-rc7/drivers/staging/winbond/wb35reg.c b/linux-3.6-rc7/drivers/staging/winbond/wb35reg.c
index da595f1..476f4db 100644
--- a/linux-3.6-rc7/drivers/staging/winbond/wb35reg.c
+++ b/linux-3.6-rc7/drivers/staging/winbond/wb35reg.c
@@ -69,48 +69,118 @@ unsigned char Wb35Reg_BurstWrite(struct hw_data *pHwData, u16 RegisterNo, u32 *p
kfree(reg_queue);
return false;
}
- return false;
+ return false;
}

void Wb35Reg_Update(struct hw_data *pHwData, u16 RegisterNo, u32 RegisterValue)
{
struct wb35_reg *reg = &pHwData->reg;
switch (RegisterNo) {
- case 0x3b0: reg->U1B0 = RegisterValue; break;
- case 0x3bc: reg->U1BC_LEDConfigure = RegisterValue; break;
- case 0x400: reg->D00_DmaControl = RegisterValue; break;
- case 0x800: reg->M00_MacControl = RegisterValue; break;
- case 0x804: reg->M04_MulticastAddress1 = RegisterValue; break;
- case 0x808: reg->M08_MulticastAddress2 = RegisterValue; break;
- case 0x824: reg->M24_MacControl = RegisterValue; break;
- case 0x828: reg->M28_MacControl = RegisterValue; break;
- case 0x82c: reg->M2C_MacControl = RegisterValue; break;
- case 0x838: reg->M38_MacControl = RegisterValue; break;
- case 0x840: reg->M40_MacControl = RegisterValue; break;
- case 0x844: reg->M44_MacControl = RegisterValue; break;
- case 0x848: reg->M48_MacControl = RegisterValue; break;
- case 0x84c: reg->M4C_MacStatus = RegisterValue; break;
- case 0x860: reg->M60_MacControl = RegisterValue; break;
- case 0x868: reg->M68_MacControl = RegisterValue; break;
- case 0x870: reg->M70_MacControl = RegisterValue; break;
- case 0x874: reg->M74_MacControl = RegisterValue; break;
- case 0x878: reg->M78_ERPInformation = RegisterValue; break;
- case 0x87C: reg->M7C_MacControl = RegisterValue; break;
- case 0x880: reg->M80_MacControl = RegisterValue; break;
- case 0x884: reg->M84_MacControl = RegisterValue; break;
- case 0x888: reg->M88_MacControl = RegisterValue; break;
- case 0x898: reg->M98_MacControl = RegisterValue; break;
- case 0x100c: reg->BB0C = RegisterValue; break;
- case 0x102c: reg->BB2C = RegisterValue; break;
- case 0x1030: reg->BB30 = RegisterValue; break;
- case 0x103c: reg->BB3C = RegisterValue; break;
- case 0x1048: reg->BB48 = RegisterValue; break;
- case 0x104c: reg->BB4C = RegisterValue; break;
- case 0x1050: reg->BB50 = RegisterValue; break;
- case 0x1054: reg->BB54 = RegisterValue; break;
- case 0x1058: reg->BB58 = RegisterValue; break;
- case 0x105c: reg->BB5C = RegisterValue; break;
- case 0x1060: reg->BB60 = RegisterValue; break;
+ case 0x3b0:
+ reg->U1B0 = RegisterValue;
+ break;
+ case 0x3bc:
+ reg->U1BC_LEDConfigure = RegisterValue;
+ break;
+ case 0x400:
+ reg->D00_DmaControl = RegisterValue;
+ break;
+ case 0x800:
+ reg->M00_MacControl = RegisterValue;
+ break;
+ case 0x804:
+ reg->M04_MulticastAddress1 = RegisterValue;
+ break;
+ case 0x808:
+ reg->M08_MulticastAddress2 = RegisterValue;
+ break;
+ case 0x824:
+ reg->M24_MacControl = RegisterValue;
+ break;
+ case 0x828:
+ reg->M28_MacControl = RegisterValue;
+ break;
+ case 0x82c:
+ reg->M2C_MacControl = RegisterValue;
+ break;
+ case 0x838:
+ reg->M38_MacControl = RegisterValue;
+ break;
+ case 0x840:
+ reg->M40_MacControl = RegisterValue;
+ break;
+ case 0x844:
+ reg->M44_MacControl = RegisterValue;
+ break;
+ case 0x848:
+ reg->M48_MacControl = RegisterValue;
+ break;
+ case 0x84c:
+ reg->M4C_MacStatus = RegisterValue;
+ break;
+ case 0x860:
+ reg->M60_MacControl = RegisterValue;
+ break;
+ case 0x868:
+ reg->M68_MacControl = RegisterValue;
+ break;
+ case 0x870:
+ reg->M70_MacControl = RegisterValue;
+ break;
+ case 0x874:
+ reg->M74_MacControl = RegisterValue;
+ break;
+ case 0x878:
+ reg->M78_ERPInformation = RegisterValue;
+ break;
+ case 0x87C:
+ reg->M7C_MacControl = RegisterValue;
+ break;
+ case 0x880:
+ reg->M80_MacControl = RegisterValue;
+ break;
+ case 0x884:
+ reg->M84_MacControl = RegisterValue;
+ break;
+ case 0x888:
+ reg->M88_MacControl = RegisterValue;
+ break;
+ case 0x898:
+ reg->M98_MacControl = RegisterValue;
+ break;
+ case 0x100c:
+ reg->BB0C = RegisterValue;
+ break;
+ case 0x102c:
+ reg->BB2C = RegisterValue;
+ break;
+ case 0x1030:
+ reg->BB30 = RegisterValue;
+ break;
+ case 0x103c:
+ reg->BB3C = RegisterValue;
+ break;
+ case 0x1048:
+ reg->BB48 = RegisterValue;
+ break;
+ case 0x104c:
+ reg->BB4C = RegisterValue;
+ break;
+ case 0x1050:
+ reg->BB50 = RegisterValue;
+ break;
+ case 0x1054:
+ reg->BB54 = RegisterValue;
+ break;
+ case 0x1058:
+ reg->BB58 = RegisterValue;
+ break;
+ case 0x105c:
+ reg->BB5C = RegisterValue;
+ break;
+ case 0x1060:
+ reg->BB60 = RegisterValue;
+ break;
}
}

--
1.7.7.3

2012-10-12 16:38:33

by Adil Mujeeb

[permalink] [raw]
Subject: [PATCH 6/9] Staging: winbond: wb35rx_f: Fixed coding style issues

Fixed checkpatch.pl reported ERRORs

Signed-off-by: Adil Mujeeb <[email protected]>
---
linux-3.6-rc7/drivers/staging/winbond/wb35rx_f.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/linux-3.6-rc7/drivers/staging/winbond/wb35rx_f.h b/linux-3.6-rc7/drivers/staging/winbond/wb35rx_f.h
index 1fdf65e..559bdca 100644
--- a/linux-3.6-rc7/drivers/staging/winbond/wb35rx_f.h
+++ b/linux-3.6-rc7/drivers/staging/winbond/wb35rx_f.h
@@ -4,12 +4,12 @@
#include <net/mac80211.h>
#include "wbhal.h"

-//====================================
-// Interface function declare
-//====================================
-unsigned char Wb35Rx_initial( struct hw_data * pHwData );
-void Wb35Rx_destroy( struct hw_data * pHwData );
-void Wb35Rx_stop( struct hw_data * pHwData );
+/*
+ * Interface function declaration
+ */
+unsigned char Wb35Rx_initial(struct hw_data *pHwData);
+void Wb35Rx_destroy(struct hw_data *pHwData);
+void Wb35Rx_stop(struct hw_data *pHwData);
void Wb35Rx_start(struct ieee80211_hw *hw);

#endif
--
1.7.7.3

2012-10-12 16:38:40

by Adil Mujeeb

[permalink] [raw]
Subject: [PATCH 7/9] Staging: winbond: wb35rx_s: Fixed coding style issue

Fixed checpatch.pl reported ERRORs (excluding WARNING of line over 80 characters)

Signed-off-by: Adil Mujeeb <[email protected]>
---
linux-3.6-rc7/drivers/staging/winbond/wb35rx_s.h | 62 +++++++++++-----------
1 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/linux-3.6-rc7/drivers/staging/winbond/wb35rx_s.h b/linux-3.6-rc7/drivers/staging/winbond/wb35rx_s.h
index 4b03274..545bc95 100644
--- a/linux-3.6-rc7/drivers/staging/winbond/wb35rx_s.h
+++ b/linux-3.6-rc7/drivers/staging/winbond/wb35rx_s.h
@@ -1,44 +1,44 @@
-//============================================================================
-// wb35rx.h --
-//============================================================================
+#ifndef __WINBOND_35RX_S_H
+#define __WINBOND_35RX_S_H

-// Definition for this module used
-#define MAX_USB_RX_BUFFER 4096 // This parameter must be 4096 931130.4.f
+/* Definition for this module used */
+#define MAX_USB_RX_BUFFER 4096 /* This parameter must be 4096 931130.4.f */
+#define MAX_USB_RX_BUFFER_NUMBER ETHERNET_RX_DESCRIPTORS /* Maximum 254, 255 is RESERVED ID */
+#define RX_INTERFACE 0 /* Interface 1 */
+#define RX_PIPE 2 /* Pipe 3 */
+#define MAX_PACKET_SIZE 1600 /* 1568 = 8 + 1532 + 4 + 24(IV EIV MIC ICV CRC) for check DMA data 931130.4.g */
+#define RX_END_TAG 0x0badbeef

-#define MAX_USB_RX_BUFFER_NUMBER ETHERNET_RX_DESCRIPTORS // Maximum 254, 255 is RESERVED ID
-#define RX_INTERFACE 0 // Interface 1
-#define RX_PIPE 2 // Pipe 3
-#define MAX_PACKET_SIZE 1600 //1568 // 8 + 1532 + 4 + 24(IV EIV MIC ICV CRC) for check DMA data 931130.4.g
-#define RX_END_TAG 0x0badbeef

-
-//====================================
-// Internal variable for module
-//====================================
+/*
+ * Internal variable for module
+ */
struct wb35_rx {
- u32 ByteReceived;// For calculating throughput of BulkIn
- atomic_t RxFireCounter;// Does Wb35Rx module fire?
+ u32 ByteReceived; /* For calculating throughput of BulkIn */
+ atomic_t RxFireCounter;/* Does Wb35Rx module fire? */

- u8 RxBuffer[ MAX_USB_RX_BUFFER_NUMBER ][ ((MAX_USB_RX_BUFFER+3) & ~0x03 ) ];
- u16 RxBufferSize[ ((MAX_USB_RX_BUFFER_NUMBER+1) & ~0x01) ];
- u8 RxOwner[ ((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03 ) ];//Ownership of buffer 0: SW 1:HW
+ u8 RxBuffer[MAX_USB_RX_BUFFER_NUMBER][((MAX_USB_RX_BUFFER+3) & ~0x03)];
+ u16 RxBufferSize[((MAX_USB_RX_BUFFER_NUMBER+1) & ~0x01)];
+ u8 RxOwner[((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03)]; /* Ownership of buffer 0:SW 1:HW */

- u32 RxProcessIndex;//The next index to process
- u32 RxBufferId;
- u32 EP3vm_state;
+ u32 RxProcessIndex; /* The next index to process */
+ u32 RxBufferId;
+ u32 EP3vm_state;

- u32 rx_halt; // For VM stopping
+ u32 rx_halt; /* For VM stopping */

- u16 MoreDataSize;
- u16 PacketSize;
+ u16 MoreDataSize;
+ u16 PacketSize;

- u32 CurrentRxBufferId; // For complete routine usage
- u32 Rx3UrbCancel;
+ u32 CurrentRxBufferId; /* For complete routine usage */
+ u32 Rx3UrbCancel;

- u32 LastR1; // For RSSI reporting
- struct urb * RxUrb;
- u32 Ep3ErrorCount2; // 20060625.1 Usbd for Rx DMA error count
+ u32 LastR1; /* For RSSI reporting */
+ struct urb *RxUrb;
+ u32 Ep3ErrorCount2; /* 20060625.1 Usbd for Rx DMA error count */

int EP3VM_status;
- u8 * pDRx;
+ u8 *pDRx;
};
+
+#endif /* __WINBOND_35RX_S_H */
--
1.7.7.3

2012-10-12 16:38:49

by Adil Mujeeb

[permalink] [raw]
Subject: [PATCH 8/9] taging: winbond: wb35tx: Fixed coding style issues

Fixed most of the checkpatch.pl reported ERRORs and WARNINGs (still few are there).

Signed-off-by: Adil Mujeeb <[email protected]>
---
linux-3.6-rc7/drivers/staging/winbond/wb35tx.c | 160 +++++++++++-------------
1 files changed, 71 insertions(+), 89 deletions(-)

diff --git a/linux-3.6-rc7/drivers/staging/winbond/wb35tx.c b/linux-3.6-rc7/drivers/staging/winbond/wb35tx.c
index 5df39d4..8beeb4d 100644
--- a/linux-3.6-rc7/drivers/staging/winbond/wb35tx.c
+++ b/linux-3.6-rc7/drivers/staging/winbond/wb35tx.c
@@ -1,13 +1,13 @@
-//============================================================================
-// Copyright (c) 1996-2002 Winbond Electronic Corporation
-//
-// Module Name:
-// Wb35Tx.c
-//
-// Abstract:
-// Processing the Tx message and put into down layer
-//
-//============================================================================
+/*
+ * Copyright (c) 1996-2002 Winbond Electronic Corporation
+ *
+ * Module Name:
+ * Wb35Tx.c
+ *
+ * Abstract:
+ * Processing the Tx message and put into down layer
+ */
+
#include <linux/usb.h>
#include <linux/gfp.h>

@@ -15,7 +15,7 @@
#include "mds_f.h"

unsigned char
-Wb35Tx_get_tx_buffer(struct hw_data * pHwData, u8 **pBuffer)
+Wb35Tx_get_tx_buffer(struct hw_data *pHwData, u8 **pBuffer)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

@@ -25,30 +25,28 @@ Wb35Tx_get_tx_buffer(struct hw_data * pHwData, u8 **pBuffer)

static void Wb35Tx(struct wbsoft_priv *adapter);

-static void Wb35Tx_complete(struct urb * pUrb)
+static void Wb35Tx_complete(struct urb *pUrb)
{
struct wbsoft_priv *adapter = pUrb->context;
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
struct wb35_mds *pMds = &adapter->Mds;

- printk("wb35: tx complete\n");
- // Variable setting
+ /* Variable setting */
pWb35Tx->EP4vm_state = VM_COMPLETED;
- pWb35Tx->EP4VM_status = pUrb->status; //Store the last result of Irp
- pMds->TxOwner[ pWb35Tx->TxSendIndex ] = 0;// Set the owner. Free the owner bit always.
+ pWb35Tx->EP4VM_status = pUrb->status; /* Store the last result of Irp */
+ pMds->TxOwner[pWb35Tx->TxSendIndex] = 0; /* Set the owner. Free the owner bit always. */
pWb35Tx->TxSendIndex++;
pWb35Tx->TxSendIndex %= MAX_USB_TX_BUFFER_NUMBER;

- if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove
+ if (pHwData->SurpriseRemove) /* Let WbWlanHalt to handle surprise remove */
goto error;

if (pWb35Tx->tx_halt)
goto error;

- // The URB is completed, check the result
+ /* The URB is completed, check the result */
if (pWb35Tx->EP4VM_status != 0) {
- printk("URB submission failed\n");
pWb35Tx->EP4vm_state = VM_STOP;
goto error;
}
@@ -64,12 +62,12 @@ error:

static void Wb35Tx(struct wbsoft_priv *adapter)
{
- struct hw_data * pHwData = &adapter->sHwData;
- struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
+ struct hw_data *pHwData = &adapter->sHwData;
+ struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
u8 *pTxBufferAddress;
struct wb35_mds *pMds = &adapter->Mds;
- struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb;
- int retv;
+ struct urb *pUrb = (struct urb *)pWb35Tx->Tx4Urb;
+ int retv;
u32 SendIndex;


@@ -79,28 +77,25 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
if (pWb35Tx->tx_halt)
goto cleanup;

- // Ownership checking
+ /* Ownership checking */
SendIndex = pWb35Tx->TxSendIndex;
- if (!pMds->TxOwner[SendIndex]) //No more data need to be sent, return immediately
+ if (!pMds->TxOwner[SendIndex]) /* No more data need to be sent, return immediately */
goto cleanup;

pTxBufferAddress = pWb35Tx->TxBuffer[SendIndex];
- //
- // Issuing URB
- //
+
+ /* Issuing URB */
usb_fill_bulk_urb(pUrb, pHwData->udev,
usb_sndbulkpipe(pHwData->udev, 4),
- pTxBufferAddress, pMds->TxBufferSize[ SendIndex ],
+ pTxBufferAddress, pMds->TxBufferSize[SendIndex],
Wb35Tx_complete, adapter);

pWb35Tx->EP4vm_state = VM_RUNNING;
retv = usb_submit_urb(pUrb, GFP_ATOMIC);
- if (retv<0) {
- printk("EP4 Tx Irp sending error\n");
+ if (retv < 0)
goto cleanup;
- }

- // Check if driver needs issue Irp for EP2
+ /* Check if driver needs issue Irp for EP2 */
pWb35Tx->TxFillCount += pMds->TxCountInBuffer[SendIndex];
if (pWb35Tx->TxFillCount > 12)
Wb35Tx_EP2VM_start(adapter);
@@ -115,10 +110,10 @@ static void Wb35Tx(struct wbsoft_priv *adapter)

void Wb35Tx_start(struct wbsoft_priv *adapter)
{
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

- // Allow only one thread to run into function
+ /* Allow only one thread to run into function */
if (atomic_inc_return(&pWb35Tx->TxFireCounter) == 1) {
pWb35Tx->EP4vm_state = VM_RUNNING;
Wb35Tx(adapter);
@@ -126,7 +121,7 @@ void Wb35Tx_start(struct wbsoft_priv *adapter)
atomic_dec(&pWb35Tx->TxFireCounter);
}

-unsigned char Wb35Tx_initial(struct hw_data * pHwData)
+unsigned char Wb35Tx_initial(struct hw_data *pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

@@ -135,54 +130,47 @@ unsigned char Wb35Tx_initial(struct hw_data * pHwData)
return false;

pWb35Tx->Tx2Urb = usb_alloc_urb(0, GFP_ATOMIC);
- if (!pWb35Tx->Tx2Urb)
- {
- usb_free_urb( pWb35Tx->Tx4Urb );
+ if (!pWb35Tx->Tx2Urb) {
+ usb_free_urb(pWb35Tx->Tx4Urb);
return false;
}

return true;
}

-//======================================================
-void Wb35Tx_stop(struct hw_data * pHwData)
+void Wb35Tx_stop(struct hw_data *pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

- // Trying to canceling the Trp of EP2
+ /* Trying to canceling the Trp of EP2 */
if (pWb35Tx->EP2vm_state == VM_RUNNING)
- usb_unlink_urb( pWb35Tx->Tx2Urb ); // Only use unlink, let Wb35Tx_destrot to free them
- pr_debug("EP2 Tx stop\n");
+ usb_unlink_urb(pWb35Tx->Tx2Urb); /* Only use unlink, let Wb35Tx_destrot to free them */

- // Trying to canceling the Irp of EP4
+ /* Trying to canceling the Irp of EP4 */
if (pWb35Tx->EP4vm_state == VM_RUNNING)
- usb_unlink_urb( pWb35Tx->Tx4Urb ); // Only use unlink, let Wb35Tx_destrot to free them
- pr_debug("EP4 Tx stop\n");
+ usb_unlink_urb(pWb35Tx->Tx4Urb); /* Only use unlink, let Wb35Tx_destrot to free them */
}

-//======================================================
-void Wb35Tx_destroy(struct hw_data * pHwData)
+void Wb35Tx_destroy(struct hw_data *pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

- // Wait for VM stop
+ /* Wait for VM stop */
do {
- msleep(10); // Delay for waiting function enter 940623.1.a
- } while( (pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP) );
- msleep(10); // Delay for waiting function enter 940623.1.b
+ msleep(10); /* Delay for waiting function enter 940623.1.a */
+ } while ((pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP));
+ msleep(10); /* Delay for waiting function enter 940623.1.b */

if (pWb35Tx->Tx4Urb)
- usb_free_urb( pWb35Tx->Tx4Urb );
+ usb_free_urb(pWb35Tx->Tx4Urb);

if (pWb35Tx->Tx2Urb)
- usb_free_urb( pWb35Tx->Tx2Urb );
-
- pr_debug("Wb35Tx_destroy OK\n");
+ usb_free_urb(pWb35Tx->Tx2Urb);
}

void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount)
{
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
unsigned char Trigger = false;

@@ -199,46 +187,44 @@ void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount)

static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter);

-static void Wb35Tx_EP2VM_complete(struct urb * pUrb)
+static void Wb35Tx_EP2VM_complete(struct urb *pUrb)
{
struct wbsoft_priv *adapter = pUrb->context;
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct T02_descriptor T02, TSTATUS;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
- u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
+ u32 *pltmp = (u32 *)pWb35Tx->EP2_buf;
u32 i;
u16 InterruptInLength;


- // Variable setting
+ /* Variable setting */
pWb35Tx->EP2vm_state = VM_COMPLETED;
pWb35Tx->EP2VM_status = pUrb->status;

- // For Linux 2.4. Interrupt will always trigger
- if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove
+ /* For Linux 2.4. Interrupt will always trigger */
+ if (pHwData->SurpriseRemove) /* Let WbWlanHalt to handle surprise remove */
goto error;

if (pWb35Tx->tx_halt)
goto error;

- //The Urb is completed, check the result
+ /* The Urb is completed, check the result */
if (pWb35Tx->EP2VM_status != 0) {
- printk("EP2 IoCompleteRoutine return error\n");
- pWb35Tx->EP2vm_state= VM_STOP;
+ pWb35Tx->EP2vm_state = VM_STOP;
goto error;
}

- // Update the Tx result
+ /* Update the Tx result */
InterruptInLength = pUrb->actual_length;
- // Modify for minimum memory access and DWORD alignment.
- T02.value = cpu_to_le32(pltmp[0]) >> 8; // [31:8] -> [24:0]
- InterruptInLength -= 1;// 20051221.1.c Modify the follow for more stable
- InterruptInLength >>= 2; // InterruptInLength/4
+ /* Modify for minimum memory access and DWORD alignment. */
+ T02.value = cpu_to_le32(pltmp[0]) >> 8; /* [31:8] -> [24:0] */
+ InterruptInLength -= 1; /* 20051221.1.c Modify the follow for more stable */
+ InterruptInLength >>= 2; /* InterruptInLength/4 */
for (i = 1; i <= InterruptInLength; i++) {
T02.value |= ((cpu_to_le32(pltmp[i]) & 0xff) << 24);
-
- TSTATUS.value = T02.value; //20061009 anson's endian
- Mds_SendComplete( adapter, &TSTATUS );
+ TSTATUS.value = T02.value; /* 20061009 anson's endian */
+ Mds_SendComplete(adapter, &TSTATUS);
T02.value = cpu_to_le32(pltmp[i]) >> 8;
}

@@ -250,10 +236,10 @@ error:

static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
{
- struct hw_data * pHwData = &adapter->sHwData;
- struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
- struct urb * pUrb = (struct urb *)pWb35Tx->Tx2Urb;
- u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
+ struct hw_data *pHwData = &adapter->sHwData;
+ struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
+ struct urb *pUrb = (struct urb *)pWb35Tx->Tx2Urb;
+ u32 *pltmp = (u32 *)pWb35Tx->EP2_buf;
int retv;

if (pHwData->SurpriseRemove)
@@ -262,19 +248,15 @@ static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
if (pWb35Tx->tx_halt)
goto error;

- //
- // Issuing URB
- //
- usb_fill_int_urb( pUrb, pHwData->udev, usb_rcvintpipe(pHwData->udev,2),
+ /* Issuing URB */
+ usb_fill_int_urb(pUrb, pHwData->udev, usb_rcvintpipe(pHwData->udev, 2),
pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, adapter, 32);

pWb35Tx->EP2vm_state = VM_RUNNING;
retv = usb_submit_urb(pUrb, GFP_ATOMIC);

- if (retv < 0) {
- pr_debug("EP2 Tx Irp sending error\n");
+ if (retv < 0)
goto error;
- }

return;
error:
@@ -284,10 +266,10 @@ error:

void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter)
{
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;

- // Allow only one thread to run into function
+ /* Allow only one thread to run into function */
if (atomic_inc_return(&pWb35Tx->TxResultCount) == 1) {
pWb35Tx->EP2vm_state = VM_RUNNING;
Wb35Tx_EP2VM(adapter);
--
1.7.7.3

2012-10-12 16:38:58

by Adil Mujeeb

[permalink] [raw]
Subject: [PATCH 9/9] Staging: winbond: wb35tx_s: Fixed coding style issues

Fixed most of the checkpatch.pl reported ERRORs and WARNINGs.
Some "line over 80 characters" warning left.

Signed-off-by: Adil Mujeeb <[email protected]>
---
linux-3.6-rc7/drivers/staging/winbond/wb35tx_s.h | 49 +++++++++------------
1 files changed, 21 insertions(+), 28 deletions(-)

diff --git a/linux-3.6-rc7/drivers/staging/winbond/wb35tx_s.h b/linux-3.6-rc7/drivers/staging/winbond/wb35tx_s.h
index f70f433..02a1f27 100644
--- a/linux-3.6-rc7/drivers/staging/winbond/wb35tx_s.h
+++ b/linux-3.6-rc7/drivers/staging/winbond/wb35tx_s.h
@@ -3,45 +3,38 @@

#include "mds_s.h"

-//====================================
-// IS89C35 Tx related definition
-//====================================
-#define TX_INTERFACE 0 // Interface 1
-#define TX_PIPE 3 // endpoint 4
-#define TX_INTERRUPT 1 // endpoint 2
-#define MAX_INTERRUPT_LENGTH 64 // It must be 64 for EP2 hardware
-
-
-
-//====================================
-// Internal variable for module
-//====================================
+/* IS89C35 Tx related definition */
+#define TX_INTERFACE 0 /* Interface 1 */
+#define TX_PIPE 3 /* endpoint 4 */
+#define TX_INTERRUPT 1 /* endpoint 2 */
+#define MAX_INTERRUPT_LENGTH 64 /* It must be 64 for EP2 hardware */

+/* Internal variable for module */

struct wb35_tx {
- // For Tx buffer
- u8 TxBuffer[ MAX_USB_TX_BUFFER_NUMBER ][ MAX_USB_TX_BUFFER ];
+ /* For Tx buffer */
+ u8 TxBuffer[MAX_USB_TX_BUFFER_NUMBER][MAX_USB_TX_BUFFER];

- // For Interrupt pipe
- u8 EP2_buf[MAX_INTERRUPT_LENGTH];
+ /* For Interrupt pipe */
+ u8 EP2_buf[MAX_INTERRUPT_LENGTH];

- atomic_t TxResultCount;// For thread control of EP2 931130.4.m
- atomic_t TxFireCounter;// For thread control of EP4 931130.4.n
- u32 ByteTransfer;
+ atomic_t TxResultCount; /* For thread control of EP2 931130.4.m */
+ atomic_t TxFireCounter; /* For thread control of EP4 931130.4.n */
+ u32 ByteTransfer;

- u32 TxSendIndex;// The next index of Mds array to be sent
- u32 EP2vm_state; // for EP2vm state
- u32 EP4vm_state; // for EP4vm state
- u32 tx_halt; // Stopping VM
+ u32 TxSendIndex; /* next index of Mds array to be sent */
+ u32 EP2vm_state; /* for EP2vm state */
+ u32 EP4vm_state; /* for EP4vm state */
+ u32 tx_halt; /* Stopping VM */

- struct urb * Tx4Urb;
- struct urb * Tx2Urb;
+ struct urb *Tx4Urb;
+ struct urb *Tx2Urb;

int EP2VM_status;
int EP4VM_status;

- u32 TxFillCount; // 20060928
- u32 TxTimer; // 20060928 Add if sending packet not great than 13
+ u32 TxFillCount; /* 20060928 */
+ u32 TxTimer; /* 20060928 Add if sending packet not great than 13 */
};

#endif
--
1.7.7.3

2012-10-12 16:53:24

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 2/9] Staging: winbond: phy_calibration: Fixed coding style issue

On Fri, 2012-10-12 at 22:07 +0530, Adil Mujeeb wrote:
> Removed checkpatch.pl script reported ERRORs
[]
> diff --git a/linux-3.6-rc7/drivers/staging/winbond/phy_calibration.c b/linux-3.6-rc7/drivers/staging/winbond/phy_calibration.c
[]
> -#define AG_CONST 0.6072529350
> +#define AG_CONST (0.6072529350)

That one is unnecessary.
checkpatch is defective here.

I wonder why there is any floating point
in the code at all though.

2012-10-21 10:38:45

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 2/9] Staging: winbond: phy_calibration: Fixed coding style issue

On Fri 2012-10-12 09:53:19, Joe Perches wrote:
> On Fri, 2012-10-12 at 22:07 +0530, Adil Mujeeb wrote:
> > Removed checkpatch.pl script reported ERRORs
> []
> > diff --git a/linux-3.6-rc7/drivers/staging/winbond/phy_calibration.c b/linux-3.6-rc7/drivers/staging/winbond/phy_calibration.c
> []
> > -#define AG_CONST 0.6072529350
> > +#define AG_CONST (0.6072529350)
>
> That one is unnecessary.
> checkpatch is defective here.

Agreed.

> I wonder why there is any floating point
> in the code at all though.

Some kind of signal strength computations. I'm not an wifi expert... :-).

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2012-10-21 10:39:51

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 5/9] Staging: winbond: wb35reg: Fixed coding style issues

On Fri 2012-10-12 22:07:11, Adil Mujeeb wrote:
> Fixed some of checkpatch.pl reported ERRORs and WARNING of similar types:
> 1. trailing statements should be on next line
> 2. no spaces at the start of a line
>
> Signed-off-by: Adil Mujeeb <[email protected]>

NAK. This makes it worse, not better. The code is simple enough. That
making it longer makes it unreadable.

Pavel


> void Wb35Reg_Update(struct hw_data *pHwData, u16 RegisterNo, u32 RegisterValue)
> {
> struct wb35_reg *reg = &pHwData->reg;
> switch (RegisterNo) {
> - case 0x3b0: reg->U1B0 = RegisterValue; break;
> - case 0x3bc: reg->U1BC_LEDConfigure = RegisterValue; break;
> - case 0x400: reg->D00_DmaControl = RegisterValue; break;
> - case 0x800: reg->M00_MacControl = RegisterValue; break;
> - case 0x804: reg->M04_MulticastAddress1 = RegisterValue; break;
> - case 0x808: reg->M08_MulticastAddress2 = RegisterValue; break;
> - case 0x824: reg->M24_MacControl = RegisterValue; break;
> - case 0x828: reg->M28_MacControl = RegisterValue; break;
> - case 0x82c: reg->M2C_MacControl = RegisterValue; break;
> - case 0x838: reg->M38_MacControl = RegisterValue; break;
> - case 0x840: reg->M40_MacControl = RegisterValue; break;
> - case 0x844: reg->M44_MacControl = RegisterValue; break;
> - case 0x848: reg->M48_MacControl = RegisterValue; break;
> - case 0x84c: reg->M4C_MacStatus = RegisterValue; break;
> - case 0x860: reg->M60_MacControl = RegisterValue; break;
> - case 0x868: reg->M68_MacControl = RegisterValue; break;
> - case 0x870: reg->M70_MacControl = RegisterValue; break;
> - case 0x874: reg->M74_MacControl = RegisterValue; break;
> - case 0x878: reg->M78_ERPInformation = RegisterValue; break;
> - case 0x87C: reg->M7C_MacControl = RegisterValue; break;
> - case 0x880: reg->M80_MacControl = RegisterValue; break;
> - case 0x884: reg->M84_MacControl = RegisterValue; break;
> - case 0x888: reg->M88_MacControl = RegisterValue; break;
> - case 0x898: reg->M98_MacControl = RegisterValue; break;
> - case 0x100c: reg->BB0C = RegisterValue; break;
> - case 0x102c: reg->BB2C = RegisterValue; break;
> - case 0x1030: reg->BB30 = RegisterValue; break;
> - case 0x103c: reg->BB3C = RegisterValue; break;
> - case 0x1048: reg->BB48 = RegisterValue; break;
> - case 0x104c: reg->BB4C = RegisterValue; break;
> - case 0x1050: reg->BB50 = RegisterValue; break;
> - case 0x1054: reg->BB54 = RegisterValue; break;
> - case 0x1058: reg->BB58 = RegisterValue; break;
> - case 0x105c: reg->BB5C = RegisterValue; break;
> - case 0x1060: reg->BB60 = RegisterValue; break;
> + case 0x3b0:
> + reg->U1B0 = RegisterValue;
> + break;
> + case 0x3bc:
> + reg->U1BC_LEDConfigure = RegisterValue;
> + break;
> + case 0x400:
> + reg->D00_DmaControl = RegisterValue;
> + break;
> + case 0x800:
> + reg->M00_MacControl = RegisterValue;
> + break;
> + case 0x804:
> + reg->M04_MulticastAddress1 = RegisterValue;
> + break;
> + case 0x808:
> + reg->M08_MulticastAddress2 = RegisterValue;
> + break;
> + case 0x824:
> + reg->M24_MacControl = RegisterValue;
> + break;
> + case 0x828:
> + reg->M28_MacControl = RegisterValue;
> + break;
> + case 0x82c:
> + reg->M2C_MacControl = RegisterValue;
> + break;
> + case 0x838:
> + reg->M38_MacControl = RegisterValue;
> + break;
> + case 0x840:
> + reg->M40_MacControl = RegisterValue;
> + break;
> + case 0x844:
> + reg->M44_MacControl = RegisterValue;
> + break;
> + case 0x848:
> + reg->M48_MacControl = RegisterValue;
> + break;
> + case 0x84c:
> + reg->M4C_MacStatus = RegisterValue;
> + break;
> + case 0x860:
> + reg->M60_MacControl = RegisterValue;
> + break;
> + case 0x868:
> + reg->M68_MacControl = RegisterValue;
> + break;
> + case 0x870:
> + reg->M70_MacControl = RegisterValue;
> + break;
> + case 0x874:
> + reg->M74_MacControl = RegisterValue;
> + break;
> + case 0x878:
> + reg->M78_ERPInformation = RegisterValue;
> + break;
> + case 0x87C:
> + reg->M7C_MacControl = RegisterValue;
> + break;
> + case 0x880:
> + reg->M80_MacControl = RegisterValue;
> + break;
> + case 0x884:
> + reg->M84_MacControl = RegisterValue;
> + break;
> + case 0x888:
> + reg->M88_MacControl = RegisterValue;
> + break;
> + case 0x898:
> + reg->M98_MacControl = RegisterValue;
> + break;
> + case 0x100c:
> + reg->BB0C = RegisterValue;
> + break;
> + case 0x102c:
> + reg->BB2C = RegisterValue;
> + break;
> + case 0x1030:
> + reg->BB30 = RegisterValue;
> + break;
> + case 0x103c:
> + reg->BB3C = RegisterValue;
> + break;
> + case 0x1048:
> + reg->BB48 = RegisterValue;
> + break;
> + case 0x104c:
> + reg->BB4C = RegisterValue;
> + break;
> + case 0x1050:
> + reg->BB50 = RegisterValue;
> + break;
> + case 0x1054:
> + reg->BB54 = RegisterValue;
> + break;
> + case 0x1058:
> + reg->BB58 = RegisterValue;
> + break;
> + case 0x105c:
> + reg->BB5C = RegisterValue;
> + break;
> + case 0x1060:
> + reg->BB60 = RegisterValue;
> + break;
> }
> }
>

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2012-10-21 10:42:24

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 0/9] Staging: winbond: Fixed coding style issues

On Fri 2012-10-12 22:07:06, Adil Mujeeb wrote:
>
> winbond directory files have lots of coding style issues. The patch
set tries to remove *most* (if not all) of the coding style
issues. checkpatch.pl script is still complaining (like 80 characters
limit) but major part of the serious coding style issues have been
rectified.

ACK on patches except 2 and 5. Plus if you could keep the printks,
that would be great. When the driver is debugged and in wide use, we
can remove them, but now they are useful...

Thanks,
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2012-10-21 11:22:55

by Adil Mujeeb

[permalink] [raw]
Subject: Re: [PATCH 0/9] Staging: winbond: Fixed coding style issues

Hi Pavel,

On Sun, Oct 21, 2012 at 4:12 PM, Pavel Machek <[email protected]> wrote:
> On Fri 2012-10-12 22:07:06, Adil Mujeeb wrote:
>>
>> winbond directory files have lots of coding style issues. The patch
> set tries to remove *most* (if not all) of the coding style
> issues. checkpatch.pl script is still complaining (like 80 characters
> limit) but major part of the serious coding style issues have been
> rectified.
>
> ACK on patches except 2 and 5. Plus if you could keep the printks,
> that would be great. When the driver is debugged and in wide use, we
> can remove them, but now they are useful...

Thanks Pavel for acknowledgement.

I removed printk's as Joe and Greg recommended to remove "tracing"
type debug calls. Let me know if I need to resubmit the patch.

Regards,
Adil

>
> Thanks,
> Pavel
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2012-10-22 20:34:10

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 0/9] Staging: winbond: Fixed coding style issues

On Fri, Oct 12, 2012 at 10:07:06PM +0530, Adil Mujeeb wrote:
>
> winbond directory files have lots of coding style issues. The patch set tries to remove *most* (if not all) of the coding style issues. checkpatch.pl script is still complaining (like 80 characters limit) but major part of the serious coding style issues have been rectified.

None of your patches can be applied due to the wrong patch level they
were generated at. Please redo them, drop the two offending patches,
and resend the whole series.

thanks,

greg k-h

2012-10-23 10:11:11

by Adil Mujeeb

[permalink] [raw]
Subject: Re: [PATCH 0/9] Staging: winbond: Fixed coding style issues

On Tue, Oct 23, 2012 at 2:04 AM, Greg KH <[email protected]> wrote:
> On Fri, Oct 12, 2012 at 10:07:06PM +0530, Adil Mujeeb wrote:
>>
>> winbond directory files have lots of coding style issues. The patch set tries to remove *most* (if not all) of the coding style issues. checkpatch.pl script is still complaining (like 80 characters limit) but major part of the serious coding style issues have been rectified.
>
> None of your patches can be applied due to the wrong patch level they
> were generated at. Please redo them, drop the two offending patches,
> and resend the whole series.
>
> thanks,
>
> greg k-h

Thanks Greg. I will recreate the patches and shall drop the mentioned
ones. But I am still not able find where I am doing wrong in
generating the patches. I am following your tutorial :) but may be
missing something. Please help. I am doing in the following ways:

1. I am downloading the latest rc source archive from ftp.kernel.org
under directory /pub/linux/kernel/v3.x/testing
2. Then creating my own git repository treating the base source as master.
3. Creating a branch from it and tries to fix some sources.
4. Create the patch through git format-patch
5. Submit the patch through git send-email command.

Dry run works fine with my repository. Could you please help?

Regards,
Adil

2012-10-23 18:46:01

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 0/9] Staging: winbond: Fixed coding style issues

On Tue, Oct 23, 2012 at 03:41:08PM +0530, Adil Mujeeb wrote:
> On Tue, Oct 23, 2012 at 2:04 AM, Greg KH <[email protected]> wrote:
> > On Fri, Oct 12, 2012 at 10:07:06PM +0530, Adil Mujeeb wrote:
> >>
> >> winbond directory files have lots of coding style issues. The patch set tries to remove *most* (if not all) of the coding style issues. checkpatch.pl script is still complaining (like 80 characters limit) but major part of the serious coding style issues have been rectified.
> >
> > None of your patches can be applied due to the wrong patch level they
> > were generated at. Please redo them, drop the two offending patches,
> > and resend the whole series.
> >
> > thanks,
> >
> > greg k-h
>
> Thanks Greg. I will recreate the patches and shall drop the mentioned
> ones. But I am still not able find where I am doing wrong in
> generating the patches. I am following your tutorial :) but may be
> missing something. Please help. I am doing in the following ways:
>
> 1. I am downloading the latest rc source archive from ftp.kernel.org
> under directory /pub/linux/kernel/v3.x/testing
> 2. Then creating my own git repository treating the base source as master.

Why not just use the kernel git tree? You will have to work off of
linux-next if you want to send staging patches, you can not keep up with
development otherwise.

> 3. Creating a branch from it and tries to fix some sources.
> 4. Create the patch through git format-patch
> 5. Submit the patch through git send-email command.
>
> Dry run works fine with my repository. Could you please help?

Your patches could not be applied with "patch -p1" from the root of the
kernel source tree, I think you created your git repo one directory too
deep.

greg k-h

2012-11-07 18:52:09

by Adil Mujeeb

[permalink] [raw]
Subject: Re: [PATCH 0/9] Staging: winbond: Fixed coding style issues

Hi,

On Wed, Oct 24, 2012 at 12:15 AM, Greg KH <[email protected]> wrote:
> On Tue, Oct 23, 2012 at 03:41:08PM +0530, Adil Mujeeb wrote:
>> On Tue, Oct 23, 2012 at 2:04 AM, Greg KH <[email protected]> wrote:
>> > On Fri, Oct 12, 2012 at 10:07:06PM +0530, Adil Mujeeb wrote:
>> >>
>> >> winbond directory files have lots of coding style issues. The patch set tries to remove *most* (if not all) of the coding style issues. checkpatch.pl script is still complaining (like 80 characters limit) but major part of the serious coding style issues have been rectified.
>> >
>> > None of your patches can be applied due to the wrong patch level they
>> > were generated at. Please redo them, drop the two offending patches,
>> > and resend the whole series.
>> >
>> > thanks,
>> >
>> > greg k-h
>>
>> Thanks Greg. I will recreate the patches and shall drop the mentioned
>> ones. But I am still not able find where I am doing wrong in
>> generating the patches. I am following your tutorial :) but may be
>> missing something. Please help. I am doing in the following ways:
>>
>> 1. I am downloading the latest rc source archive from ftp.kernel.org
>> under directory /pub/linux/kernel/v3.x/testing
>> 2. Then creating my own git repository treating the base source as master.
>
> Why not just use the kernel git tree? You will have to work off of
> linux-next if you want to send staging patches, you can not keep up with
> development otherwise.

Thanks Gree for your suggestion. I am using now linux-next tree.
Interestingly some of my patches already submitted by now :)

>
>> 3. Creating a branch from it and tries to fix some sources.
>> 4. Create the patch through git format-patch
>> 5. Submit the patch through git send-email command.
>>
>> Dry run works fine with my repository. Could you please help?
>
> Your patches could not be applied with "patch -p1" from the root of the
> kernel source tree, I think you created your git repo one directory too
> deep.

Thanks for correcting me. I have realized my mistake. I have submitted
fresh patches.

Thanks,
Adil

>
> greg k-h