Skip to contentSkip to conversation

staging: slicoss: Fixes multiple checkpatch issues

PATCH Superseded Amarjargal Gundjalam 2 participants 13 messages Oct 24, 2015 – Oct 25, 2015 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: slicoss: Fixes multiple checkpatch issues

This patchset fixes multiple checkpatch checks and warnings.

Amarjargal Gundjalam (4):
staging: slicoss: Removes multiple blank lines
staging: slicoss: Removes unnecessary space after a cast
staging: slicoss: Adds space around operators
staging: slicoss: Fixes block comment style

 drivers/staging/slicoss/slic.h    |   20 +++---
 drivers/staging/slicoss/slichw.h  |   31 ++++++----
 drivers/staging/slicoss/slicoss.c |  122 ++++++++++++++++++-------------------
 3 files changed, 88 insertions(+), 85 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/4 staging: slicoss: Removes multiple blank lines

This patch fixes the checkpatch.pl check:

CHECK: Please don't use multiple blank lines

---
 drivers/staging/slicoss/slic.h    |    2 --
 drivers/staging/slicoss/slicoss.c |    5 -----
 2 files changed, 7 deletions(-)
drivers/staging/slicoss/slic.h +0 -2
index 00b8af6..6ccd1d5 100644
@@ -166,7 +166,6 @@ struct slic_cmdqueue {
 #define SLIC_MAX_CARDS              32
 #define SLIC_MAX_PORTS              4        /* Max # of ports per card   */
 
-
 struct mcast_address {
 	unsigned char address[6];
 	struct mcast_address *next;
@@ -485,7 +484,6 @@ struct adapter {
 	struct slicnet_stats     slic_stats;
 };
 
-
 #define UPDATE_STATS(largestat, newstat, oldstat)                        \
 {                                                                        \
 	if ((newstat) < (oldstat))                                       \
drivers/staging/slicoss/slicoss.c +0 -5
index 3600176..a226055 100644
@@ -54,7 +54,6 @@
  *       IS-NIC driver.
  */
 
-
 #define KLUDGE_FOR_4GB_BOUNDARY         1
 #define DEBUG_MICROCODE                 1
 #define DBG                             1
@@ -1149,7 +1148,6 @@ static u16 slic_eeprom_cksum(void *eeprom, unsigned len)
 	if (len > 0)
 		checksum += *(u8 *) wp;
 
-
 	while (checksum >> 16)
 		checksum = (checksum & 0xFFFF) + ((checksum >> 16) & 0xFFFF);
 
@@ -2131,7 +2129,6 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter,
 	}
 }
 
-
 static irqreturn_t slic_interrupt(int irq, void *dev_id)
 {
 	struct net_device *dev = dev_id;
@@ -2228,7 +2225,6 @@ xmit_fail:
 	goto xmit_done;
 }
 
-
 static void slic_adapter_freeresources(struct adapter *adapter)
 {
 	slic_init_cleanup(adapter);
@@ -3099,7 +3095,6 @@ static int slic_entry_probe(struct pci_dev *pcidev,
 	mmio_start = pci_resource_start(pcidev, 0);
 	mmio_len = pci_resource_len(pcidev, 0);
 
-
 /*	memmapped_ioaddr =  (u32)ioremap_nocache(mmio_start, mmio_len);*/
 	memmapped_ioaddr = ioremap(mmio_start, mmio_len);
 	if (!memmapped_ioaddr) {
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/4 staging: slicoss: Removes unnecessary space after a cast

In reply to Amarjargal Gundjalam

This patch fixes the checkpatch.pl check:

CHECK: No space is necessary after a cast

---
 drivers/staging/slicoss/slicoss.c |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)
drivers/staging/slicoss/slicoss.c +18 -18
index a226055..c88ed69 100644
@@ -168,7 +168,7 @@ static void slic_mcast_set_bit(struct adapter *adapter, char *address)
 	crcpoly &= 0x3F;
 
 	/* OR in the new bit into our 64 bit mask. */
-	adapter->mcastmask |= (u64) 1 << crcpoly;
+	adapter->mcastmask |= (u64)1 << crcpoly;
 }
 
 static void slic_mcast_set_mask(struct adapter *adapter)
@@ -592,11 +592,11 @@ static void slic_mac_address_config(struct adapter *adapter)
 	u32 value2;
 	__iomem struct slic_regs *slic_regs = adapter->slic_regs;
 
-	value = ntohl(*(__be32 *) &adapter->currmacaddr[2]);
+	value = ntohl(*(__be32 *)&adapter->currmacaddr[2]);
 	slic_reg32_write(&slic_regs->slic_wraddral, value, FLUSH);
 	slic_reg32_write(&slic_regs->slic_wraddrbl, value, FLUSH);
 
-	value2 = (u32) ((adapter->currmacaddr[0] << 8 |
+	value2 = (u32)((adapter->currmacaddr[0] << 8 |
 			     adapter->currmacaddr[1]) & 0xFFFF);
 
 	slic_reg32_write(&slic_regs->slic_wraddrah, value2, FLUSH);
@@ -970,7 +970,7 @@ static void slic_link_upr_complete(struct adapter *adapter, u32 isr)
 #else
 		slic_upr_queue_request(adapter,
 				       SLIC_UPR_RLSR,
-				       (u32) &pshmem->linkstatus,
+				       (u32)&pshmem->linkstatus,
 				       SLIC_GET_ADDR_HIGH(pshmem), 0, 0);
 #endif
 		return;
@@ -1040,7 +1040,7 @@ static void slic_upr_request_complete(struct adapter *adapter, u32 isr)
 	case SLIC_UPR_STATS:
 		{
 			struct slic_stats *slicstats =
-			    (struct slic_stats *) &adapter->pshmem->inicstats;
+			    (struct slic_stats *)&adapter->pshmem->inicstats;
 			struct slic_stats *newstats = slicstats;
 			struct slic_stats  *old = &adapter->inicstats_prev;
 			struct slicnet_stats *stst = &adapter->slic_stats;
@@ -1146,7 +1146,7 @@ static u16 slic_eeprom_cksum(void *eeprom, unsigned len)
 	}
 
 	if (len > 0)
-		checksum += *(u8 *) wp;
+		checksum += *(u8 *)wp;
 
 	while (checksum >> 16)
 		checksum = (checksum & 0xFFFF) + ((checksum >> 16) & 0xFFFF);
@@ -1244,7 +1244,7 @@ static void slic_cmdqmem_free(struct adapter *adapter)
 		if (cmdqmem->pages[i]) {
 			pci_free_consistent(adapter->pcidev,
 					    PAGE_SIZE,
-					    (void *) cmdqmem->pages[i],
+					    (void *)cmdqmem->pages[i],
 					    cmdqmem->dma_pages[i]);
 		}
 	}
@@ -1324,8 +1324,8 @@ static void slic_cmdq_addcmdpage(struct adapter *adapter, u32 *page)
 		adapter->pfree_slic_handles = pslic_handle->next;
 		spin_unlock_irqrestore(&adapter->handle_lock, flags);
 		pslic_handle->type = SLIC_HANDLE_CMD;
-		pslic_handle->address = (void *) cmd;
-		pslic_handle->offset = (ushort) adapter->slic_handle_ix++;
+		pslic_handle->address = (void *)cmd;
+		pslic_handle->offset = (ushort)adapter->slic_handle_ix++;
 		pslic_handle->other_handle = NULL;
 		pslic_handle->next = NULL;
 
@@ -1735,7 +1735,7 @@ static int slic_link_event_handler(struct adapter *adapter)
 				  0, 0);
 #else
 	status = slic_upr_request(adapter, SLIC_UPR_RLSR,
-		(u32) &pshmem->linkstatus,	/* no 4GB wrap guaranteed */
+		(u32)&pshmem->linkstatus,	/* no 4GB wrap guaranteed */
 				  0, 0, 0);
 #endif
 	return status;
@@ -1803,7 +1803,7 @@ static void slic_mcast_set_list(struct net_device *dev)
 	struct netdev_hw_addr *ha;
 
 	netdev_for_each_mc_addr(ha, dev) {
-		addresses = (char *) &ha->addr;
+		addresses = (char *)&ha->addr;
 		status = slic_mcast_add_list(adapter, addresses);
 		if (status != 0)
 			break;
@@ -1851,8 +1851,8 @@ static void slic_xmit_build_request(struct adapter *adapter,
 	ihcmd->u.slic_buffers.bufs[0].paddrh = SLIC_GET_ADDR_HIGH(phys_addr);
 	ihcmd->u.slic_buffers.bufs[0].length = skb->len;
 #if BITS_PER_LONG == 64
-	hcmd->cmdsize = (u32) ((((u64)&ihcmd->u.slic_buffers.bufs[1] -
-				     (u64) hcmd) + 31) >> 5);
+	hcmd->cmdsize = (u32)((((u64)&ihcmd->u.slic_buffers.bufs[1] -
+				     (u64)hcmd) + 31) >> 5);
 #else
 	hcmd->cmdsize = (((u32)&ihcmd->u.slic_buffers.bufs[1] -
 				       (u32)hcmd) + 31) >> 5;
@@ -2749,7 +2749,7 @@ 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;
+			pOeeprom = (struct oslic_eeprom *)peeprom;
 			eecodesize = pOeeprom->EecodeSize;
 			dramsize = pOeeprom->DramSize;
 			pmac = pOeeprom->MacInfo;
@@ -2782,7 +2782,7 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
 		    (eecodesize >= MIN_EECODE_SIZE)) {
 
 			ee_chksum =
-			    *(u16 *) ((char *) peeprom + (eecodesize - 2));
+			    *(u16 *)((char *)peeprom + (eecodesize - 2));
 			/*
 			    calculate the EEPROM checksum
 			*/
@@ -2945,11 +2945,11 @@ static u32 slic_card_locate(struct adapter *adapter)
 	}
 
 	hostid_reg =
-	    (u16 __iomem *) (((u8 __iomem *) (adapter->slic_regs)) +
+	    (u16 __iomem *)(((u8 __iomem *)(adapter->slic_regs)) +
 	    rdhostid_offset);
 
 	/* read the 16 bit hostid from SRAM */
-	card_hostid = (ushort) readw(hostid_reg);
+	card_hostid = (ushort)readw(hostid_reg);
 
 	/* Initialize a new card structure if need be */
 	if (card_hostid == SLIC_HOSTID_DEFAULT) {
@@ -3130,7 +3130,7 @@ static int slic_entry_probe(struct pci_dev *pcidev,
 
 	slic_adapter_set_hwaddr(adapter);
 
-	netdev->base_addr = (unsigned long) memmapped_ioaddr;
+	netdev->base_addr = (unsigned long)memmapped_ioaddr;
 	netdev->irq = adapter->irq;
 	netdev->netdev_ops = &slic_netdev_ops;
 
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/4 staging: slicoss: Adds space around operators

In reply to Amarjargal Gundjalam

This patch fixes the checkpatch.pl check:

CHECK: spaces preferred around that ‘’

---
 drivers/staging/slicoss/slic.h    |    4 ++--
 drivers/staging/slicoss/slicoss.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/slicoss/slic.h +2 -2
index 6ccd1d5..92c6862 100644
@@ -446,7 +446,7 @@ struct adapter {
 	*  SLIC Handles
 	*/
 	/* Object handles*/
-	struct slic_handle slic_handles[SLIC_CMDQ_MAXCMDS+1];
+	struct slic_handle slic_handles[SLIC_CMDQ_MAXCMDS + 1];
 	/* Free object handles*/
 	struct slic_handle *pfree_slic_handles;
 	/* Object handle list lock*/
@@ -512,6 +512,6 @@ struct adapter {
 #define FLUSH		true
 #define DONT_FLUSH	false
 
-#define SIOCSLICSETINTAGG        (SIOCDEVPRIVATE+10)
+#define SIOCSLICSETINTAGG        (SIOCDEVPRIVATE + 10)
 
 #endif /*  __SLIC_DRIVER_H__ */
drivers/staging/slicoss/slicoss.c +1 -1
index c88ed69..8ce9000 100644
@@ -160,7 +160,7 @@ static void slic_mcast_set_bit(struct adapter *adapter, char *address)
 	/* Get the CRC polynomial for the mac address */
 	/* we use bits 1-8 (lsb), bitwise reversed,
 	 * msb (= lsb bit 0 before bitrev) is automatically discarded */
-	crcpoly = ether_crc(ETH_ALEN, address)>>23;
+	crcpoly = ether_crc(ETH_ALEN, address) >> 23;
 
 	/* We only have space on the SLIC for 64 entries.  Lop
 	 * off the top two bits. (2^6 = 64)
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 4/4 staging: slicoss: Fixes block comment style

In reply to Amarjargal Gundjalam

This patch fixes the checkpatch.pl warnings:

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

---
 drivers/staging/slicoss/slic.h    |   14 +++----
 drivers/staging/slicoss/slichw.h  |   31 +++++++++------
 drivers/staging/slicoss/slicoss.c |   79 +++++++++++++++++++------------------
 3 files changed, 67 insertions(+), 57 deletions(-)
drivers/staging/slicoss/slic.h +7 -7
index 92c6862..823452c 100644
@@ -93,10 +93,10 @@ struct slic_rcvbuf_info {
 	u32     lastid;
 };
 /*
- SLIC Handle structure.  Used to restrict handle values to
- 32 bits by using an index rather than an address.
- Simplifies ucode in 64-bit systems
-*/
+ * SLIC Handle structure.  Used to restrict handle values to
+ * 32 bits by using an index rather than an address.
+ * Simplifies ucode in 64-bit systems
+ */
 struct slic_handle_word {
 	union {
 		struct {
@@ -334,9 +334,9 @@ struct physcard {
 	uint                adapters_allocd;
 
 /*  the following is not currently needed
-	u32              bridge_busnum;
-	u32              bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS];
-*/
+ *	u32              bridge_busnum;
+ *	u32              bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS];
+ */
 };
 
 struct base_driver {
drivers/staging/slicoss/slichw.h +19 -12
index 21cd02b..b55894d 100644
@@ -308,8 +308,9 @@ struct slic_regs {
 	u32	slic_hbar;	/* Header buffer address reg */
 	u32	pad4;
 	/* 31-8 - phy addr of set of contiguous hdr buffers
-	    7-0 - number of buffers passed
-	   Buffers are 256 bytes long on 256-byte boundaries. */
+	 *  7-0 - number of buffers passed
+	 * Buffers are 256 bytes long on 256-byte boundaries.
+	 */
 #define SLIC_HBAR		0x0020
 #define SLIC_HBAR_CNT_MSK	0x000000FF
 
@@ -322,9 +323,10 @@ struct slic_regs {
 
 	u32	slic_cbar;	/* Xmt Cmd buf addr regs.*/
 	/* 1 per XMT interface
-	   31-5 - phy addr of host command buffer
-	    4-0 - length of cmd in multiples of 32 bytes
-	   Buffers are 32 bytes up to 512 bytes long */
+	 * 31-5 - phy addr of host command buffer
+	 *  4-0 - length of cmd in multiples of 32 bytes
+	 * Buffers are 32 bytes up to 512 bytes long
+	 */
 #define SLIC_CBAR		0x0030
 #define SLIC_CBAR_LEN_MSK	0x0000001F
 #define SLIC_CBAR_ALIGN		0x00000020
@@ -336,9 +338,10 @@ struct slic_regs {
 
 	u32	slic_rbar;	/* Response buffer address reg.*/
 	u32	pad7;
-	 /*31-8 - phy addr of set of contiguous response buffers
-	  7-0 - number of buffers passed
-	 Buffers are 32 bytes long on 32-byte boundaries.*/
+	/* 31-8 - phy addr of set of contiguous response buffers
+	 *  7-0 - number of buffers passed
+	 * Buffers are 32 bytes long on 32-byte boundaries.
+	 */
 #define SLIC_RBAR		0x0038
 #define SLIC_RBAR_CNT_MSK	0x000000FF
 #define SLIC_RBAR_SIZE		32
@@ -430,7 +433,8 @@ struct slic_regs {
 #define SLIC_LOW_POWER	0x00e0
 
 	u32	slic_quiesce;	/* force slic into quiescent state
-				   before soft reset */
+				 * before soft reset
+				 */
 	u32	pad30;
 #define SLIC_QUIESCE	0x00e8
 
@@ -718,7 +722,8 @@ struct slic_eeprom {
 	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
-				    (simba/leone only) */
+				 *	(simba/leone only)
+				 */
 	u8 NetIntPin2;		/* Network Interface Pin 2 (simba/leone only)*/
 	union {
 		u8 NetIntPin3;	/* 18 Network Interface Pin 3 (simba only) */
@@ -748,7 +753,8 @@ struct slic_eeprom {
 	union oemfru OemFru;	/* 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 */
+				 * bytes at the end
+				 */
 };
 
 /* SLIC EEPROM structure for Oasis */
@@ -772,7 +778,8 @@ struct oslic_eeprom {
 	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
-					(bytes / 4K) */
+				 *	(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 */
drivers/staging/slicoss/slicoss.c +41 -38

167 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#5 lore raw

Re: [Outreachy kernel] [PATCH 4/4] staging: slicoss: Fixes block comment style

Quoted 32 lines · Amarjargal Gundjalam

This patch fixes the checkpatch.pl warnings:

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

---
 drivers/staging/slicoss/slic.h    |   14 +++----
 drivers/staging/slicoss/slichw.h  |   31 +++++++++------
 drivers/staging/slicoss/slicoss.c |   79 +++++++++++++++++++------------------
 3 files changed, 67 insertions(+), 57 deletions(-)
drivers/staging/slicoss/slic.h +4 -4
index 92c6862..823452c 100644
@@ -93,10 +93,10 @@ struct slic_rcvbuf_info {
 	u32     lastid;
 };
 /*
- SLIC Handle structure.  Used to restrict handle values to
- 32 bits by using an index rather than an address.
- Simplifies ucode in 64-bit systems
-*/
+ * SLIC Handle structure.  Used to restrict handle values to
+ * 32 bits by using an index rather than an address.
+ * Simplifies ucode in 64-bit systems
+ */
 struct slic_handle_word {
 	union {
 		struct {

drivers/staging/slicoss/slic.h struct physcard { · line 339

Quoted 9 lines
drivers/staging/slicoss/slic.h +3 -3
@@ -334,9 +334,9 @@ struct physcard {
 	uint                adapters_allocd;
 
 /*  the following is not currently needed
-	u32              bridge_busnum;
-	u32              bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS];
-*/
+ *	u32              bridge_busnum;
+ *	u32              bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS];
+ */

Typically, code under comments should just be dropped.

Also, I believe that the block comment format has a /* on the starting line by itself.

julia

Quoted 281 lines
drivers/staging/slicoss/slic.h +0 -0
 };
 
 struct base_driver {
drivers/staging/slicoss/slichw.h +19 -12
index 21cd02b..b55894d 100644
@@ -308,8 +308,9 @@ struct slic_regs {
 	u32	slic_hbar;	/* Header buffer address reg */
 	u32	pad4;
 	/* 31-8 - phy addr of set of contiguous hdr buffers
-	    7-0 - number of buffers passed
-	   Buffers are 256 bytes long on 256-byte boundaries. */
+	 *  7-0 - number of buffers passed
+	 * Buffers are 256 bytes long on 256-byte boundaries.
+	 */
 #define SLIC_HBAR		0x0020
 #define SLIC_HBAR_CNT_MSK	0x000000FF
 
@@ -322,9 +323,10 @@ struct slic_regs {
 
 	u32	slic_cbar;	/* Xmt Cmd buf addr regs.*/
 	/* 1 per XMT interface
-	   31-5 - phy addr of host command buffer
-	    4-0 - length of cmd in multiples of 32 bytes
-	   Buffers are 32 bytes up to 512 bytes long */
+	 * 31-5 - phy addr of host command buffer
+	 *  4-0 - length of cmd in multiples of 32 bytes
+	 * Buffers are 32 bytes up to 512 bytes long
+	 */
 #define SLIC_CBAR		0x0030
 #define SLIC_CBAR_LEN_MSK	0x0000001F
 #define SLIC_CBAR_ALIGN		0x00000020
@@ -336,9 +338,10 @@ struct slic_regs {
 
 	u32	slic_rbar;	/* Response buffer address reg.*/
 	u32	pad7;
-	 /*31-8 - phy addr of set of contiguous response buffers
-	  7-0 - number of buffers passed
-	 Buffers are 32 bytes long on 32-byte boundaries.*/
+	/* 31-8 - phy addr of set of contiguous response buffers
+	 *  7-0 - number of buffers passed
+	 * Buffers are 32 bytes long on 32-byte boundaries.
+	 */
 #define SLIC_RBAR		0x0038
 #define SLIC_RBAR_CNT_MSK	0x000000FF
 #define SLIC_RBAR_SIZE		32
@@ -430,7 +433,8 @@ struct slic_regs {
 #define SLIC_LOW_POWER	0x00e0
 
 	u32	slic_quiesce;	/* force slic into quiescent state
-				   before soft reset */
+				 * before soft reset
+				 */
 	u32	pad30;
 #define SLIC_QUIESCE	0x00e8
 
@@ -718,7 +722,8 @@ struct slic_eeprom {
 	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
-				    (simba/leone only) */
+				 *	(simba/leone only)
+				 */
 	u8 NetIntPin2;		/* Network Interface Pin 2 (simba/leone only)*/
 	union {
 		u8 NetIntPin3;	/* 18 Network Interface Pin 3 (simba only) */
@@ -748,7 +753,8 @@ struct slic_eeprom {
 	union oemfru OemFru;	/* 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 */
+				 * bytes at the end
+				 */
 };
 
 /* SLIC EEPROM structure for Oasis */
@@ -772,7 +778,8 @@ struct oslic_eeprom {
 	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
-					(bytes / 4K) */
+				 *	(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 */
drivers/staging/slicoss/slicoss.c +41 -38
index 8ce9000..7edf1b1 100644
@@ -159,7 +159,8 @@ static void slic_mcast_set_bit(struct adapter *adapter, char *address)
 
 	/* Get the CRC polynomial for the mac address */
 	/* we use bits 1-8 (lsb), bitwise reversed,
-	 * msb (= lsb bit 0 before bitrev) is automatically discarded */
+	 * msb (= lsb bit 0 before bitrev) is automatically discarded
+	 */
 	crcpoly = ether_crc(ETH_ALEN, address) >> 23;
 
 	/* We only have space on the SLIC for 64 entries.  Lop
@@ -261,15 +262,18 @@ static void slic_link_config(struct adapter *adapter,
 				slic_reg32_write(wphy, phy_config, FLUSH);
 			} else {	/* forced 1000 Mb FD*/
 				/* power down phy to break link
-				   this may not work) */
+				 * this may not work)
+				 */
 				phy_config = (MIICR_REG_PCR | PCR_POWERDOWN);
 				slic_reg32_write(wphy, phy_config, FLUSH);
 				/* wait, Marvell says 1 sec,
-				   try to get away with 10 ms  */
+				 * try to get away with 10 ms
+				 */
 				mdelay(10);
 
 				/* disable auto-neg, set speed/duplex,
-				   soft reset phy, powerup */
+				 * soft reset phy, powerup
+				 */
 				phy_config =
 				    (MIICR_REG_PCR |
 				     (PCR_RESET | PCR_SPEED_1000 |
@@ -290,8 +294,9 @@ static void slic_link_config(struct adapter *adapter,
 				     (PAR_ADV100FD | PAR_ADV100HD | PAR_ADV10FD
 				      | PAR_ADV10HD));
 			} else {
-			/* linkspeed == LINK_1000MB -
-			   don't advertise 10/100 Mb modes  */
+			/* linkspeed == LINK_1000MB - 
+			 * don't advertise 10/100 Mb modes
+			 */
 				phy_advreg = MIICR_REG_4;
 			}
 			/* enable PAUSE frames  */
@@ -304,8 +309,7 @@ static void slic_link_config(struct adapter *adapter,
 			slic_reg32_write(wphy, phy_gctlreg, FLUSH);
 
 			if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) {
-				/* if a Marvell PHY
-				   enable auto crossover */
+				/* if a Marvell PHY enable auto crossover */
 				phy_config =
 				    (MIICR_REG_16 | (MRV_REG16_XOVERON));
 				slic_reg32_write(wphy, phy_config, FLUSH);
@@ -336,8 +340,7 @@ static void slic_link_config(struct adapter *adapter,
 			duplex = PCR_DUPLEX_FULL;
 
 		if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) {
-			/* if a Marvell PHY
-			   disable auto crossover  */
+			/* if a Marvell PHY disable auto crossover  */
 			phy_config = (MIICR_REG_16 | (MRV_REG16_XOVEROFF));
 			slic_reg32_write(wphy, phy_config, FLUSH);
 		}
@@ -351,8 +354,9 @@ static void slic_link_config(struct adapter *adapter,
 
 		if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) {
 			/* if a Marvell PHY
-			   disable auto-neg, set speed,
-			   soft reset phy, powerup */
+			 * disable auto-neg, set speed,
+			 * soft reset phy, powerup
+			 */
 			phy_config =
 			    (MIICR_REG_PCR | (PCR_RESET | speed | duplex));
 			slic_reg32_write(wphy, phy_config, FLUSH);
@@ -529,11 +533,12 @@ static int slic_card_download(struct adapter *adapter)
 			index += 4;
 
 			/* Check SRAM location zero. If it is non-zero. Abort.*/
-/*			failure = readl((u32 __iomem *)&slic_regs->slic_reset);
-			if (failure) {
-				release_firmware(fw);
-				return -EIO;
-			}*/
+			/* failure = readl((u32 __iomem *)&slic_regs->slic_reset);
+			 * if (failure) {
+			 * 	release_firmware(fw);
+			 *	return -EIO;
+			 * }
+			 */
 		}
 	}
 	release_firmware(fw);
@@ -542,7 +547,8 @@ static int slic_card_download(struct adapter *adapter)
 	slic_reg32_write(&slic_regs->slic_wcs, SLIC_WCS_START, FLUSH);
 
 	/* stall for 20 ms, long enough for ucode to init card
-	   and reach mainloop */
+	 * and reach mainloop
+	 */
 	mdelay(20);
 
 	return 0;
@@ -885,10 +891,10 @@ static void slic_upr_start(struct adapter *adapter)
 	struct slic_upr *upr;
 	__iomem struct slic_regs *slic_regs = adapter->slic_regs;
 /*
-    char * ptr1;
-    char * ptr2;
-    uint cmdoffset;
-*/
+ *  char * ptr1;
+ *  char * ptr2;
+ *  uint cmdoffset;
+ */
 	upr = adapter->upr_list;
 	if (!upr)
 		return;
@@ -2048,9 +2054,7 @@ static void slic_xmit_complete(struct adapter *adapter)
 			break;
 		adapter->xmit_completes++;
 		adapter->card->events++;
-		/*
-		 Get the complete host command buffer
-		*/
+		/* Get the complete host command buffer */
 		slic_handle_word.handle_token = rspbuf->hosthandle;
 		hcmd =
 			adapter->slic_handles[slic_handle_word.handle_index].
@@ -2759,9 +2763,10 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
 			poemfru = &pOeeprom->OemFru;
 			macaddrs = 2;
 			/* Minor kludge for Oasis card
-			     get 2 MAC addresses from the
-			     EEPROM to ensure that function 1
-			     gets the Port 1 MAC address */
+			 * get 2 MAC addresses from the
+			 * EEPROM to ensure that function 1
+			 * gets the Port 1 MAC address
+			 */
 			break;
 		default:
 			/* extract EEPROM data and pointers to EEPROM data */
@@ -2783,15 +2788,13 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
 
 			ee_chksum =
 			    *(u16 *)((char *)peeprom + (eecodesize - 2));
-			/*
-			    calculate the EEPROM checksum
-			*/
+			/* calculate the EEPROM checksum */
 			calc_chksum = slic_eeprom_cksum(peeprom,
 							eecodesize - 2);
 			/*
-			    if the ucdoe chksum flag bit worked,
-			    we wouldn't need this
-			*/
+			 *  if the ucdoe chksum flag bit worked,
+			 *  we wouldn't need this
+			 */
 			if (ee_chksum == calc_chksum)
 				card->config.EepromValid = true;
 		}
@@ -2890,11 +2893,11 @@ static void slic_init_adapter(struct net_device *netdev,
 
 	adapter->card_size = 1;
 	/*
-	  Initialize slic_handle array
-	*/
+	 * Initialize slic_handle array
+	 */
 	/*
-	 Start with 1.  0 is an invalid host handle.
-	*/
+	 * Start with 1.  0 is an invalid host handle.
+	 */
 	for (index = 1, pslic_handle = &adapter->slic_handles[1];
 	     index < SLIC_CMDQ_MAXCMDS; index++, pslic_handle++) {
 
Signature · 8 lines
1.7.9.5

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/fbe7783f1137572abe197c9ec551169bf04046c9.1445720974.git.amarjargal.gundjalam%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
author
#6 lore raw

Re: [Outreachy kernel] [PATCH 4/4] staging: slicoss: Fixes block comment style

Hi Julia,

Do you mean, the comments under code should be deleted?
For this patch, I only fixed the checkpatch warnings related to block comments.
Should I add another patch that fixes all comment style and removes all unnecessary comments for this driver?

Thanks,
Amarjargal

Quoted 388 lines · Julia Lawall
Quoted 6 lines · Amarjargal Gundjalam

This patch fixes the checkpatch.pl warnings:

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

<javascript:>>

Quoted 4 lines

---

 drivers/staging/slicoss/slic.h    |   14 +++---- 
 drivers/staging/slicoss/slichw.h  |   31 +++++++++------ 
 drivers/staging/slicoss/slicoss.c |   79 

+++++++++++++++++++------------------

Review

Quoted 3 lines
 3 files changed, 67 insertions(+), 57 deletions(-) 
(quoted diff) +0 -0

b/drivers/staging/slicoss/slic.h

Quoted 19 lines

index 92c6862..823452c 100644

drivers/staging/slicoss/slic.h +4 -4
@@ -93,10 +93,10 @@ struct slic_rcvbuf_info { 
         u32     lastid; 
 }; 
 /* 
- SLIC Handle structure.  Used to restrict handle values to 
- 32 bits by using an index rather than an address. 
- Simplifies ucode in 64-bit systems 
-*/ 
+ * SLIC Handle structure.  Used to restrict handle values to 
+ * 32 bits by using an index rather than an address. 
+ * Simplifies ucode in 64-bit systems 
+ */ 
 struct slic_handle_word { 
         union { 
                 struct { 

drivers/staging/slicoss/slic.h struct physcard { · line 338

Quoted 5 lines
drivers/staging/slicoss/slic.h +0 -2
@@ -334,9 +334,9 @@ struct physcard { 
         uint                adapters_allocd; 
 
 /*  the following is not currently needed 
-        u32              bridge_busnum; 
-        u32             

bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS];

drivers/staging/slicoss/slic.h struct physcard {

Quoted 3 lines
drivers/staging/slicoss/slic.h +2 -1
-*/ 
+ *        u32              bridge_busnum; 
+ *        u32             

bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS];

drivers/staging/slicoss/slic.h struct physcard { · line 339

Quoted 1 line
drivers/staging/slicoss/slic.h +1 -0
+ */ 

Typically, code under comments should just be dropped.

Also, I believe that the block comment format has a /* on the starting line by itself.

julia

Review

Quoted 4 lines
drivers/staging/slicoss/slic.h +0 -0
 }; 
 
 struct base_driver { 
(quoted diff) +0 -0

b/drivers/staging/slicoss/slichw.h

Quoted 44 lines

index 21cd02b..b55894d 100644

drivers/staging/slicoss/slichw.h +11 -8
@@ -308,8 +308,9 @@ struct slic_regs { 
         u32        slic_hbar;        /* Header buffer address reg */ 
         u32        pad4; 
         /* 31-8 - phy addr of set of contiguous hdr buffers 
-            7-0 - number of buffers passed 
-           Buffers are 256 bytes long on 256-byte boundaries. */ 
+         *  7-0 - number of buffers passed 
+         * Buffers are 256 bytes long on 256-byte boundaries. 
+         */ 
 #define SLIC_HBAR                0x0020 
 #define SLIC_HBAR_CNT_MSK        0x000000FF 
 
@@ -322,9 +323,10 @@ struct slic_regs { 
 
         u32        slic_cbar;        /* Xmt Cmd buf addr regs.*/ 
         /* 1 per XMT interface 
-           31-5 - phy addr of host command buffer 
-            4-0 - length of cmd in multiples of 32 bytes 
-           Buffers are 32 bytes up to 512 bytes long */ 
+         * 31-5 - phy addr of host command buffer 
+         *  4-0 - length of cmd in multiples of 32 bytes 
+         * Buffers are 32 bytes up to 512 bytes long 
+         */ 
 #define SLIC_CBAR                0x0030 
 #define SLIC_CBAR_LEN_MSK        0x0000001F 
 #define SLIC_CBAR_ALIGN                0x00000020 
@@ -336,9 +338,10 @@ struct slic_regs { 
 
         u32        slic_rbar;        /* Response buffer address reg.*/ 
         u32        pad7; 
-         /*31-8 - phy addr of set of contiguous response buffers 
-          7-0 - number of buffers passed 
-         Buffers are 32 bytes long on 32-byte boundaries.*/ 
+        /* 31-8 - phy addr of set of contiguous response buffers 
+         *  7-0 - number of buffers passed 
+         * Buffers are 32 bytes long on 32-byte boundaries. 
+         */ 
 #define SLIC_RBAR                0x0038 
 #define SLIC_RBAR_CNT_MSK        0x000000FF 
 #define SLIC_RBAR_SIZE                32 

drivers/staging/slicoss/slichw.h struct slic_regs { · line 435

Quoted 3 lines
drivers/staging/slicoss/slichw.h +0 -0
@@ -430,7 +433,8 @@ struct slic_regs { 
 #define SLIC_LOW_POWER        0x00e0 
 
         u32        slic_quiesce;        /* force slic into quiescent 

state

drivers/staging/slicoss/slichw.h struct slic_eeprom { · line 722

Quoted 8 lines
drivers/staging/slicoss/slichw.h +2 -1
-                                   before soft reset */ 
+                                 * before soft reset 
+                                 */ 
         u32        pad30; 
 #define SLIC_QUIESCE        0x00e8 
 
@@ -718,7 +722,8 @@ struct slic_eeprom { 
         u16 DSize2Pci;                /* 15 DRAM size to PCI (bytes * 

64K) */

drivers/staging/slicoss/slichw.h struct slic_eeprom { · line 723

Quoted 1 line
drivers/staging/slicoss/slichw.h +0 -0
         u16 RSize2Pci;                /* 16 ROM extension size to PCI 

(bytes * 4k) */

drivers/staging/slicoss/slichw.h struct slic_eeprom {

Quoted 5 lines
drivers/staging/slicoss/slichw.h +2 -1
         u8 NetIntPin1;                /* 17 Network Interface Pin 1 
-                                    (simba/leone only) */ 
+                                 *        (simba/leone only) 
+                                 */ 
         u8 NetIntPin2;                /* Network Interface Pin 2 

(simba/leone only)*/

drivers/staging/slicoss/slichw.h struct slic_eeprom { · line 729

Quoted 2 lines
drivers/staging/slicoss/slichw.h +0 -0
         union { 
                 u8 NetIntPin3;        /* 18 Network Interface Pin 3 

(simba only) */

drivers/staging/slicoss/slichw.h struct slic_eeprom { · line 754

Quoted 3 lines
drivers/staging/slicoss/slichw.h +0 -0
@@ -748,7 +753,8 @@ struct slic_eeprom { 
         union oemfru OemFru;        /* optional OEM FRU information */ 
         u8        Pad[4];                /* Pad to 128 bytes - includes 

2 cksum bytes

drivers/staging/slicoss/slichw.h struct slic_eeprom { · line 755

Quoted 1 line
drivers/staging/slicoss/slichw.h +0 -0
                                  * (if OEM FRU info exists) and two 

unusable

drivers/staging/slicoss/slichw.h struct oslic_eeprom { · line 779

Quoted 9 lines
drivers/staging/slicoss/slichw.h +2 -1
-                                 * bytes at the end */ 
+                                 * bytes at the end 
+                                 */ 
 }; 
 
 /* SLIC EEPROM structure for Oasis */ 
@@ -772,7 +778,8 @@ struct oslic_eeprom { 
         u16 FlashSize;                /* 14 Flash size (bytes / 4K) */ 
         u16 DSize2Pci;                /* 15 DRAM size to PCI (bytes / 

64K) */

drivers/staging/slicoss/slichw.h struct oslic_eeprom { · line 780

Quoted 1 line
drivers/staging/slicoss/slichw.h +0 -0
         u16 RSize2Pci;                /* 16 Flash (ROM extension) size 

to PCI

drivers/staging/slicoss/slichw.h struct oslic_eeprom {

Quoted 6 lines
drivers/staging/slicoss/slichw.h +2 -1
-                                        (bytes / 4K) */ 
+                                 *        (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 */

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/staging/slicoss/slicoss.c

drivers/staging/slicoss/slicoss.c static void slic_mcast_set_bit(struct adapter

Quoted 4 lines

index 8ce9000..7edf1b1 100644

drivers/staging/slicoss/slicoss.c +0 -0
@@ -159,7 +159,8 @@ static void slic_mcast_set_bit(struct adapter 

*adapter, char *address)

drivers/staging/slicoss/slicoss.c static void slic_mcast_set_bit(struct adapter *adapter, char *address)

Quoted 4 lines
drivers/staging/slicoss/slicoss.c +0 -1
         /* Get the CRC polynomial for the mac address */ 
         /* we use bits 1-8 (lsb), bitwise reversed, 
-         * msb (= lsb bit 0 before bitrev) is automatically discarded 

*/

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter

Quoted 6 lines
drivers/staging/slicoss/slicoss.c +2 -0
+         * msb (= lsb bit 0 before bitrev) is automatically discarded 
+         */ 
         crcpoly = ether_crc(ETH_ALEN, address) >> 23; 
 
         /* We only have space on the SLIC for 64 entries.  Lop 
@@ -261,15 +262,18 @@ static void slic_link_config(struct adapter 

*adapter,

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter · line 262

Quoted 1 line
drivers/staging/slicoss/slicoss.c +0 -0
                                 slic_reg32_write(wphy, phy_config, 

FLUSH);

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter *adapter,

Quoted 6 lines
drivers/staging/slicoss/slicoss.c +2 -1
                         } else {        /* forced 1000 Mb FD*/ 
                                 /* power down phy to break link 
-                                   this may not work) */ 
+                                 * this may not work) 
+                                 */ 
                                 phy_config = (MIICR_REG_PCR | 

PCR_POWERDOWN);

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter · line 268

Quoted 1 line
drivers/staging/slicoss/slicoss.c +0 -0
                                 slic_reg32_write(wphy, phy_config, 

FLUSH);

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter

Quoted 14 lines
drivers/staging/slicoss/slicoss.c +4 -2
                                 /* wait, Marvell says 1 sec, 
-                                   try to get away with 10 ms  */ 
+                                 * try to get away with 10 ms 
+                                 */ 
                                 mdelay(10); 
 
                                 /* disable auto-neg, set speed/duplex, 
-                                   soft reset phy, powerup */ 
+                                 * soft reset phy, powerup 
+                                 */ 
                                 phy_config = 
                                     (MIICR_REG_PCR | 
                                      (PCR_RESET | PCR_SPEED_1000 | 
@@ -290,8 +294,9 @@ static void slic_link_config(struct adapter 

*adapter,

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter · line 294

Quoted 1 line
drivers/staging/slicoss/slicoss.c +0 -0
                                      (PAR_ADV100FD | PAR_ADV100HD | 

PAR_ADV10FD

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter

Quoted 11 lines
drivers/staging/slicoss/slicoss.c +3 -2
                                       | PAR_ADV10HD)); 
                         } else { 
-                        /* linkspeed == LINK_1000MB - 
-                           don't advertise 10/100 Mb modes  */ 
+                        /* linkspeed == LINK_1000MB - 
+                         * don't advertise 10/100 Mb modes 
+                         */ 
                                 phy_advreg = MIICR_REG_4; 
                         } 
                         /* enable PAUSE frames  */ 
@@ -304,8 +309,7 @@ static void slic_link_config(struct adapter 

*adapter,

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter *adapter,

Quoted 3 lines
drivers/staging/slicoss/slicoss.c +0 -0
                         slic_reg32_write(wphy, phy_gctlreg, FLUSH); 
 
                         if (adapter->subsysid != 

SLIC_1GB_CICADA_SUBSYS_ID) {

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter *adapter,

Quoted 3 lines
drivers/staging/slicoss/slicoss.c +1 -2
-                                /* if a Marvell PHY 
-                                   enable auto crossover */ 
+                                /* if a Marvell PHY enable auto 

crossover */

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter · line 314

Quoted 2 lines
drivers/staging/slicoss/slicoss.c +0 -0
                                 phy_config = 
                                     (MIICR_REG_16 | 

(MRV_REG16_XOVERON));

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter · line 315

Quoted 1 line
drivers/staging/slicoss/slicoss.c +0 -0
                                 slic_reg32_write(wphy, phy_config, 

FLUSH);

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter

Quoted 1 line
drivers/staging/slicoss/slicoss.c +0 -0
@@ -336,8 +340,7 @@ static void slic_link_config(struct adapter 

*adapter,

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter *adapter,

Quoted 7 lines
drivers/staging/slicoss/slicoss.c +1 -2
                         duplex = PCR_DUPLEX_FULL; 
 
                 if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) { 
-                        /* if a Marvell PHY 
-                           disable auto crossover  */ 
+                        /* if a Marvell PHY disable auto crossover  */ 
                         phy_config = (MIICR_REG_16 | 

(MRV_REG16_XOVEROFF));

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter

Quoted 3 lines
drivers/staging/slicoss/slicoss.c +0 -0
                         slic_reg32_write(wphy, phy_config, FLUSH); 
                 } 
@@ -351,8 +354,9 @@ static void slic_link_config(struct adapter 

*adapter,

drivers/staging/slicoss/slicoss.c static void slic_link_config(struct adapter *adapter,

Quoted 10 lines
drivers/staging/slicoss/slicoss.c +3 -2
                 if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) { 
                         /* if a Marvell PHY 
-                           disable auto-neg, set speed, 
-                           soft reset phy, powerup */ 
+                         * disable auto-neg, set speed, 
+                         * soft reset phy, powerup 
+                         */ 
                         phy_config = 
                             (MIICR_REG_PCR | (PCR_RESET | speed | 

duplex));

drivers/staging/slicoss/slicoss.c static int slic_card_download(struct adapter

Quoted 2 lines
drivers/staging/slicoss/slicoss.c +0 -0
                         slic_reg32_write(wphy, phy_config, FLUSH); 
@@ -529,11 +533,12 @@ static int slic_card_download(struct adapter 

*adapter)

drivers/staging/slicoss/slicoss.c static int slic_card_download(struct adapter *adapter)

Quoted 3 lines
drivers/staging/slicoss/slicoss.c +0 -0
                         index += 4; 
 
                         /* Check SRAM location zero. If it is non-zero. 

Abort.*/

drivers/staging/slicoss/slicoss.c static int slic_card_download(struct adapter · line 532

Quoted 1 line
drivers/staging/slicoss/slicoss.c +0 -1
-/*                        failure = readl((u32 __iomem 

*)&slic_regs->slic_reset);

drivers/staging/slicoss/slicoss.c static int slic_card_download(struct adapter *adapter)

Quoted 5 lines
drivers/staging/slicoss/slicoss.c +1 -4
-                        if (failure) { 
-                                release_firmware(fw); 
-                                return -EIO; 
-                        }*/ 
+                        /* failure = readl((u32 __iomem 

*)&slic_regs->slic_reset);

drivers/staging/slicoss/slicoss.c static int slic_card_download(struct adapter

Quoted 9 lines
drivers/staging/slicoss/slicoss.c +5 -0
+                         * if (failure) { 
+                         *         release_firmware(fw); 
+                         *        return -EIO; 
+                         * } 
+                         */ 
                 } 
         } 
         release_firmware(fw); 
@@ -542,7 +547,8 @@ static int slic_card_download(struct adapter 

*adapter)

drivers/staging/slicoss/slicoss.c static void slic_upr_start(struct adapter

Quoted 10 lines
drivers/staging/slicoss/slicoss.c +2 -1
         slic_reg32_write(&slic_regs->slic_wcs, SLIC_WCS_START, FLUSH); 
 
         /* stall for 20 ms, long enough for ucode to init card 
-           and reach mainloop */ 
+         * and reach mainloop 
+         */ 
         mdelay(20); 
 
         return 0; 
@@ -885,10 +891,10 @@ static void slic_upr_start(struct adapter 

*adapter)

drivers/staging/slicoss/slicoss.c static void slic_xmit_complete(struct adapter

Quoted 15 lines
drivers/staging/slicoss/slicoss.c +4 -4
         struct slic_upr *upr; 
         __iomem struct slic_regs *slic_regs = adapter->slic_regs; 
 /* 
-    char * ptr1; 
-    char * ptr2; 
-    uint cmdoffset; 
-*/ 
+ *  char * ptr1; 
+ *  char * ptr2; 
+ *  uint cmdoffset; 
+ */ 
         upr = adapter->upr_list; 
         if (!upr) 
                 return; 
@@ -2048,9 +2054,7 @@ static void slic_xmit_complete(struct adapter 

*adapter)

drivers/staging/slicoss/slicoss.c static void slic_xmit_complete(struct adapter *adapter)

Quoted 10 lines
drivers/staging/slicoss/slicoss.c +1 -3
                         break; 
                 adapter->xmit_completes++; 
                 adapter->card->events++; 
-                /* 
-                 Get the complete host command buffer 
-                */ 
+                /* Get the complete host command buffer */ 
                 slic_handle_word.handle_token = rspbuf->hosthandle; 
                 hcmd = 
 
                         adapter->slic_handles[slic_handle_word.handle_index]. 

drivers/staging/slicoss/slicoss.c static int slic_card_init(struct sliccard *card,

Quoted 1 line
drivers/staging/slicoss/slicoss.c +0 -0
@@ -2759,9 +2763,10 @@ static int slic_card_init(struct sliccard *card, 

struct adapter *adapter)

drivers/staging/slicoss/slicoss.c static int slic_card_init(struct sliccard *card, struct adapter *adapter)

Quoted 13 lines
drivers/staging/slicoss/slicoss.c +4 -3
                         poemfru = &pOeeprom->OemFru; 
                         macaddrs = 2; 
                         /* Minor kludge for Oasis card 
-                             get 2 MAC addresses from the 
-                             EEPROM to ensure that function 1 
-                             gets the Port 1 MAC address */ 
+                         * get 2 MAC addresses from the 
+                         * EEPROM to ensure that function 1 
+                         * gets the Port 1 MAC address 
+                         */ 
                         break; 
                 default: 
                         /* extract EEPROM data and pointers to EEPROM 

data */

drivers/staging/slicoss/slicoss.c static int slic_card_init(struct sliccard *card,

Quoted 1 line
drivers/staging/slicoss/slicoss.c +0 -0
@@ -2783,15 +2788,13 @@ static int slic_card_init(struct sliccard *card, 

struct adapter *adapter)

drivers/staging/slicoss/slicoss.c static int slic_card_init(struct sliccard *card, · line 2789

Quoted 3 lines
drivers/staging/slicoss/slicoss.c +0 -0
                         ee_chksum = 
                             *(u16 *)((char *)peeprom + (eecodesize - 

2));

drivers/staging/slicoss/slicoss.c static int slic_card_init(struct sliccard *card, struct adapter *adapter)

Quoted 6 lines
drivers/staging/slicoss/slicoss.c +1 -3
-                        /* 
-                            calculate the EEPROM checksum 
-                        */ 
+                        /* calculate the EEPROM checksum */ 
                         calc_chksum = slic_eeprom_cksum(peeprom, 
                                                         eecodesize - 

2);

drivers/staging/slicoss/slicoss.c static void slic_init_adapter(struct net_device

Quoted 11 lines
drivers/staging/slicoss/slicoss.c +3 -3
                         /* 
-                            if the ucdoe chksum flag bit worked, 
-                            we wouldn't need this 
-                        */ 
+                         *  if the ucdoe chksum flag bit worked, 
+                         *  we wouldn't need this 
+                         */ 
                         if (ee_chksum == calc_chksum) 
                                 card->config.EepromValid = true; 
                 } 
@@ -2890,11 +2893,11 @@ static void slic_init_adapter(struct net_device 

*netdev,

Quoted 16 lines
drivers/staging/slicoss/slicoss.c +4 -5
         adapter->card_size = 1; 
         /* 
-          Initialize slic_handle array 
-        */ 
+         * Initialize slic_handle array 
+         */ 
         /* 
-         Start with 1.  0 is an invalid host handle. 
-        */ 
+         * Start with 1.  0 is an invalid host handle. 
+         */ 
         for (index = 1, pslic_handle = &adapter->slic_handles[1]; 
              index < SLIC_CMDQ_MAXCMDS; index++, pslic_handle++) { 
 
-- 
Quoted 4 lines

1.7.9.5

Signature · 1 line
You received this message because you are subscribed to the Google 

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected] <javascript:>.

Quoted 1 line

To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/fbe7783f1137572abe197c9ec551169bf04046c9.1445720974.git.amarjargal.gundjalam%40gmail.com.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

#7 lore raw

Re: [Outreachy kernel] [PATCH 4/4] staging: slicoss: Fixes block comment style

Quoted 2 lines · amarjargal

Hi Julia,
Do you mean, the comments under code should be deleted?

I meant that the comment that contains code could be fixed by just removing the comemnt entirely. But perhaps it is better to stay with just adjusting the comment structure itself. In any case the patch should be sent again to use the correct block comment style, with the starting /* on a line by itself.

julia

Quoted 441 lines

For this patch, I only fixed the checkpatch warnings related to block comments.
Should I add another patch that fixes all comment style and removes all unnecessary comments for this driver?

Thanks,
Amarjargal

On Sunday, October 25, 2015 at 3:40:10 PM UTC+8, Julia Lawall wrote:
On Sat, 24 Oct 2015, Amarjargal Gundjalam wrote:

> This patch fixes the checkpatch.pl warnings:
>
> WARNING: Block comments use * on subsequent lines > WARNING: Block comments use a trailing */ on a separate line >
> Signed-off-by: Amarjargal Gundjalam <[email protected]> > ---
>  drivers/staging/slicoss/slic.h    |   14 +++---- >  drivers/staging/slicoss/slichw.h  |   31 +++++++++------ >  drivers/staging/slicoss/slicoss.c |   79
+++++++++++++++++++------------------
>  3 files changed, 67 insertions(+), 57 deletions(-) >
> diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
> index 92c6862..823452c 100644
> --- a/drivers/staging/slicoss/slic.h
> +++ b/drivers/staging/slicoss/slic.h
> @@ -93,10 +93,10 @@ struct slic_rcvbuf_info {
>          u32     lastid;
>  };
>  /*
> - SLIC Handle structure.  Used to restrict handle values to > - 32 bits by using an index rather than an address. > - Simplifies ucode in 64-bit systems
> -*/
> + * SLIC Handle structure.  Used to restrict handle values to > + * 32 bits by using an index rather than an address. > + * Simplifies ucode in 64-bit systems
> + */
>  struct slic_handle_word {
>          union {
>                  struct {
> @@ -334,9 +334,9 @@ struct physcard {
>          uint                adapters_allocd;
>
>  /*  the following is not currently needed
> -        u32              bridge_busnum;
> -        u32 bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS];
> -*/
> + *        u32              bridge_busnum;
> + *        u32 bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS];
> + */

Typically, code under comments should just be dropped.

Also, I believe that the block comment format has a /* on the starting
line by itself.

julia

>  };
>
>  struct base_driver {
> diff --git a/drivers/staging/slicoss/slichw.h
b/drivers/staging/slicoss/slichw.h
> index 21cd02b..b55894d 100644
> --- a/drivers/staging/slicoss/slichw.h
> +++ b/drivers/staging/slicoss/slichw.h
> @@ -308,8 +308,9 @@ struct slic_regs {
>          u32        slic_hbar;        /* Header buffer address
reg */
>          u32        pad4;
>          /* 31-8 - phy addr of set of contiguous hdr buffers
> -            7-0 - number of buffers passed
> -           Buffers are 256 bytes long on 256-byte boundaries.
*/
> +         *  7-0 - number of buffers passed
> +         * Buffers are 256 bytes long on 256-byte boundaries.
> +         */
>  #define SLIC_HBAR                0x0020
>  #define SLIC_HBAR_CNT_MSK        0x000000FF
>
> @@ -322,9 +323,10 @@ struct slic_regs {
>
>          u32        slic_cbar;        /* Xmt Cmd buf addr
regs.*/
>          /* 1 per XMT interface
> -           31-5 - phy addr of host command buffer
> -            4-0 - length of cmd in multiples of 32 bytes
> -           Buffers are 32 bytes up to 512 bytes long */
> +         * 31-5 - phy addr of host command buffer
> +         *  4-0 - length of cmd in multiples of 32 bytes
> +         * Buffers are 32 bytes up to 512 bytes long
> +         */
>  #define SLIC_CBAR                0x0030
>  #define SLIC_CBAR_LEN_MSK        0x0000001F
>  #define SLIC_CBAR_ALIGN                0x00000020
> @@ -336,9 +338,10 @@ struct slic_regs {
>
>          u32        slic_rbar;        /* Response buffer
address reg.*/
>          u32        pad7;
> -         /*31-8 - phy addr of set of contiguous response
buffers
> -          7-0 - number of buffers passed
> -         Buffers are 32 bytes long on 32-byte boundaries.*/
> +        /* 31-8 - phy addr of set of contiguous response
buffers
> +         *  7-0 - number of buffers passed
> +         * Buffers are 32 bytes long on 32-byte boundaries.
> +         */
>  #define SLIC_RBAR                0x0038
>  #define SLIC_RBAR_CNT_MSK        0x000000FF
>  #define SLIC_RBAR_SIZE                32
> @@ -430,7 +433,8 @@ struct slic_regs {
>  #define SLIC_LOW_POWER        0x00e0
>
>          u32        slic_quiesce;        /* force slic into
quiescent state
> -                                   before soft reset */
> +                                 * before soft reset
> +                                 */
>          u32        pad30;
>  #define SLIC_QUIESCE        0x00e8
>
> @@ -718,7 +722,8 @@ struct slic_eeprom {
>          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
> -                                    (simba/leone only) */
> +                                 *        (simba/leone only)
> +                                 */
>          u8 NetIntPin2;                /* Network Interface
Pin 2 (simba/leone only)*/
>          union {
>                  u8 NetIntPin3;        /* 18 Network Interface
Pin 3 (simba only) */
> @@ -748,7 +753,8 @@ struct slic_eeprom {
>          union oemfru OemFru;        /* 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 */
> +                                 * bytes at the end
> +                                 */
>  };
>
>  /* SLIC EEPROM structure for Oasis */
> @@ -772,7 +778,8 @@ struct oslic_eeprom {
>          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
> -                                        (bytes / 4K) */
> +                                 *        (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 */
> diff --git a/drivers/staging/slicoss/slicoss.c
b/drivers/staging/slicoss/slicoss.c
> index 8ce9000..7edf1b1 100644
> --- a/drivers/staging/slicoss/slicoss.c
> +++ b/drivers/staging/slicoss/slicoss.c
> @@ -159,7 +159,8 @@ static void slic_mcast_set_bit(struct
adapter *adapter, char *address)
>
>          /* Get the CRC polynomial for the mac address */
>          /* we use bits 1-8 (lsb), bitwise reversed,
> -         * msb (= lsb bit 0 before bitrev) is automatically
discarded */
> +         * msb (= lsb bit 0 before bitrev) is automatically
discarded
> +         */
>          crcpoly = ether_crc(ETH_ALEN, address) >> 23;
>
>          /* We only have space on the SLIC for 64 entries.
 Lop
> @@ -261,15 +262,18 @@ static void slic_link_config(struct
adapter *adapter,
>                                  slic_reg32_write(wphy,
phy_config, FLUSH);
>                          } else {        /* forced 1000 Mb
FD*/
>                                  /* power down phy to break
link
> -                                   this may not work) */
> +                                 * this may not work)
> +                                 */
>                                  phy_config = (MIICR_REG_PCR |
PCR_POWERDOWN);
>                                  slic_reg32_write(wphy,
phy_config, FLUSH);
>                                  /* wait, Marvell says 1 sec,
> -                                   try to get away with 10 ms
 */
> +                                 * try to get away with 10 ms
> +                                 */
>                                  mdelay(10);
>
>                                  /* disable auto-neg, set
speed/duplex,
> -                                   soft reset phy, powerup */
> +                                 * soft reset phy, powerup
> +                                 */
>                                  phy_config =
>                                      (MIICR_REG_PCR |
>                                       (PCR_RESET |
PCR_SPEED_1000 |
> @@ -290,8 +294,9 @@ static void slic_link_config(struct
adapter *adapter,
>                                       (PAR_ADV100FD |
PAR_ADV100HD | PAR_ADV10FD
>                                        | PAR_ADV10HD));
>                          } else {
> -                        /* linkspeed == LINK_1000MB -
> -                           don't advertise 10/100 Mb modes
 */
> +                        /* linkspeed == LINK_1000MB -
> +                         * don't advertise 10/100 Mb modes
> +                         */
>                                  phy_advreg = MIICR_REG_4;
>                          }
>                          /* enable PAUSE frames  */
> @@ -304,8 +309,7 @@ static void slic_link_config(struct
adapter *adapter,
>                          slic_reg32_write(wphy, phy_gctlreg,
FLUSH);
>
>                          if (adapter->subsysid !=
SLIC_1GB_CICADA_SUBSYS_ID) {
> -                                /* if a Marvell PHY
> -                                   enable auto crossover */
> +                                /* if a Marvell PHY enable
auto crossover */
>                                  phy_config =
>                                      (MIICR_REG_16 |
(MRV_REG16_XOVERON));
>                                  slic_reg32_write(wphy,
phy_config, FLUSH);
> @@ -336,8 +340,7 @@ static void slic_link_config(struct
adapter *adapter,
>                          duplex = PCR_DUPLEX_FULL;
>
>                  if (adapter->subsysid !=
SLIC_1GB_CICADA_SUBSYS_ID) {
> -                        /* if a Marvell PHY
> -                           disable auto crossover  */
> +                        /* if a Marvell PHY disable auto
crossover  */
>                          phy_config = (MIICR_REG_16 |
(MRV_REG16_XOVEROFF));
>                          slic_reg32_write(wphy, phy_config,
FLUSH);
>                  }
> @@ -351,8 +354,9 @@ static void slic_link_config(struct
adapter *adapter,
>
>                  if (adapter->subsysid !=
SLIC_1GB_CICADA_SUBSYS_ID) {
>                          /* if a Marvell PHY
> -                           disable auto-neg, set speed,
> -                           soft reset phy, powerup */
> +                         * disable auto-neg, set speed,
> +                         * soft reset phy, powerup
> +                         */
>                          phy_config =
>                              (MIICR_REG_PCR | (PCR_RESET |
speed | duplex));
>                          slic_reg32_write(wphy, phy_config,
FLUSH);
> @@ -529,11 +533,12 @@ static int slic_card_download(struct
adapter *adapter)
>                          index += 4;
>
>                          /* Check SRAM location zero. If it is
non-zero. Abort.*/
> -/*                        failure = readl((u32 __iomem
*)&slic_regs->slic_reset);
> -                        if (failure) {
> -                                release_firmware(fw);
> -                                return -EIO;
> -                        }*/
> +                        /* failure = readl((u32 __iomem
*)&slic_regs->slic_reset);
> +                         * if (failure) {
> +                         *         release_firmware(fw);
> +                         *        return -EIO;
> +                         * }
> +                         */
>                  }
>          }
>          release_firmware(fw);
> @@ -542,7 +547,8 @@ static int slic_card_download(struct
adapter *adapter)
>          slic_reg32_write(&slic_regs->slic_wcs,
SLIC_WCS_START, FLUSH);
>
>          /* stall for 20 ms, long enough for ucode to init
card
> -           and reach mainloop */
> +         * and reach mainloop
> +         */
>          mdelay(20);
>
>          return 0;
> @@ -885,10 +891,10 @@ static void slic_upr_start(struct
adapter *adapter)
>          struct slic_upr *upr;
>          __iomem struct slic_regs *slic_regs =
adapter->slic_regs;
>  /*
> -    char * ptr1;
> -    char * ptr2;
> -    uint cmdoffset;
> -*/
> + *  char * ptr1;
> + *  char * ptr2;
> + *  uint cmdoffset;
> + */
>          upr = adapter->upr_list;
>          if (!upr)
>                  return;
> @@ -2048,9 +2054,7 @@ static void slic_xmit_complete(struct
adapter *adapter)
>                          break;
>                  adapter->xmit_completes++;
>                  adapter->card->events++;
> -                /*
> -                 Get the complete host command buffer
> -                */
> +                /* Get the complete host command buffer */
>                  slic_handle_word.handle_token =
rspbuf->hosthandle;
>                  hcmd =
>                         adapter->slic_handles[slic_handle_word.handle_inde
x].
> @@ -2759,9 +2763,10 @@ static int slic_card_init(struct
sliccard *card, struct adapter *adapter)
>                          poemfru = &pOeeprom->OemFru;
>                          macaddrs = 2;
>                          /* Minor kludge for Oasis card
> -                             get 2 MAC addresses from the
> -                             EEPROM to ensure that function 1
> -                             gets the Port 1 MAC address */
> +                         * get 2 MAC addresses from the
> +                         * EEPROM to ensure that function 1
> +                         * gets the Port 1 MAC address
> +                         */
>                          break;
>                  default:
>                          /* extract EEPROM data and pointers
to EEPROM data */
> @@ -2783,15 +2788,13 @@ static int slic_card_init(struct
sliccard *card, struct adapter *adapter)
>
>                          ee_chksum =
>                              *(u16 *)((char *)peeprom +
(eecodesize - 2));
> -                        /*
> -                            calculate the EEPROM checksum
> -                        */
> +                        /* calculate the EEPROM checksum */
>                          calc_chksum =
slic_eeprom_cksum(peeprom,
>
                                                         eecodesize
- 2);
>                          /*
> -                            if the ucdoe chksum flag bit
worked,
> -                            we wouldn't need this
> -                        */
> +                         *  if the ucdoe chksum flag bit
worked,
> +                         *  we wouldn't need this
> +                         */
>                          if (ee_chksum == calc_chksum)
>                                  card->config.EepromValid =
true;
>                  }
> @@ -2890,11 +2893,11 @@ static void slic_init_adapter(struct
net_device *netdev,
>
>          adapter->card_size = 1;
>          /*
> -          Initialize slic_handle array
> -        */
> +         * Initialize slic_handle array
> +         */
>          /*
> -         Start with 1.  0 is an invalid host handle.
> -        */
> +         * Start with 1.  0 is an invalid host handle.
> +         */
>          for (index = 1, pslic_handle =
&adapter->slic_handles[1];
>               index < SLIC_CMDQ_MAXCMDS; index++,
pslic_handle++) {
>
> --
> 1.7.9.5
>
> --
> You received this message because you are subscribed to the
Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from
it, send an email to [email protected].
> To post to this group, send email to
[email protected].
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/fbe7783f1137572abe197c9e c551169bf04046c9.1445720974.git.amarjargal.gundjalam%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/b28da202-1df3-4e2c-85de- be31c1e5e522%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

#8 lore raw

v2 cover staging: slicoss: Fixes multiple checkpatch issues

In reply to Amarjargal Gundjalam

This patchset fixes multiple checkpatch checks and warnings.

Amarjargal Gundjalam (4):
staging: slicoss: Removes multiple blank lines
staging: slicoss: Removes unnecessary space after a cast
staging: slicoss: Adds space around operators
staging: slicoss: Fixes block comment style

 drivers/staging/slicoss/slic.h    |   23 +++--
 drivers/staging/slicoss/slichw.h  |   38 +++++---
 drivers/staging/slicoss/slicoss.c |  174 +++++++++++++++++++++----------------
 3 files changed, 134 insertions(+), 101 deletions(-)
Signature · 1 line
1.7.9.5
#9 lore raw

PATCH v2 1/4 staging: slicoss: Removes multiple blank lines

This patch fixes the checkpatch.pl check:

CHECK: Please don't use multiple blank lines

---
 drivers/staging/slicoss/slic.h    |    2 --
 drivers/staging/slicoss/slicoss.c |    5 -----
 2 files changed, 7 deletions(-)
drivers/staging/slicoss/slic.h +0 -2
index 00b8af6..6ccd1d5 100644
@@ -166,7 +166,6 @@ struct slic_cmdqueue {
 #define SLIC_MAX_CARDS              32
 #define SLIC_MAX_PORTS              4        /* Max # of ports per card   */
 
-
 struct mcast_address {
 	unsigned char address[6];
 	struct mcast_address *next;
@@ -485,7 +484,6 @@ struct adapter {
 	struct slicnet_stats     slic_stats;
 };
 
-
 #define UPDATE_STATS(largestat, newstat, oldstat)                        \
 {                                                                        \
 	if ((newstat) < (oldstat))                                       \
drivers/staging/slicoss/slicoss.c +0 -5
index 3600176..a226055 100644
@@ -54,7 +54,6 @@
  *       IS-NIC driver.
  */
 
-
 #define KLUDGE_FOR_4GB_BOUNDARY         1
 #define DEBUG_MICROCODE                 1
 #define DBG                             1
@@ -1149,7 +1148,6 @@ static u16 slic_eeprom_cksum(void *eeprom, unsigned len)
 	if (len > 0)
 		checksum += *(u8 *) wp;
 
-
 	while (checksum >> 16)
 		checksum = (checksum & 0xFFFF) + ((checksum >> 16) & 0xFFFF);
 
@@ -2131,7 +2129,6 @@ static void slic_interrupt_card_up(u32 isr, struct adapter *adapter,
 	}
 }
 
-
 static irqreturn_t slic_interrupt(int irq, void *dev_id)
 {
 	struct net_device *dev = dev_id;
@@ -2228,7 +2225,6 @@ xmit_fail:
 	goto xmit_done;
 }
 
-
 static void slic_adapter_freeresources(struct adapter *adapter)
 {
 	slic_init_cleanup(adapter);
@@ -3099,7 +3095,6 @@ static int slic_entry_probe(struct pci_dev *pcidev,
 	mmio_start = pci_resource_start(pcidev, 0);
 	mmio_len = pci_resource_len(pcidev, 0);
 
-
 /*	memmapped_ioaddr =  (u32)ioremap_nocache(mmio_start, mmio_len);*/
 	memmapped_ioaddr = ioremap(mmio_start, mmio_len);
 	if (!memmapped_ioaddr) {
Signature · 1 line
1.7.9.5
#10 lore raw

PATCH v2 2/4 staging: slicoss: Removes unnecessary space after a cast

In reply to Amarjargal Gundjalam

This patch fixes the checkpatch.pl check:

CHECK: No space is necessary after a cast

---
 drivers/staging/slicoss/slicoss.c |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)
drivers/staging/slicoss/slicoss.c +18 -18
index a226055..c88ed69 100644
@@ -168,7 +168,7 @@ static void slic_mcast_set_bit(struct adapter *adapter, char *address)
 	crcpoly &= 0x3F;
 
 	/* OR in the new bit into our 64 bit mask. */
-	adapter->mcastmask |= (u64) 1 << crcpoly;
+	adapter->mcastmask |= (u64)1 << crcpoly;
 }
 
 static void slic_mcast_set_mask(struct adapter *adapter)
@@ -592,11 +592,11 @@ static void slic_mac_address_config(struct adapter *adapter)
 	u32 value2;
 	__iomem struct slic_regs *slic_regs = adapter->slic_regs;
 
-	value = ntohl(*(__be32 *) &adapter->currmacaddr[2]);
+	value = ntohl(*(__be32 *)&adapter->currmacaddr[2]);
 	slic_reg32_write(&slic_regs->slic_wraddral, value, FLUSH);
 	slic_reg32_write(&slic_regs->slic_wraddrbl, value, FLUSH);
 
-	value2 = (u32) ((adapter->currmacaddr[0] << 8 |
+	value2 = (u32)((adapter->currmacaddr[0] << 8 |
 			     adapter->currmacaddr[1]) & 0xFFFF);
 
 	slic_reg32_write(&slic_regs->slic_wraddrah, value2, FLUSH);
@@ -970,7 +970,7 @@ static void slic_link_upr_complete(struct adapter *adapter, u32 isr)
 #else
 		slic_upr_queue_request(adapter,
 				       SLIC_UPR_RLSR,
-				       (u32) &pshmem->linkstatus,
+				       (u32)&pshmem->linkstatus,
 				       SLIC_GET_ADDR_HIGH(pshmem), 0, 0);
 #endif
 		return;
@@ -1040,7 +1040,7 @@ static void slic_upr_request_complete(struct adapter *adapter, u32 isr)
 	case SLIC_UPR_STATS:
 		{
 			struct slic_stats *slicstats =
-			    (struct slic_stats *) &adapter->pshmem->inicstats;
+			    (struct slic_stats *)&adapter->pshmem->inicstats;
 			struct slic_stats *newstats = slicstats;
 			struct slic_stats  *old = &adapter->inicstats_prev;
 			struct slicnet_stats *stst = &adapter->slic_stats;
@@ -1146,7 +1146,7 @@ static u16 slic_eeprom_cksum(void *eeprom, unsigned len)
 	}
 
 	if (len > 0)
-		checksum += *(u8 *) wp;
+		checksum += *(u8 *)wp;
 
 	while (checksum >> 16)
 		checksum = (checksum & 0xFFFF) + ((checksum >> 16) & 0xFFFF);
@@ -1244,7 +1244,7 @@ static void slic_cmdqmem_free(struct adapter *adapter)
 		if (cmdqmem->pages[i]) {
 			pci_free_consistent(adapter->pcidev,
 					    PAGE_SIZE,
-					    (void *) cmdqmem->pages[i],
+					    (void *)cmdqmem->pages[i],
 					    cmdqmem->dma_pages[i]);
 		}
 	}
@@ -1324,8 +1324,8 @@ static void slic_cmdq_addcmdpage(struct adapter *adapter, u32 *page)
 		adapter->pfree_slic_handles = pslic_handle->next;
 		spin_unlock_irqrestore(&adapter->handle_lock, flags);
 		pslic_handle->type = SLIC_HANDLE_CMD;
-		pslic_handle->address = (void *) cmd;
-		pslic_handle->offset = (ushort) adapter->slic_handle_ix++;
+		pslic_handle->address = (void *)cmd;
+		pslic_handle->offset = (ushort)adapter->slic_handle_ix++;
 		pslic_handle->other_handle = NULL;
 		pslic_handle->next = NULL;
 
@@ -1735,7 +1735,7 @@ static int slic_link_event_handler(struct adapter *adapter)
 				  0, 0);
 #else
 	status = slic_upr_request(adapter, SLIC_UPR_RLSR,
-		(u32) &pshmem->linkstatus,	/* no 4GB wrap guaranteed */
+		(u32)&pshmem->linkstatus,	/* no 4GB wrap guaranteed */
 				  0, 0, 0);
 #endif
 	return status;
@@ -1803,7 +1803,7 @@ static void slic_mcast_set_list(struct net_device *dev)
 	struct netdev_hw_addr *ha;
 
 	netdev_for_each_mc_addr(ha, dev) {
-		addresses = (char *) &ha->addr;
+		addresses = (char *)&ha->addr;
 		status = slic_mcast_add_list(adapter, addresses);
 		if (status != 0)
 			break;
@@ -1851,8 +1851,8 @@ static void slic_xmit_build_request(struct adapter *adapter,
 	ihcmd->u.slic_buffers.bufs[0].paddrh = SLIC_GET_ADDR_HIGH(phys_addr);
 	ihcmd->u.slic_buffers.bufs[0].length = skb->len;
 #if BITS_PER_LONG == 64
-	hcmd->cmdsize = (u32) ((((u64)&ihcmd->u.slic_buffers.bufs[1] -
-				     (u64) hcmd) + 31) >> 5);
+	hcmd->cmdsize = (u32)((((u64)&ihcmd->u.slic_buffers.bufs[1] -
+				     (u64)hcmd) + 31) >> 5);
 #else
 	hcmd->cmdsize = (((u32)&ihcmd->u.slic_buffers.bufs[1] -
 				       (u32)hcmd) + 31) >> 5;
@@ -2749,7 +2749,7 @@ 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;
+			pOeeprom = (struct oslic_eeprom *)peeprom;
 			eecodesize = pOeeprom->EecodeSize;
 			dramsize = pOeeprom->DramSize;
 			pmac = pOeeprom->MacInfo;
@@ -2782,7 +2782,7 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
 		    (eecodesize >= MIN_EECODE_SIZE)) {
 
 			ee_chksum =
-			    *(u16 *) ((char *) peeprom + (eecodesize - 2));
+			    *(u16 *)((char *)peeprom + (eecodesize - 2));
 			/*
 			    calculate the EEPROM checksum
 			*/
@@ -2945,11 +2945,11 @@ static u32 slic_card_locate(struct adapter *adapter)
 	}
 
 	hostid_reg =
-	    (u16 __iomem *) (((u8 __iomem *) (adapter->slic_regs)) +
+	    (u16 __iomem *)(((u8 __iomem *)(adapter->slic_regs)) +
 	    rdhostid_offset);
 
 	/* read the 16 bit hostid from SRAM */
-	card_hostid = (ushort) readw(hostid_reg);
+	card_hostid = (ushort)readw(hostid_reg);
 
 	/* Initialize a new card structure if need be */
 	if (card_hostid == SLIC_HOSTID_DEFAULT) {
@@ -3130,7 +3130,7 @@ static int slic_entry_probe(struct pci_dev *pcidev,
 
 	slic_adapter_set_hwaddr(adapter);
 
-	netdev->base_addr = (unsigned long) memmapped_ioaddr;
+	netdev->base_addr = (unsigned long)memmapped_ioaddr;
 	netdev->irq = adapter->irq;
 	netdev->netdev_ops = &slic_netdev_ops;
 
Signature · 1 line
1.7.9.5
#11 lore raw

PATCH v2 3/4 staging: slicoss: Adds space around operators

In reply to Amarjargal Gundjalam

This patch fixes the checkpatch.pl check:

CHECK: spaces preferred around that ‘’

---
 drivers/staging/slicoss/slic.h    |    4 ++--
 drivers/staging/slicoss/slicoss.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/slicoss/slic.h +2 -2
index 6ccd1d5..92c6862 100644
@@ -446,7 +446,7 @@ struct adapter {
 	*  SLIC Handles
 	*/
 	/* Object handles*/
-	struct slic_handle slic_handles[SLIC_CMDQ_MAXCMDS+1];
+	struct slic_handle slic_handles[SLIC_CMDQ_MAXCMDS + 1];
 	/* Free object handles*/
 	struct slic_handle *pfree_slic_handles;
 	/* Object handle list lock*/
@@ -512,6 +512,6 @@ struct adapter {
 #define FLUSH		true
 #define DONT_FLUSH	false
 
-#define SIOCSLICSETINTAGG        (SIOCDEVPRIVATE+10)
+#define SIOCSLICSETINTAGG        (SIOCDEVPRIVATE + 10)
 
 #endif /*  __SLIC_DRIVER_H__ */
drivers/staging/slicoss/slicoss.c +1 -1
index c88ed69..8ce9000 100644
@@ -160,7 +160,7 @@ static void slic_mcast_set_bit(struct adapter *adapter, char *address)
 	/* Get the CRC polynomial for the mac address */
 	/* we use bits 1-8 (lsb), bitwise reversed,
 	 * msb (= lsb bit 0 before bitrev) is automatically discarded */
-	crcpoly = ether_crc(ETH_ALEN, address)>>23;
+	crcpoly = ether_crc(ETH_ALEN, address) >> 23;
 
 	/* We only have space on the SLIC for 64 entries.  Lop
 	 * off the top two bits. (2^6 = 64)
Signature · 1 line
1.7.9.5
#12 lore raw

PATCH v2 4/4 staging: slicoss: Fixes block comment style

In reply to Amarjargal Gundjalam

This patch fixes the checkpatch.pl warnings:

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

---
Changes in v2:
- Uses correct block comment style, with the starting /* on a line by itself.

---
 drivers/staging/slicoss/slic.h    |   17 ++---
 drivers/staging/slicoss/slichw.h  |   38 +++++++----
 drivers/staging/slicoss/slicoss.c |  131 ++++++++++++++++++++++---------------
 3 files changed, 113 insertions(+), 73 deletions(-)
drivers/staging/slicoss/slic.h +9 -8
index 92c6862..c95b3ab 100644
@@ -93,10 +93,10 @@ struct slic_rcvbuf_info {
 	u32     lastid;
 };
 /*
- SLIC Handle structure.  Used to restrict handle values to
- 32 bits by using an index rather than an address.
- Simplifies ucode in 64-bit systems
-*/
+ * SLIC Handle structure.  Used to restrict handle values to
+ * 32 bits by using an index rather than an address.
+ * Simplifies ucode in 64-bit systems
+ */
 struct slic_handle_word {
 	union {
 		struct {
@@ -333,10 +333,11 @@ struct physcard {
 	struct physcard *next;
 	uint                adapters_allocd;
 
-/*  the following is not currently needed
-	u32              bridge_busnum;
-	u32              bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS];
-*/
+/*
+ * the following is not currently needed
+ *	u32              bridge_busnum;
+ *	u32              bridge_cfg[NUM_CFG_SPACES][NUM_CFG_REG_ULONGS];
+ */
 };
 
 struct base_driver {
drivers/staging/slicoss/slichw.h +24 -14
index 21cd02b..9723b4a 100644
@@ -307,9 +307,11 @@ struct slic_regs {
 
 	u32	slic_hbar;	/* Header buffer address reg */
 	u32	pad4;
-	/* 31-8 - phy addr of set of contiguous hdr buffers
-	    7-0 - number of buffers passed
-	   Buffers are 256 bytes long on 256-byte boundaries. */
+	/*
+	 * 31-8 - phy addr of set of contiguous hdr buffers
+	 *  7-0 - number of buffers passed
+	 * Buffers are 256 bytes long on 256-byte boundaries.
+	 */
 #define SLIC_HBAR		0x0020
 #define SLIC_HBAR_CNT_MSK	0x000000FF
 
@@ -321,10 +323,12 @@ struct slic_regs {
 #define SLIC_DBAR_SIZE		2048
 
 	u32	slic_cbar;	/* Xmt Cmd buf addr regs.*/
-	/* 1 per XMT interface
-	   31-5 - phy addr of host command buffer
-	    4-0 - length of cmd in multiples of 32 bytes
-	   Buffers are 32 bytes up to 512 bytes long */
+	/*
+	 * 1 per XMT interface
+	 * 31-5 - phy addr of host command buffer
+	 *  4-0 - length of cmd in multiples of 32 bytes
+	 * Buffers are 32 bytes up to 512 bytes long
+	 */
 #define SLIC_CBAR		0x0030
 #define SLIC_CBAR_LEN_MSK	0x0000001F
 #define SLIC_CBAR_ALIGN		0x00000020
@@ -336,9 +340,11 @@ struct slic_regs {
 
 	u32	slic_rbar;	/* Response buffer address reg.*/
 	u32	pad7;
-	 /*31-8 - phy addr of set of contiguous response buffers
-	  7-0 - number of buffers passed
-	 Buffers are 32 bytes long on 32-byte boundaries.*/
+	/*
+	 * 31-8 - phy addr of set of contiguous response buffers
+	 * 7-0 - number of buffers passed
+	 * Buffers are 32 bytes long on 32-byte boundaries.
+	 */
 #define SLIC_RBAR		0x0038
 #define SLIC_RBAR_CNT_MSK	0x000000FF
 #define SLIC_RBAR_SIZE		32
@@ -430,7 +436,8 @@ struct slic_regs {
 #define SLIC_LOW_POWER	0x00e0
 
 	u32	slic_quiesce;	/* force slic into quiescent state
-				   before soft reset */
+				 * before soft reset
+				 */
 	u32	pad30;
 #define SLIC_QUIESCE	0x00e8
 
@@ -718,7 +725,8 @@ struct slic_eeprom {
 	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
-				    (simba/leone only) */
+				 *  (simba/leone only)
+				 */
 	u8 NetIntPin2;		/* Network Interface Pin 2 (simba/leone only)*/
 	union {
 		u8 NetIntPin3;	/* 18 Network Interface Pin 3 (simba only) */
@@ -748,7 +756,8 @@ struct slic_eeprom {
 	union oemfru OemFru;	/* 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 */
+				 * bytes at the end
+				 */
 };
 
 /* SLIC EEPROM structure for Oasis */
@@ -772,7 +781,8 @@ struct oslic_eeprom {
 	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
-					(bytes / 4K) */
+				 *	(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 */
drivers/staging/slicoss/slicoss.c +80 -51

249 lines not on this page · raw message

Signature · 1 line
1.7.9.5