Skip to contentSkip to conversation

staging: winbond: wb35reg_f.h Coding style fixes.

PATCH In review Lars Lindley 3 participants 7 messages Mar 21, 2010 – Mar 22, 2010 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: winbond: wb35reg_f.h Coding style fixes.

I fixed the checkpatch things except a couple of long lines. I also removed hungarian notation from the argument names and some "commented away" code.

---
 drivers/staging/winbond/wb35reg_f.h |  104 ++++++++++++++++++-----------------
 1 files changed, 54 insertions(+), 50 deletions(-)
drivers/staging/winbond/wb35reg_f.h +54 -50
index d352bce..1c1e3d8 100644
@@ -3,59 +3,63 @@
 
 #include "wbhal_s.h"
 
-//====================================
-// Interface function declare
-//====================================
-unsigned char Wb35Reg_initial(  struct hw_data * pHwData );
-void Uxx_power_on_procedure(  struct hw_data * pHwData );
-void Uxx_power_off_procedure(  struct hw_data * pHwData );
-void Uxx_ReadEthernetAddress(  struct hw_data * pHwData );
-void Dxx_initial(  struct hw_data * pHwData );
-void Mxx_initial(  struct hw_data * pHwData );
-void RFSynthesizer_initial(  struct hw_data * pHwData );
-//void RFSynthesizer_SwitchingChannel(  struct hw_data * pHwData,  s8 Channel );
-void RFSynthesizer_SwitchingChannel(  struct hw_data * pHwData,  struct chan_info Channel );
-void BBProcessor_initial(  struct hw_data * pHwData );
-void BBProcessor_RateChanging(  struct hw_data * pHwData,  u8 rate ); // 20060613.1
-//void RF_RateChanging(  struct hw_data * pHwData,  u8 rate ); // 20060626.5.c Add
-u8 RFSynthesizer_SetPowerIndex(  struct hw_data * pHwData,  u8 PowerIndex );
-u8 RFSynthesizer_SetMaxim2828_24Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetMaxim2828_50Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetMaxim2827_24Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetMaxim2827_50Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetMaxim2825Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetAiroha2230Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetAiroha7230Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetWinbond242Power(  struct hw_data *,  u8 index );
-void GetTxVgaFromEEPROM(  struct hw_data * pHwData );
-void EEPROMTxVgaAdjust(  struct hw_data * pHwData ); // 20060619.5 Add
-
-#define RFWriteControlData( _A, _V ) Wb35Reg_Write( _A, 0x0864, _V )
-
-void Wb35Reg_destroy(  struct hw_data * pHwData );
-
-unsigned char Wb35Reg_Read(  struct hw_data * pHwData,  u16 RegisterNo,   u32 * pRegisterValue );
-unsigned char Wb35Reg_ReadSync(  struct hw_data * pHwData,  u16 RegisterNo,   u32 * pRegisterValue );
-unsigned char Wb35Reg_Write(  struct hw_data * pHwData,  u16 RegisterNo,  u32 RegisterValue );
-unsigned char Wb35Reg_WriteSync(  struct hw_data * pHwData,  u16 RegisterNo,  u32 RegisterValue );
-unsigned char Wb35Reg_WriteWithCallbackValue(  struct hw_data * pHwData,
-								 u16 RegisterNo,
-								 u32 RegisterValue,
-								 s8 *pValue,
-								 s8 Len);
-unsigned char Wb35Reg_BurstWrite(  struct hw_data * pHwData,  u16 RegisterNo,  u32 * pRegisterData,  u8 NumberOfData,  u8 Flag );
-
-void Wb35Reg_EP0VM(  struct hw_data * pHwData );
-void Wb35Reg_EP0VM_start(  struct hw_data * pHwData );
+/*
+ * ====================================
+ * Interface function declare
+ * ====================================
+ */
+unsigned char Wb35Reg_initial(struct hw_data *HwData);
+void Uxx_power_on_procedure(struct hw_data *HwData);
+void Uxx_power_off_procedure(struct hw_data *HwData);
+void Uxx_ReadEthernetAddress(struct hw_data *HwData);
+void Dxx_initial(struct hw_data *HwData);
+void Mxx_initial(struct hw_data *HwData);
+void RFSynthesizer_initial(struct hw_data *HwData);
+void RFSynthesizer_SwitchingChannel(struct hw_data *HwData, struct chan_info Channel);
+void BBProcessor_initial(struct hw_data *HwData);
+void BBProcessor_RateChanging(struct hw_data *HwData, u8 rate);
+u8 RFSynthesizer_SetPowerIndex(struct hw_data *HwData, u8 PowerIndex);
+u8 RFSynthesizer_SetMaxim2828_24Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetMaxim2828_50Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetMaxim2827_24Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetMaxim2827_50Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetMaxim2825Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetAiroha2230Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetAiroha7230Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetWinbond242Power(struct hw_data *, u8 index);
+void GetTxVgaFromEEPROM(struct hw_data *HwData);
+void EEPROMTxVgaAdjust(struct hw_data *HwData);
+
+#define RFWriteControlData(_A, _V) Wb35Reg_Write(_A, 0x0864, _V)
+
+void Wb35Reg_destroy(struct hw_data *HwData);
+
+unsigned char Wb35Reg_Read(struct hw_data *HwData, u16 RegisterNo, u32 *RegisterValue);
+unsigned char Wb35Reg_ReadSync(struct hw_data *HwData, u16 RegisterNo, u32 *RegisterValue);
+unsigned char Wb35Reg_Write(struct hw_data *HwData, u16 RegisterNo, u32 RegisterValue);
+unsigned char Wb35Reg_WriteSync(struct hw_data *HwData, u16 RegisterNo, u32 RegisterValue);
+unsigned char Wb35Reg_WriteWithCallbackValue(struct hw_data *HwData,
+							 u16 RegisterNo,
+							 u32 RegisterValue,
+							 s8 *Value,
+							 s8 Len);
+unsigned char Wb35Reg_BurstWrite(struct hw_data *HwData,
+					u16 RegisterNo,
+					u32 *RegisterData,
+					u8 NumberOfData,
+					u8 Flag);
+
+void Wb35Reg_EP0VM(struct hw_data *HwData);
+void Wb35Reg_EP0VM_start(struct hw_data *HwData);
 void Wb35Reg_EP0VM_complete(struct urb *urb);
 
-u32 BitReverse( u32 dwData, u32 DataLength);
+u32 BitReverse(u32 Data, u32 DataLength);
 
-void CardGetMulticastBit(   u8 Address[MAC_ADDR_LENGTH],  u8 *Byte,  u8 *Value );
-u32 CardComputeCrc(  u8 * Buffer,  u32 Length );
+void CardGetMulticastBit(u8 Address[MAC_ADDR_LENGTH], u8 *Byte, u8 *Value);
+u32 CardComputeCrc(u8 *Buffer, u32 Length);
 
-void Wb35Reg_phy_calibration(  struct hw_data * pHwData );
-void Wb35Reg_Update(  struct hw_data * pHwData,  u16 RegisterNo,  u32 RegisterValue );
-unsigned char adjust_TXVGA_for_iq_mag(  struct hw_data * pHwData );
+void Wb35Reg_phy_calibration(struct hw_data *HwData);
+void Wb35Reg_Update(struct hw_data *HwData, u16 RegisterNo, u32 RegisterValue);
+unsigned char adjust_TXVGA_for_iq_mag(struct hw_data *HwData);
 
 #endif
Signature · 1 line
1.7.0.2
#1 lore raw

Lars Lindley kirjoitti:

Quoted 5 lines

I fixed the checkpatch things except a couple of long lines. I also removed hungarian notation from the argument names and some "commented away" code.

Did you check that all these function declarations are actually used? I've spotted plenty of dead code in the past.

drivers/staging/winbond/wb35reg_f.h line 11

Quoted 6 lines
drivers/staging/winbond/wb35reg_f.h +6 -0
+/*
+ * ====================================
+ * Interface function declare
+ * ====================================
+ */
+unsigned char Wb35Reg_initial(struct hw_data *HwData);

Lets avoid CamelCase for the arguments so "hw_data" here, for example. I see the same thing elsewhere in this patch as well.

#2 lore raw
Quoted 10 lines · Pekka Enberg

Lars Lindley kirjoitti:

Quoted 5 lines

I fixed the checkpatch things except a couple of long lines. I also removed hungarian notation from the argument names and some "commented away" code.

Did you check that all these function declarations are actually used? I've spotted plenty of dead code in the past.

Nope, didn't check that. Just looking at the style now..

Quoted 10 lines

drivers/staging/winbond/wb35reg_f.h line 11

Quoted 6 lines
drivers/staging/winbond/wb35reg_f.h +6 -0
+/*
+ * ====================================
+ * Interface function declare
+ * ====================================
+ */
+unsigned char Wb35Reg_initial(struct hw_data *HwData);

Lets avoid CamelCase for the arguments so "hw_data" here, for example. I see the same thing elsewhere in this patch as well.

I thought struct hw_data *hw_data looked a bit confusing..Thats why I left CamelCase alone for now. I can make it like that if you want..

/Lars

#3 lore raw
Quoted 6 lines · Lars Lindley
Quoted 5 lines · Pekka Enberg

Lars Lindley kirjoitti:

Quoted 4 lines

I fixed the checkpatch things except a couple of long lines. I also removed hungarian notation from the argument names and some "commented away" code.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Did you check that all these function declarations are actually used? I've spotted plenty of dead code in the past.

Nope, didn't check that. Just looking at the style now..

Well, based on my experience, you're will do a lot of unnecessary work on code that's going to get removed because it's not actually used. That's why I haven't bothered with style cleanups much.

Quoted 10 lines
Quoted 10 lines

drivers/staging/winbond/wb35reg_f.h line 11

Quoted 6 lines
drivers/staging/winbond/wb35reg_f.h +6 -0
+/*
+ * ====================================
+ * Interface function declare
+ * ====================================
+ */
+unsigned char Wb35Reg_initial(struct hw_data *HwData);

Lets avoid CamelCase for the arguments so "hw_data" here, for example. I see the same thing elsewhere in this patch as well.

Quoted 2 lines

I thought struct hw_data *hw_data looked a bit confusing..Thats why I left CamelCase alone for now. I can make it like that if you want..

Yes please.

#4 lore raw
Quoted 4 lines · Pekka Enberg
Quoted 3 lines · Lars Lindley
Quoted 2 lines · Pekka Enberg
Quoted 1 line

+unsigned char Wb35Reg_initial(struct hw_data *HwData);

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Lets avoid CamelCase for the arguments so "hw_data" here, for example. I see the same thing elsewhere in this patch as well.

I thought struct hw_data *hw_data looked a bit confusing..Thats why I left CamelCase alone for now. I can make it like that if you want..

Yes please.

Here's a new patch against master that fixes CamelCase too.

[PATCH] staging: winbond: wb35reg_f.h Coding style fixes.

I fixed the checkpatch things except a couple of long lines. I also removed hungarian notation and CamelCase from the argument names and some "commented away" code.

---
 drivers/staging/winbond/wb35reg_f.h |  104 ++++++++++++++++++-----------------
 1 files changed, 54 insertions(+), 50 deletions(-)
drivers/staging/winbond/wb35reg_f.h +54 -50
index d352bce..bf23c10 100644
@@ -3,59 +3,63 @@
 
 #include "wbhal_s.h"
 
-//====================================
-// Interface function declare
-//====================================
-unsigned char Wb35Reg_initial(  struct hw_data * pHwData );
-void Uxx_power_on_procedure(  struct hw_data * pHwData );
-void Uxx_power_off_procedure(  struct hw_data * pHwData );
-void Uxx_ReadEthernetAddress(  struct hw_data * pHwData );
-void Dxx_initial(  struct hw_data * pHwData );
-void Mxx_initial(  struct hw_data * pHwData );
-void RFSynthesizer_initial(  struct hw_data * pHwData );
-//void RFSynthesizer_SwitchingChannel(  struct hw_data * pHwData,  s8 Channel );
-void RFSynthesizer_SwitchingChannel(  struct hw_data * pHwData,  struct chan_info Channel );
-void BBProcessor_initial(  struct hw_data * pHwData );
-void BBProcessor_RateChanging(  struct hw_data * pHwData,  u8 rate ); // 20060613.1
-//void RF_RateChanging(  struct hw_data * pHwData,  u8 rate ); // 20060626.5.c Add
-u8 RFSynthesizer_SetPowerIndex(  struct hw_data * pHwData,  u8 PowerIndex );
-u8 RFSynthesizer_SetMaxim2828_24Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetMaxim2828_50Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetMaxim2827_24Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetMaxim2827_50Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetMaxim2825Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetAiroha2230Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetAiroha7230Power(  struct hw_data *,  u8 index );
-u8 RFSynthesizer_SetWinbond242Power(  struct hw_data *,  u8 index );
-void GetTxVgaFromEEPROM(  struct hw_data * pHwData );
-void EEPROMTxVgaAdjust(  struct hw_data * pHwData ); // 20060619.5 Add
-
-#define RFWriteControlData( _A, _V ) Wb35Reg_Write( _A, 0x0864, _V )
-
-void Wb35Reg_destroy(  struct hw_data * pHwData );
-
-unsigned char Wb35Reg_Read(  struct hw_data * pHwData,  u16 RegisterNo,   u32 * pRegisterValue );
-unsigned char Wb35Reg_ReadSync(  struct hw_data * pHwData,  u16 RegisterNo,   u32 * pRegisterValue );
-unsigned char Wb35Reg_Write(  struct hw_data * pHwData,  u16 RegisterNo,  u32 RegisterValue );
-unsigned char Wb35Reg_WriteSync(  struct hw_data * pHwData,  u16 RegisterNo,  u32 RegisterValue );
-unsigned char Wb35Reg_WriteWithCallbackValue(  struct hw_data * pHwData,
-								 u16 RegisterNo,
-								 u32 RegisterValue,
-								 s8 *pValue,
-								 s8 Len);
-unsigned char Wb35Reg_BurstWrite(  struct hw_data * pHwData,  u16 RegisterNo,  u32 * pRegisterData,  u8 NumberOfData,  u8 Flag );
-
-void Wb35Reg_EP0VM(  struct hw_data * pHwData );
-void Wb35Reg_EP0VM_start(  struct hw_data * pHwData );
+/*
+ * ====================================
+ * Interface function declare
+ * ====================================
+ */
+unsigned char Wb35Reg_initial(struct hw_data *hw_data);
+void Uxx_power_on_procedure(struct hw_data *hw_data);
+void Uxx_power_off_procedure(struct hw_data *hw_data);
+void Uxx_ReadEthernetAddress(struct hw_data *hw_data);
+void Dxx_initial(struct hw_data *hw_data);
+void Mxx_initial(struct hw_data *hw_data);
+void RFSynthesizer_initial(struct hw_data *hw_data);
+void RFSynthesizer_SwitchingChannel(struct hw_data *hw_data, struct chan_info channel);
+void BBProcessor_initial(struct hw_data *hw_data);
+void BBProcessor_RateChanging(struct hw_data *hw_data, u8 rate);
+u8 RFSynthesizer_SetPowerIndex(struct hw_data *hw_data, u8 power_index);
+u8 RFSynthesizer_SetMaxim2828_24Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetMaxim2828_50Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetMaxim2827_24Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetMaxim2827_50Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetMaxim2825Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetAiroha2230Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetAiroha7230Power(struct hw_data *, u8 index);
+u8 RFSynthesizer_SetWinbond242Power(struct hw_data *, u8 index);
+void GetTxVgaFromEEPROM(struct hw_data *hw_data);
+void EEPROMTxVgaAdjust(struct hw_data *hw_data);
+
+#define RFWriteControlData(_A, _V) Wb35Reg_Write(_A, 0x0864, _V)
+
+void Wb35Reg_destroy(struct hw_data *hw_data);
+
+unsigned char Wb35Reg_Read(struct hw_data *hw_data, u16 register_no, u32 *register_value);
+unsigned char Wb35Reg_ReadSync(struct hw_data *hw_data, u16 register_no, u32 *register_value);
+unsigned char Wb35Reg_Write(struct hw_data *hw_data, u16 register_no, u32 register_value);
+unsigned char Wb35Reg_WriteSync(struct hw_data *hw_data, u16 register_no, u32 register_value);
+unsigned char Wb35Reg_WriteWithCallbackValue(struct hw_data *hw_data,
+							 u16 register_no,
+							 u32 register_value,
+							 s8 *value,
+							 s8 len);
+unsigned char Wb35Reg_BurstWrite(struct hw_data *hw_data,
+					u16 register_no,
+					u32 *register_data,
+					u8 number_of_data,
+					u8 flag);
+
+void Wb35Reg_EP0VM(struct hw_data *hw_data);
+void Wb35Reg_EP0VM_start(struct hw_data *hw_data);
 void Wb35Reg_EP0VM_complete(struct urb *urb);
 
-u32 BitReverse( u32 dwData, u32 DataLength);
+u32 BitReverse(u32 data, u32 data_length);
 
-void CardGetMulticastBit(   u8 Address[MAC_ADDR_LENGTH],  u8 *Byte,  u8 *Value );
-u32 CardComputeCrc(  u8 * Buffer,  u32 Length );
+void CardGetMulticastBit(u8 address[MAC_ADDR_LENGTH], u8 *byte, u8 *value);
+u32 CardComputeCrc(u8 *buffer, u32 length);
 
-void Wb35Reg_phy_calibration(  struct hw_data * pHwData );
-void Wb35Reg_Update(  struct hw_data * pHwData,  u16 RegisterNo,  u32 RegisterValue );
-unsigned char adjust_TXVGA_for_iq_mag(  struct hw_data * pHwData );
+void Wb35Reg_phy_calibration(struct hw_data *hw_data);
+void Wb35Reg_Update(struct hw_data *hw_data, u16 register_no, u32 register_value);
+unsigned char adjust_TXVGA_for_iq_mag(struct hw_data *hw_data);
 
 #endif
Signature · 1 line
1.7.0.2
Acked-by
#5 lore raw
Quoted 9 lines · Lars Lindley

Here's a new patch against master that fixes CamelCase too.

[PATCH] staging: winbond: wb35reg_f.h Coding style fixes.

I fixed the checkpatch things except a couple of long lines. I also removed hungarian notation and CamelCase from the argument names and some "commented away" code.

#6 lore raw
In reply to Lars Lindley
Quoted 19 lines · Pekka Enberg
Quoted 12 lines · Lars Lindley
Quoted 8 lines · Pekka Enberg
Quoted 5 lines
Quoted 1 line

+unsigned char Wb35Reg_initial(struct hw_data *HwData);

Lets avoid CamelCase for the arguments so "hw_data" here, for example. I see the same thing elsewhere in this patch as well.

I thought struct hw_data *hw_data looked a bit confusing..Thats why I left CamelCase alone for now. I can make it like that if you want..

Yes please.

Here's a new patch against master that fixes CamelCase too.

Quoted 7 lines

[PATCH] staging: winbond: wb35reg_f.h Coding style fixes.

I fixed the checkpatch things except a couple of long lines. I also removed hungarian notation and CamelCase from the argument names and some "commented away" code.

ACK.

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