2016-11-18 17:57:29

by Sergio Paracuellos

[permalink] [raw]
Subject: [PATCH 0/6] staging: slicoss: fix some style issues

This patchset fix several style issues to comply with
the standard kernel coding style.

Sergio Paracuellos (6):
staging: slicoss: avoid CamelCases in slic.h
staging: slicoss: fix parenthesis alignment in slicoss.c
staging: slicoss: logical continuations should be on the previous line
staging: slicoss: braces should be used on all arms of this statement
staging: slicoss: avoid CamelCases in slichw.h
staging: slicoss: avoid CamelCases slicoss.c

drivers/staging/slicoss/slic.h | 30 +++---
drivers/staging/slicoss/slichw.h | 178 +++++++++++++++++-----------------
drivers/staging/slicoss/slicoss.c | 194 +++++++++++++++++++-------------------
3 files changed, 200 insertions(+), 202 deletions(-)

--
1.9.1


2016-11-18 17:57:33

by Sergio Paracuellos

[permalink] [raw]
Subject: [PATCH 1/6] staging: slicoss: avoid CamelCases in slic.h

Replace CamelCases to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <[email protected]>
---
drivers/staging/slicoss/slic.h | 30 +++++++++++------------
drivers/staging/slicoss/slicoss.c | 50 +++++++++++++++++++--------------------
2 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 420546d..3bb3441 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -52,8 +52,8 @@

#define GB_RCVUCODE_VERS_STRING "1.2"
#define GB_RCVUCODE_VERS_DATE "2006/03/27 15:12:15"
-static u32 OasisRcvUCodeLen = 512;
-static u32 GBRcvUCodeLen = 512;
+static u32 oasis_rcv_ucode_len = 512;
+static u32 gb_rcv_ucode_len = 512;
#define SECTION_SIZE 65536

#define SLIC_RSPQ_PAGES_GB 10
@@ -396,20 +396,20 @@ struct slic_upr {
struct slic_ifevents {
uint oflow802;
uint uflow802;
- uint Tprtoflow;
+ uint tprtoflow;
uint rcvearly;
- uint Bufov;
- uint Carre;
- uint Longe;
- uint Invp;
- uint Crc;
- uint Drbl;
- uint Code;
- uint IpHlen;
- uint IpLen;
- uint IpCsum;
- uint TpCsum;
- uint TpHlen;
+ uint bufov;
+ uint carre;
+ uint longe;
+ uint invp;
+ uint crc;
+ uint drbl;
+ uint code;
+ uint ip_hlen;
+ uint ip_len;
+ uint ip_csum;
+ uint tp_csum;
+ uint tp_hlen;
};

struct adapter {
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index d2929b9..db93654 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -386,13 +386,13 @@ static int slic_card_download_gbrcv(struct adapter *adapter)
index += 4;
switch (adapter->devid) {
case SLIC_2GB_DEVICE_ID:
- if (rcvucodelen != OasisRcvUCodeLen) {
+ if (rcvucodelen != oasis_rcv_ucode_len) {
release_firmware(fw);
return -EINVAL;
}
break;
case SLIC_1GB_DEVICE_ID:
- if (rcvucodelen != GBRcvUCodeLen) {
+ if (rcvucodelen != gb_rcv_ucode_len) {
release_firmware(fw);
return -EINVAL;
}
@@ -1837,7 +1837,7 @@ static void slic_rcv_handle_error(struct adapter *adapter,
if (hdr->frame_status14 & VRHSTAT_802OE)
adapter->if_events.oflow802++;
if (hdr->frame_status14 & VRHSTAT_TPOFLO)
- adapter->if_events.Tprtoflow++;
+ adapter->if_events.tprtoflow++;
if (hdr->frame_status_b14 & VRHSTATB_802UE)
adapter->if_events.uflow802++;
if (hdr->frame_status_b14 & VRHSTATB_RCVE) {
@@ -1845,45 +1845,45 @@ static void slic_rcv_handle_error(struct adapter *adapter,
netdev->stats.rx_fifo_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_BUFF) {
- adapter->if_events.Bufov++;
+ adapter->if_events.bufov++;
netdev->stats.rx_over_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_CARRE) {
- adapter->if_events.Carre++;
+ adapter->if_events.carre++;
netdev->stats.tx_carrier_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_LONGE)
- adapter->if_events.Longe++;
+ adapter->if_events.longe++;
if (hdr->frame_status_b14 & VRHSTATB_PREA)
- adapter->if_events.Invp++;
+ adapter->if_events.invp++;
if (hdr->frame_status_b14 & VRHSTATB_CRC) {
- adapter->if_events.Crc++;
+ adapter->if_events.crc++;
netdev->stats.rx_crc_errors++;
}
if (hdr->frame_status_b14 & VRHSTATB_DRBL)
- adapter->if_events.Drbl++;
+ adapter->if_events.drbl++;
if (hdr->frame_status_b14 & VRHSTATB_CODE)
- adapter->if_events.Code++;
+ adapter->if_events.code++;
if (hdr->frame_status_b14 & VRHSTATB_TPCSUM)
- adapter->if_events.TpCsum++;
+ adapter->if_events.tp_csum++;
if (hdr->frame_status_b14 & VRHSTATB_TPHLEN)
- adapter->if_events.TpHlen++;
+ adapter->if_events.tp_hlen++;
if (hdr->frame_status_b14 & VRHSTATB_IPCSUM)
- adapter->if_events.IpCsum++;
+ adapter->if_events.ip_csum++;
if (hdr->frame_status_b14 & VRHSTATB_IPLERR)
- adapter->if_events.IpLen++;
+ adapter->if_events.ip_len++;
if (hdr->frame_status_b14 & VRHSTATB_IPHERR)
- adapter->if_events.IpHlen++;
+ adapter->if_events.ip_hlen++;
} else {
if (hdr->frame_statusGB & VGBSTAT_XPERR) {
u32 xerr = hdr->frame_statusGB >> VGBSTAT_XERRSHFT;

if (xerr == VGBSTAT_XCSERR)
- adapter->if_events.TpCsum++;
+ adapter->if_events.tp_csum++;
if (xerr == VGBSTAT_XUFLOW)
- adapter->if_events.Tprtoflow++;
+ adapter->if_events.tprtoflow++;
if (xerr == VGBSTAT_XHLEN)
- adapter->if_events.TpHlen++;
+ adapter->if_events.tp_hlen++;
}
if (hdr->frame_statusGB & VGBSTAT_NETERR) {
u32 nerr =
@@ -1891,11 +1891,11 @@ static void slic_rcv_handle_error(struct adapter *adapter,
frame_statusGB >> VGBSTAT_NERRSHFT) &
VGBSTAT_NERRMSK;
if (nerr == VGBSTAT_NCSERR)
- adapter->if_events.IpCsum++;
+ adapter->if_events.ip_csum++;
if (nerr == VGBSTAT_NUFLOW)
- adapter->if_events.IpLen++;
+ adapter->if_events.ip_len++;
if (nerr == VGBSTAT_NHLEN)
- adapter->if_events.IpHlen++;
+ adapter->if_events.ip_hlen++;
}
if (hdr->frame_statusGB & VGBSTAT_LNKERR) {
u32 lerr = hdr->frame_statusGB & VGBSTAT_LERRMSK;
@@ -1903,13 +1903,13 @@ static void slic_rcv_handle_error(struct adapter *adapter,
if (lerr == VGBSTAT_LDEARLY)
adapter->if_events.rcvearly++;
if (lerr == VGBSTAT_LBOFLO)
- adapter->if_events.Bufov++;
+ adapter->if_events.bufov++;
if (lerr == VGBSTAT_LCODERR)
- adapter->if_events.Code++;
+ adapter->if_events.code++;
if (lerr == VGBSTAT_LDBLNBL)
- adapter->if_events.Drbl++;
+ adapter->if_events.drbl++;
if (lerr == VGBSTAT_LCRCERR)
- adapter->if_events.Crc++;
+ adapter->if_events.crc++;
if (lerr == VGBSTAT_LOFLO)
adapter->if_events.oflow802++;
if (lerr == VGBSTAT_LUFLO)
--
1.9.1

2016-11-18 17:57:37

by Sergio Paracuellos

[permalink] [raw]
Subject: [PATCH 5/6] staging: slicoss: avoid CamelCases in slichw.h

Replace CamelCases to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <[email protected]>
---
drivers/staging/slicoss/slichw.h | 178 +++++++++++++++++++-------------------
drivers/staging/slicoss/slicoss.c | 56 ++++++------
2 files changed, 117 insertions(+), 117 deletions(-)

diff --git a/drivers/staging/slicoss/slichw.h b/drivers/staging/slicoss/slichw.h
index 49cb91a..541d158 100644
--- a/drivers/staging/slicoss/slichw.h
+++ b/drivers/staging/slicoss/slichw.h
@@ -245,18 +245,18 @@ struct slic_hddr_wds {
} hdrs_14port;
struct {
u32 frame_status;
- u16 ByteCnt;
- u16 TpChksum;
- u16 CtxHash;
- u16 MacHash;
- u32 BufLnk;
+ u16 byte_cnt;
+ u16 tp_chksum;
+ u16 ctx_hash;
+ u16 mac_hash;
+ u32 buf_lnk;
} hdrs_gbit;
} u0;
};

#define frame_status14 u0.hdrs_14port.frame_status
#define frame_status_b14 u0.hdrs_14port.frame_status_b
-#define frame_statusGB u0.hdrs_gbit.frame_status
+#define frame_status_gb u0.hdrs_gbit.frame_status

struct slic_host64sg {
u32 paddrl;
@@ -460,7 +460,7 @@ struct slic_pnp_capabilities {
};

struct slic_config_mac {
- u8 macaddrA[6];
+ u8 macaddr_a[6];
};

#define ATK_FRU_FORMAT 0x00
@@ -520,56 +520,56 @@ struct vendor4_fru {
* SLIC EEPROM structure for Mojave
*/
struct slic_eeprom {
- u16 Id; /* 00 EEPROM/FLASH Magic code 'A5A5'*/
- u16 EecodeSize; /* 01 Size of EEPROM Codes (bytes * 4)*/
- u16 FlashSize; /* 02 Flash size */
- u16 EepromSize; /* 03 EEPROM Size */
- u16 VendorId; /* 04 Vendor ID */
- u16 DeviceId; /* 05 Device ID */
- u8 RevisionId; /* 06 Revision ID */
- u8 ClassCode[3]; /* 07 Class Code */
- u8 DbgIntPin; /* 08 Debug Interrupt pin */
- u8 NetIntPin0; /* Network Interrupt Pin */
- u8 MinGrant; /* 09 Minimum grant */
- u8 MaxLat; /* Maximum Latency */
- u16 PciStatus; /* 10 PCI Status */
- u16 SubSysVId; /* 11 Subsystem Vendor Id */
- u16 SubSysId; /* 12 Subsystem ID */
- u16 DbgDevId; /* 13 Debug Device Id */
- u16 DramRomFn; /* 14 Dram/Rom function */
- u16 DSize2Pci; /* 15 DRAM size to PCI (bytes * 64K) */
- u16 RSize2Pci; /* 16 ROM extension size to PCI (bytes * 4k) */
- u8 NetIntPin1; /* 17 Network Interface Pin 1
+ u16 id; /* 00 EEPROM/FLASH Magic code 'A5A5'*/
+ u16 eecode_size; /* 01 Size of EEPROM Codes (bytes * 4)*/
+ u16 flash_size; /* 02 Flash size */
+ u16 eeprom_size; /* 03 EEPROM Size */
+ u16 vendor_id; /* 04 Vendor ID */
+ u16 device_id; /* 05 Device ID */
+ u8 revision_id; /* 06 Revision ID */
+ u8 class_code[3]; /* 07 Class Code */
+ u8 dbg_int_pin; /* 08 Debug Interrupt pin */
+ u8 net_int_pin0; /* Network Interrupt Pin */
+ u8 min_grant; /* 09 Minimum grant */
+ u8 max_lat; /* Maximum Latency */
+ u16 pci_status; /* 10 PCI Status */
+ u16 sub_sys_vid; /* 11 Subsystem Vendor Id */
+ u16 sub_sys_id; /* 12 Subsystem ID */
+ u16 dbg_dev_id; /* 13 Debug Device Id */
+ u16 dram_rom_fn; /* 14 Dram/Rom function */
+ u16 dsize2pci; /* 15 DRAM size to PCI (bytes * 64K) */
+ u16 rsize2pci; /* 16 ROM extension size to PCI (bytes * 4k) */
+ u8 net_int_pin1; /* 17 Network Interface Pin 1
* (simba/leone only)
*/
- u8 NetIntPin2; /* Network Interface Pin 2 (simba/leone only)*/
+ u8 net_int_pin2; /* Network Interface Pin 2 (simba/leone only)*/
union {
- u8 NetIntPin3; /* 18 Network Interface Pin 3 (simba only) */
- u8 FreeTime; /* FreeTime setting (leone/mojave only) */
+ u8 net_int_pin3;/* 18 Network Interface Pin 3 (simba only) */
+ u8 free_time; /* FreeTime setting (leone/mojave only) */
} u1;
- u8 TBIctl; /* 10-bit interface control (Mojave only) */
- u16 DramSize; /* 19 DRAM size (bytes * 64k) */
+ u8 tbi_ctl; /* 10-bit interface control (Mojave only) */
+ u16 dram_size; /* 19 DRAM size (bytes * 64k) */
union {
struct {
/* Mac Interface Specific portions */
- struct slic_config_mac MacInfo[SLIC_NBR_MACS];
+ struct slic_config_mac mac_info[SLIC_NBR_MACS];
} mac; /* MAC access for all boards */
struct {
/* use above struct for MAC access */
struct slic_config_mac pad[SLIC_NBR_MACS - 1];
- u16 DeviceId2; /* Device ID for 2nd PCI function */
- u8 IntPin2; /* Interrupt pin for 2nd PCI function */
- u8 ClassCode2[3]; /* Class Code for 2nd PCI function */
+ u16 device_id2; /* Device ID for 2nd PCI function */
+ u8 int_pin2; /* Interrupt pin for 2nd PCI function */
+ u8 class_code2[3]; /* Class Code for 2nd PCI function */
} mojave; /* 2nd function access for gigabit board */
} u2;
- u16 CfgByte6; /* Config Byte 6 */
- u16 PMECapab; /* Power Mgment capabilities */
- u16 NwClkCtrls; /* NetworkClockControls */
- u8 FruFormat; /* Alacritech FRU format type */
- struct atk_fru AtkFru; /* Alacritech FRU information */
- u8 OemFruFormat; /* optional OEM FRU format type */
- union oemfru OemFru; /* optional OEM FRU information */
- u8 Pad[4]; /* Pad to 128 bytes - includes 2 cksum bytes
+ u16 cfg_byte6; /* Config Byte 6 */
+ u16 pme_capab; /* Power Mgment capabilities */
+ u16 nw_clk_ctrls; /* NetworkClockControls */
+ u8 fru_format; /* Alacritech FRU format type */
+ struct atk_fru atk_fru; /* Alacritech FRU information */
+ u8 oem_fru_format; /* optional OEM FRU format type */
+ union oemfru oem_fru; /* optional OEM FRU information */
+ u8 pad[4]; /* Pad to 128 bytes - includes 2 cksum bytes
* (if OEM FRU info exists) and two unusable
* bytes at the end
*/
@@ -577,46 +577,46 @@ struct slic_eeprom {

/* SLIC EEPROM structure for Oasis */
struct oslic_eeprom {
- u16 Id; /* 00 EEPROM/FLASH Magic code 'A5A5' */
- u16 EecodeSize; /* 01 Size of EEPROM Codes (bytes * 4)*/
- u16 FlashConfig0; /* 02 Flash Config for SPI device 0 */
- u16 FlashConfig1; /* 03 Flash Config for SPI device 1 */
- u16 VendorId; /* 04 Vendor ID */
- u16 DeviceId; /* 05 Device ID (function 0) */
- u8 RevisionId; /* 06 Revision ID */
- u8 ClassCode[3]; /* 07 Class Code for PCI function 0 */
- u8 IntPin1; /* 08 Interrupt pin for PCI function 1*/
- u8 ClassCode2[3]; /* 09 Class Code for PCI function 1 */
- u8 IntPin2; /* 10 Interrupt pin for PCI function 2*/
- u8 IntPin0; /* Interrupt pin for PCI function 0*/
- u8 MinGrant; /* 11 Minimum grant */
- u8 MaxLat; /* Maximum Latency */
- u16 SubSysVId; /* 12 Subsystem Vendor Id */
- u16 SubSysId; /* 13 Subsystem ID */
- u16 FlashSize; /* 14 Flash size (bytes / 4K) */
- u16 DSize2Pci; /* 15 DRAM size to PCI (bytes / 64K) */
- u16 RSize2Pci; /* 16 Flash (ROM extension) size to PCI
+ u16 id; /* 00 EEPROM/FLASH Magic code 'A5A5' */
+ u16 eecode_size; /* 01 Size of EEPROM Codes (bytes * 4)*/
+ u16 flash_config0; /* 02 Flash Config for SPI device 0 */
+ u16 flash_config1; /* 03 Flash Config for SPI device 1 */
+ u16 vendor_id; /* 04 Vendor ID */
+ u16 device_id; /* 05 Device ID (function 0) */
+ u8 revision_id; /* 06 Revision ID */
+ u8 class_code[3]; /* 07 Class Code for PCI function 0 */
+ u8 int_pin1; /* 08 Interrupt pin for PCI function 1*/
+ u8 class_code2[3]; /* 09 Class Code for PCI function 1 */
+ u8 int_pin2; /* 10 Interrupt pin for PCI function 2*/
+ u8 int_pin0; /* Interrupt pin for PCI function 0*/
+ u8 min_grant; /* 11 Minimum grant */
+ u8 max_lat; /* Maximum Latency */
+ u16 sub_sys_vid; /* 12 Subsystem Vendor Id */
+ u16 sub_sys_id; /* 13 Subsystem ID */
+ u16 flash_size; /* 14 Flash size (bytes / 4K) */
+ u16 dsize2pci; /* 15 DRAM size to PCI (bytes / 64K) */
+ u16 rsize2pci; /* 16 Flash (ROM extension) size to PCI
* (bytes / 4K)
*/
- u16 DeviceId1; /* 17 Device Id (function 1) */
- u16 DeviceId2; /* 18 Device Id (function 2) */
- u16 CfgByte6; /* 19 Device Status Config Bytes 6-7 */
- u16 PMECapab; /* 20 Power Mgment capabilities */
- u8 MSICapab; /* 21 MSI capabilities */
- u8 ClockDivider; /* Clock divider */
- u16 PciStatusLow; /* 22 PCI Status bits 15:0 */
- u16 PciStatusHigh; /* 23 PCI Status bits 31:16 */
- u16 DramConfigLow; /* 24 DRAM Configuration bits 15:0 */
- u16 DramConfigHigh; /* 25 DRAM Configuration bits 31:16 */
- u16 DramSize; /* 26 DRAM size (bytes / 64K) */
- u16 GpioTbiCtl; /* 27 GPIO/TBI controls for functions 1/0 */
- u16 EepromSize; /* 28 EEPROM Size */
- struct slic_config_mac MacInfo[2]; /* 29 MAC addresses (2 ports) */
- u8 FruFormat; /* 35 Alacritech FRU format type */
- struct atk_fru AtkFru; /* Alacritech FRU information */
- u8 OemFruFormat; /* optional OEM FRU format type */
- union oemfru OemFru; /* optional OEM FRU information */
- u8 Pad[4]; /* Pad to 128 bytes - includes 2 checksum bytes
+ u16 device_id1; /* 17 Device Id (function 1) */
+ u16 device_id2; /* 18 Device Id (function 2) */
+ u16 cfg_byte6; /* 19 Device Status Config Bytes 6-7 */
+ u16 pme_capab; /* 20 Power Mgment capabilities */
+ u8 msi_capab; /* 21 MSI capabilities */
+ u8 clock_divider; /* Clock divider */
+ u16 pci_status_low; /* 22 PCI Status bits 15:0 */
+ u16 pci_status_high; /* 23 PCI Status bits 31:16 */
+ u16 dram_config_low; /* 24 DRAM Configuration bits 15:0 */
+ u16 dram_config_high; /* 25 DRAM Configuration bits 31:16 */
+ u16 dram_size; /* 26 DRAM size (bytes / 64K) */
+ u16 gpio_tbi_ctl; /* 27 GPIO/TBI controls for functions 1/0 */
+ u16 eeprom_size; /* 28 EEPROM Size */
+ struct slic_config_mac mac_info[2]; /* 29 MAC addresses (2 ports) */
+ u8 fru_format; /* 35 Alacritech FRU format type */
+ struct atk_fru atk_fru; /* Alacritech FRU information */
+ u8 oem_fru_format; /* optional OEM FRU format type */
+ union oemfru oem_fru; /* optional OEM FRU information */
+ u8 pad[4]; /* Pad to 128 bytes - includes 2 checksum bytes
* (if OEM FRU info exists) and two unusable
* bytes at the end
*/
@@ -633,18 +633,18 @@ struct oslic_eeprom {
* SlicGetConfigData()
*/
struct slic_config {
- bool EepromValid; /* Valid EEPROM flag (checksum good?) */
- u16 DramSize; /* DRAM size (bytes / 64K) */
- struct slic_config_mac MacInfo[SLIC_NBR_MACS]; /* MAC addresses */
- u8 FruFormat; /* Alacritech FRU format type */
- struct atk_fru AtkFru; /* Alacritech FRU information */
- u8 OemFruFormat; /* optional OEM FRU format type */
+ bool eeprom_valid; /* Valid EEPROM flag (checksum good?) */
+ u16 dram_size; /* DRAM size (bytes / 64K) */
+ struct slic_config_mac mac_info[SLIC_NBR_MACS]; /* MAC addresses */
+ u8 fru_format; /* Alacritech FRU format type */
+ struct atk_fru atk_fru; /* Alacritech FRU information */
+ u8 oem_fru_format; /* optional OEM FRU format type */
union {
struct vendor1_fru vendor1_fru;
struct vendor2_fru vendor2_fru;
struct vendor3_fru vendor3_fru;
struct vendor4_fru vendor4_fru;
- } OemFru;
+ } oem_fru;
};

#pragma pack()
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index be62256..e43a339 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -540,7 +540,7 @@ static void slic_adapter_set_hwaddr(struct adapter *adapter)

if ((adapter->card) && (card->config_set)) {
memcpy(adapter->macaddr,
- card->config.MacInfo[adapter->functionnumber].macaddrA,
+ card->config.mac_info[adapter->functionnumber].macaddr_a,
sizeof(struct slic_config_mac));
if (is_zero_ether_addr(adapter->currmacaddr))
memcpy(adapter->currmacaddr, adapter->macaddr,
@@ -1876,8 +1876,8 @@ static void slic_rcv_handle_error(struct adapter *adapter,
if (hdr->frame_status_b14 & VRHSTATB_IPHERR)
adapter->if_events.ip_hlen++;
} else {
- if (hdr->frame_statusGB & VGBSTAT_XPERR) {
- u32 xerr = hdr->frame_statusGB >> VGBSTAT_XERRSHFT;
+ if (hdr->frame_status_gb & VGBSTAT_XPERR) {
+ u32 xerr = hdr->frame_status_gb >> VGBSTAT_XERRSHFT;

if (xerr == VGBSTAT_XCSERR)
adapter->if_events.tp_csum++;
@@ -1886,10 +1886,10 @@ static void slic_rcv_handle_error(struct adapter *adapter,
if (xerr == VGBSTAT_XHLEN)
adapter->if_events.tp_hlen++;
}
- if (hdr->frame_statusGB & VGBSTAT_NETERR) {
+ if (hdr->frame_status_gb & VGBSTAT_NETERR) {
u32 nerr =
(hdr->
- frame_statusGB >> VGBSTAT_NERRSHFT) &
+ frame_status_gb >> VGBSTAT_NERRSHFT) &
VGBSTAT_NERRMSK;
if (nerr == VGBSTAT_NCSERR)
adapter->if_events.ip_csum++;
@@ -1898,8 +1898,8 @@ static void slic_rcv_handle_error(struct adapter *adapter,
if (nerr == VGBSTAT_NHLEN)
adapter->if_events.ip_hlen++;
}
- if (hdr->frame_statusGB & VGBSTAT_LNKERR) {
- u32 lerr = hdr->frame_statusGB & VGBSTAT_LERRMSK;
+ if (hdr->frame_status_gb & VGBSTAT_LNKERR) {
+ u32 lerr = hdr->frame_status_gb & VGBSTAT_LERRMSK;

if (lerr == VGBSTAT_LDEARLY)
adapter->if_events.rcvearly++;
@@ -2682,13 +2682,13 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
case SLIC_2GB_DEVICE_ID:
/* extract EEPROM data and pointers to EEPROM data */
pOeeprom = (struct oslic_eeprom *)peeprom;
- eecodesize = pOeeprom->EecodeSize;
- dramsize = pOeeprom->DramSize;
- pmac = pOeeprom->MacInfo;
- fruformat = pOeeprom->FruFormat;
- patkfru = &pOeeprom->AtkFru;
- oemfruformat = pOeeprom->OemFruFormat;
- poemfru = &pOeeprom->OemFru;
+ eecodesize = pOeeprom->eecode_size;
+ dramsize = pOeeprom->dram_size;
+ pmac = pOeeprom->mac_info;
+ fruformat = pOeeprom->fru_format;
+ patkfru = &pOeeprom->atk_fru;
+ oemfruformat = pOeeprom->oem_fru_format;
+ poemfru = &pOeeprom->oem_fru;
macaddrs = 2;
/*
* Minor kludge for Oasis card
@@ -2699,17 +2699,17 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
break;
default:
/* extract EEPROM data and pointers to EEPROM data */
- eecodesize = peeprom->EecodeSize;
- dramsize = peeprom->DramSize;
- pmac = peeprom->u2.mac.MacInfo;
- fruformat = peeprom->FruFormat;
- patkfru = &peeprom->AtkFru;
- oemfruformat = peeprom->OemFruFormat;
- poemfru = &peeprom->OemFru;
+ eecodesize = peeprom->eecode_size;
+ dramsize = peeprom->dram_size;
+ pmac = peeprom->u2.mac.mac_info;
+ fruformat = peeprom->fru_format;
+ patkfru = &peeprom->atk_fru;
+ oemfruformat = peeprom->oem_fru_format;
+ poemfru = &peeprom->oem_fru;
break;
}

- card->config.EepromValid = false;
+ card->config.eeprom_valid = false;

/* see if the EEPROM is valid by checking it's checksum */
if ((eecodesize <= MAX_EECODE_SIZE) &&
@@ -2726,26 +2726,26 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
* we wouldn't need this
*/
if (ee_chksum == calc_chksum)
- card->config.EepromValid = true;
+ card->config.eeprom_valid = true;
}
/* copy in the DRAM size */
- card->config.DramSize = dramsize;
+ card->config.dram_size = dramsize;

/* copy in the MAC address(es) */
for (i = 0; i < macaddrs; i++) {
- memcpy(&card->config.MacInfo[i],
+ memcpy(&card->config.mac_info[i],
&pmac[i], sizeof(struct slic_config_mac));
}

/* copy the Alacritech FRU information */
- card->config.FruFormat = fruformat;
- memcpy(&card->config.AtkFru, patkfru, sizeof(struct atk_fru));
+ card->config.fru_format = fruformat;
+ memcpy(&card->config.atk_fru, patkfru, sizeof(struct atk_fru));

pci_free_consistent(adapter->pcidev,
sizeof(struct slic_eeprom),
peeprom, phys_config);

- if (!card->config.EepromValid) {
+ if (!card->config.eeprom_valid) {
slic_write64(adapter, SLIC_REG_ISP, 0, 0);
slic_flush_write(adapter);
dev_err(&adapter->pcidev->dev, "EEPROM invalid.\n");
--
1.9.1

2016-11-18 17:57:53

by Sergio Paracuellos

[permalink] [raw]
Subject: [PATCH 6/6] staging: slicoss: avoid CamelCases slicoss.c

Replace CamelCases to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <[email protected]>
---
drivers/staging/slicoss/slicoss.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index e43a339..b2f8ad3 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -629,15 +629,15 @@ static void slic_mac_config(struct adapter *adapter)
static void slic_config_set(struct adapter *adapter, bool linkchange)
{
u32 value;
- u32 RcrReset;
+ u32 rcr_reset;

if (linkchange) {
/* Setup MAC */
slic_mac_config(adapter);
- RcrReset = GRCR_RESET;
+ rcr_reset = GRCR_RESET;
} else {
slic_mac_address_config(adapter);
- RcrReset = 0;
+ rcr_reset = 0;
}

if (adapter->linkduplex == LINK_FULLD) {
@@ -649,7 +649,7 @@ static void slic_config_set(struct adapter *adapter, bool linkchange)
slic_write32(adapter, SLIC_REG_WXCFG, value);

/* Setup rcvcfg last */
- value = (RcrReset | /* Reset, if linkchange */
+ value = (rcr_reset | /* Reset, if linkchange */
GRCR_CTLEN | /* Enable CTL frames */
GRCR_ADDRAEN | /* Address A enable */
GRCR_RCVBAD | /* Rcv bad frames */
@@ -662,7 +662,7 @@ static void slic_config_set(struct adapter *adapter, bool linkchange)
slic_write32(adapter, SLIC_REG_WXCFG, value);

/* Setup rcvcfg last */
- value = (RcrReset | /* Reset, if linkchange */
+ value = (rcr_reset | /* Reset, if linkchange */
GRCR_ADDRAEN | /* Address A enable */
GRCR_RCVBAD | /* Rcv bad frames */
(GRCR_HASHSIZE << GRCR_HASHSIZE_SHIFT));
@@ -2585,7 +2585,7 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
struct slic_shmemory *sm = &adapter->shmem;
struct slic_shmem_data *sm_data = sm->shmem_data;
struct slic_eeprom *peeprom;
- struct oslic_eeprom *pOeeprom;
+ struct oslic_eeprom *poeeprom;
dma_addr_t phys_config;
u32 phys_configh;
u32 phys_configl;
@@ -2681,14 +2681,14 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
/* Oasis card */
case SLIC_2GB_DEVICE_ID:
/* extract EEPROM data and pointers to EEPROM data */
- pOeeprom = (struct oslic_eeprom *)peeprom;
- eecodesize = pOeeprom->eecode_size;
- dramsize = pOeeprom->dram_size;
- pmac = pOeeprom->mac_info;
- fruformat = pOeeprom->fru_format;
- patkfru = &pOeeprom->atk_fru;
- oemfruformat = pOeeprom->oem_fru_format;
- poemfru = &pOeeprom->oem_fru;
+ poeeprom = (struct oslic_eeprom *)peeprom;
+ eecodesize = poeeprom->eecode_size;
+ dramsize = poeeprom->dram_size;
+ pmac = poeeprom->mac_info;
+ fruformat = poeeprom->fru_format;
+ patkfru = &poeeprom->atk_fru;
+ oemfruformat = poeeprom->oem_fru_format;
+ poemfru = &poeeprom->oem_fru;
macaddrs = 2;
/*
* Minor kludge for Oasis card
--
1.9.1

2016-11-18 17:58:09

by Sergio Paracuellos

[permalink] [raw]
Subject: [PATCH 4/6] staging: slicoss: braces should be used on all arms of this statement

Add braces in if statement to comply with the standard
kernel coding style.

Signed-off-by: Sergio Paracuellos <[email protected]>
---
drivers/staging/slicoss/slicoss.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 4ea5df6..be62256 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -784,9 +784,9 @@ static void slic_timer_load_check(ulong cardaddr)
if ((adapter) && (adapter->state == ADAPT_UP) &&
(card->state == CARD_UP) && (slic_global.dynamic_intagg)) {
if (adapter->devid == SLIC_1GB_DEVICE_ID) {
- if (adapter->linkspeed == LINK_1000MB)
+ if (adapter->linkspeed == LINK_1000MB) {
level = 100;
- else {
+ } else {
if (load > SLIC_LOAD_5)
level = SLIC_INTAGG_5;
else if (load > SLIC_LOAD_4)
--
1.9.1

2016-11-18 17:58:13

by Sergio Paracuellos

[permalink] [raw]
Subject: [PATCH 3/6] staging: slicoss: logical continuations should be on the previous line

Move logical or operator to previous line to comply with
the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <[email protected]>
---
drivers/staging/slicoss/slicoss.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index f8b956f..4ea5df6 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -614,8 +614,8 @@ static void slic_mac_config(struct adapter *adapter)
value |= GMCR_GBIT;

/* enable fullduplex */
- if ((adapter->linkduplex == LINK_FULLD)
- || (adapter->macopts & MAC_LOOPBACK)) {
+ if ((adapter->linkduplex == LINK_FULLD) ||
+ (adapter->macopts & MAC_LOOPBACK)) {
value |= GMCR_FULLD;
}

--
1.9.1

2016-11-18 17:58:49

by Sergio Paracuellos

[permalink] [raw]
Subject: [PATCH 2/6] staging: slicoss: fix parenthesis alignment in slicoss.c

This patch fix open parenthesis alignment matching in slicoss.c
file to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos <[email protected]>
---
drivers/staging/slicoss/slicoss.c | 68 +++++++++++++++++++--------------------
1 file changed, 33 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index db93654..f8b956f 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -191,7 +191,7 @@ static void slic_timer_ping(ulong dev)
*
*/
static void slic_link_config(struct adapter *adapter,
- u32 linkspeed, u32 linkduplex)
+ u32 linkspeed, u32 linkduplex)
{
u32 speed;
u32 duplex;
@@ -706,7 +706,7 @@ static void slic_config_clear(struct adapter *adapter)
}

static bool slic_mac_filter(struct adapter *adapter,
- struct ether_header *ether_frame)
+ struct ether_header *ether_frame)
{
struct net_device *netdev = adapter->netdev;
u32 opts = adapter->macopts;
@@ -829,10 +829,10 @@ static void slic_timer_load_check(ulong cardaddr)
}

static int slic_upr_queue_request(struct adapter *adapter,
- u32 upr_request,
- u32 upr_data,
- u32 upr_data_h,
- u32 upr_buffer, u32 upr_buffer_h)
+ u32 upr_request,
+ u32 upr_data,
+ u32 upr_data_h,
+ u32 upr_buffer, u32 upr_buffer_h)
{
struct slic_upr *upr;
struct slic_upr *uprqueue;
@@ -898,19 +898,19 @@ static void slic_upr_start(struct adapter *adapter)
}

static int slic_upr_request(struct adapter *adapter,
- u32 upr_request,
- u32 upr_data,
- u32 upr_data_h,
- u32 upr_buffer, u32 upr_buffer_h)
+ u32 upr_request,
+ u32 upr_data,
+ u32 upr_data_h,
+ u32 upr_buffer, u32 upr_buffer_h)
{
unsigned long flags;
int rc;

spin_lock_irqsave(&adapter->upr_lock, flags);
rc = slic_upr_queue_request(adapter,
- upr_request,
- upr_data,
- upr_data_h, upr_buffer, upr_buffer_h);
+ upr_request,
+ upr_data,
+ upr_data_h, upr_buffer, upr_buffer_h);
if (rc)
goto err_unlock_irq;

@@ -1420,7 +1420,7 @@ static struct slic_hostcmd *slic_cmdq_getfree(struct adapter *adapter)
}

static void slic_cmdq_putdone_irq(struct adapter *adapter,
- struct slic_hostcmd *cmd)
+ struct slic_hostcmd *cmd)
{
struct slic_cmdqueue *cmdq = &adapter->cmdq_done;

@@ -1469,17 +1469,17 @@ static int slic_rcvqueue_fill(struct adapter *adapter)
__func__);
dev_err(dev, "skb[%p] PROBLEM\n", skb);
dev_err(dev, " skbdata[%p]\n",
- skb->data);
+ skb->data);
dev_err(dev, " skblen[%x]\n", skb->len);
dev_err(dev, " paddr[%p]\n", paddr);
dev_err(dev, " paddrl[%x]\n", paddrl);
dev_err(dev, " paddrh[%x]\n", paddrh);
dev_err(dev, " rcvq->head[%p]\n",
- rcvq->head);
+ rcvq->head);
dev_err(dev, " rcvq->tail[%p]\n",
- rcvq->tail);
+ rcvq->tail);
dev_err(dev, " rcvq->count[%x]\n",
- rcvq->count);
+ rcvq->count);
dev_err(dev, "SKIP THIS SKB!!!!!!!!\n");
goto retry_rcvqfill;
}
@@ -1489,17 +1489,17 @@ static int slic_rcvqueue_fill(struct adapter *adapter)
__func__);
dev_err(dev, "skb[%p] PROBLEM\n", skb);
dev_err(dev, " skbdata[%p]\n",
- skb->data);
+ skb->data);
dev_err(dev, " skblen[%x]\n", skb->len);
dev_err(dev, " paddr[%p]\n", paddr);
dev_err(dev, " paddrl[%x]\n", paddrl);
dev_err(dev, " paddrh[%x]\n", paddrh);
dev_err(dev, " rcvq->head[%p]\n",
- rcvq->head);
+ rcvq->head);
dev_err(dev, " rcvq->tail[%p]\n",
- rcvq->tail);
+ rcvq->tail);
dev_err(dev, " rcvq->count[%x]\n",
- rcvq->count);
+ rcvq->count);
dev_err(dev, "GIVE TO CARD ANYWAY\n");
}
#endif
@@ -1764,7 +1764,8 @@ static void slic_mcast_set_list(struct net_device *dev)
#define XMIT_FAIL_HOSTCMD_FAIL 3

static void slic_xmit_build_request(struct adapter *adapter,
- struct slic_hostcmd *hcmd, struct sk_buff *skb)
+ struct slic_hostcmd *hcmd,
+ struct sk_buff *skb)
{
struct slic_host64_cmd *ihcmd;
ulong phys_addr;
@@ -1775,7 +1776,7 @@ static void slic_xmit_build_request(struct adapter *adapter,
ihcmd->command = IHCMD_XMT_REQ;
ihcmd->u.slic_buffers.totlen = skb->len;
phys_addr = pci_map_single(adapter->pcidev, skb->data, skb->len,
- PCI_DMA_TODEVICE);
+ PCI_DMA_TODEVICE);
if (pci_dma_mapping_error(adapter->pcidev, phys_addr)) {
kfree_skb(skb);
dev_err(&adapter->pcidev->dev, "DMA mapping error\n");
@@ -1794,8 +1795,8 @@ static void slic_xmit_build_request(struct adapter *adapter,
}

static void slic_xmit_fail(struct adapter *adapter,
- struct sk_buff *skb,
- void *cmd, u32 skbtype, u32 status)
+ struct sk_buff *skb,
+ void *cmd, u32 skbtype, u32 status)
{
if (adapter->xmitq_full)
netif_stop_queue(adapter->netdev);
@@ -1828,7 +1829,7 @@ static void slic_xmit_fail(struct adapter *adapter,
}

static void slic_rcv_handle_error(struct adapter *adapter,
- struct slic_rcvbuf *rcvbuf)
+ struct slic_rcvbuf *rcvbuf)
{
struct slic_hddr_wds *hdr = (struct slic_hddr_wds *)rcvbuf->data;
struct net_device *netdev = adapter->netdev;
@@ -2003,7 +2004,7 @@ static void slic_xmit_complete(struct adapter *adapter)
}

static void slic_interrupt_card_up(u32 isr, struct adapter *adapter,
- struct net_device *dev)
+ struct net_device *dev)
{
if (isr & ~ISR_IO) {
if (isr & ISR_ERR) {
@@ -2030,12 +2031,10 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter,
}
} else if (isr & ISR_XDROP) {
dev_err(&dev->dev,
- "isr & ISR_ERR [%x] ISR_XDROP\n",
- isr);
+ "isr & ISR_ERR [%x] ISR_XDROP\n", isr);
} else {
dev_err(&dev->dev,
- "isr & ISR_ERR [%x]\n",
- isr);
+ "isr & ISR_ERR [%x]\n", isr);
}
}

@@ -2740,8 +2739,7 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)

/* copy the Alacritech FRU information */
card->config.FruFormat = fruformat;
- memcpy(&card->config.AtkFru, patkfru,
- sizeof(struct atk_fru));
+ memcpy(&card->config.AtkFru, patkfru, sizeof(struct atk_fru));

pci_free_consistent(adapter->pcidev,
sizeof(struct slic_eeprom),
@@ -2968,7 +2966,7 @@ static u32 slic_card_locate(struct adapter *adapter)
}

static int slic_entry_probe(struct pci_dev *pcidev,
- const struct pci_device_id *pci_tbl_entry)
+ const struct pci_device_id *pci_tbl_entry)
{
static int cards_found;
static int did_version;
--
1.9.1