All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] staging: slicoss: Fixes multiple checkpatch issues
@ 2015-10-24 22:37 Amarjargal Gundjalam
  2015-10-24 22:37 ` [PATCH 1/4] staging: slicoss: Removes multiple blank lines Amarjargal Gundjalam
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Amarjargal Gundjalam @ 2015-10-24 22:37 UTC (permalink / raw)
  To: outreachy-kernel

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(-)

-- 
1.7.9.5



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

* [PATCH 1/4] staging: slicoss: Removes multiple blank lines
  2015-10-24 22:37 [PATCH 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
@ 2015-10-24 22:37 ` Amarjargal Gundjalam
  2015-10-24 22:37 ` [PATCH 2/4] staging: slicoss: Removes unnecessary space after a cast Amarjargal Gundjalam
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Amarjargal Gundjalam @ 2015-10-24 22:37 UTC (permalink / raw)
  To: outreachy-kernel

This patch fixes the checkpatch.pl check:

CHECK: Please don't use multiple blank lines

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
---
 drivers/staging/slicoss/slic.h    |    2 --
 drivers/staging/slicoss/slicoss.c |    5 -----
 2 files changed, 7 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 00b8af6..6ccd1d5 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -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))                                       \
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 3600176..a226055 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -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) {
-- 
1.7.9.5



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

* [PATCH 2/4] staging: slicoss: Removes unnecessary space after a cast
  2015-10-24 22:37 [PATCH 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
  2015-10-24 22:37 ` [PATCH 1/4] staging: slicoss: Removes multiple blank lines Amarjargal Gundjalam
@ 2015-10-24 22:37 ` Amarjargal Gundjalam
  2015-10-24 22:37 ` [PATCH 3/4] staging: slicoss: Adds space around operators Amarjargal Gundjalam
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Amarjargal Gundjalam @ 2015-10-24 22:37 UTC (permalink / raw)
  To: outreachy-kernel

This patch fixes the checkpatch.pl check:

CHECK: No space is necessary after a cast

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
---
 drivers/staging/slicoss/slicoss.c |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index a226055..c88ed69 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -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;
 
-- 
1.7.9.5



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

* [PATCH 3/4] staging: slicoss: Adds space around operators
  2015-10-24 22:37 [PATCH 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
  2015-10-24 22:37 ` [PATCH 1/4] staging: slicoss: Removes multiple blank lines Amarjargal Gundjalam
  2015-10-24 22:37 ` [PATCH 2/4] staging: slicoss: Removes unnecessary space after a cast Amarjargal Gundjalam
@ 2015-10-24 22:37 ` Amarjargal Gundjalam
  2015-10-24 22:37 ` [PATCH 4/4] staging: slicoss: Fixes block comment style Amarjargal Gundjalam
  2015-10-25 14:48 ` [PATCH v2 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
  4 siblings, 0 replies; 13+ messages in thread
From: Amarjargal Gundjalam @ 2015-10-24 22:37 UTC (permalink / raw)
  To: outreachy-kernel

This patch fixes the checkpatch.pl check:

CHECK: spaces preferred around that ‘’

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
---
 drivers/staging/slicoss/slic.h    |    4 ++--
 drivers/staging/slicoss/slicoss.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 6ccd1d5..92c6862 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -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__ */
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index c88ed69..8ce9000 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -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)
-- 
1.7.9.5



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

* [PATCH 4/4] staging: slicoss: Fixes block comment style
  2015-10-24 22:37 [PATCH 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
                   ` (2 preceding siblings ...)
  2015-10-24 22:37 ` [PATCH 3/4] staging: slicoss: Adds space around operators Amarjargal Gundjalam
@ 2015-10-24 22:37 ` Amarjargal Gundjalam
  2015-10-25  7:40   ` [Outreachy kernel] " Julia Lawall
  2015-10-25 14:48 ` [PATCH v2 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
  4 siblings, 1 reply; 13+ messages in thread
From: Amarjargal Gundjalam @ 2015-10-24 22:37 UTC (permalink / raw)
  To: outreachy-kernel

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 <amarjargal.gundjalam@gmail.com>
---
 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];
+ */
 };
 
 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_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++) {
 
-- 
1.7.9.5



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

* Re: [Outreachy kernel] [PATCH 4/4] staging: slicoss: Fixes block comment style
  2015-10-24 22:37 ` [PATCH 4/4] staging: slicoss: Fixes block comment style Amarjargal Gundjalam
@ 2015-10-25  7:40   ` Julia Lawall
  2015-10-25 10:57     ` amarjargal
  0 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2015-10-25  7:40 UTC (permalink / raw)
  To: Amarjargal Gundjalam; +Cc: outreachy-kernel

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 <amarjargal.gundjalam@gmail.com>
> ---
>  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_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++) {
>  
> -- 
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
> 


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

* Re: [Outreachy kernel] [PATCH 4/4] staging: slicoss: Fixes block comment style
  2015-10-25  7:40   ` [Outreachy kernel] " Julia Lawall
@ 2015-10-25 10:57     ` amarjargal
  2015-10-25 11:04       ` Julia Lawall
  0 siblings, 1 reply; 13+ messages in thread
From: amarjargal @ 2015-10-25 10:57 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: amarjargal.gundjalam


[-- Attachment #1.1: Type: text/plain, Size: 17147 bytes --]

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

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 <amarjargal...@gmail.com 
> <javascript:>> 
> > --- 
> >  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_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++) { 
> >   
> > -- 
> > 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 outreachy-kern...@googlegroups.com <javascript:>. 
> > To post to this group, send email to outreach...@googlegroups.com 
> <javascript:>. 
> > 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. 
> > 
>

[-- Attachment #1.2: Type: text/html, Size: 25965 bytes --]

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

* Re: [Outreachy kernel] [PATCH 4/4] staging: slicoss: Fixes block comment style
  2015-10-25 10:57     ` amarjargal
@ 2015-10-25 11:04       ` Julia Lawall
  0 siblings, 0 replies; 13+ messages in thread
From: Julia Lawall @ 2015-10-25 11:04 UTC (permalink / raw)
  To: amarjargal; +Cc: outreachy-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 24881 bytes --]

On Sun, 25 Oct 2015, amarjargal wrote:

> 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

> 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 <amarjargal...@gmail.com>
>       > ---
>       >  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 outreachy-kern...@googlegroups.com.
>       > To post to this group, send email to
>       outreach...@googlegroups.com.
>       > 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>
>

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

* [PATCH v2 0/4] staging: slicoss: Fixes multiple checkpatch issues
  2015-10-24 22:37 [PATCH 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
                   ` (3 preceding siblings ...)
  2015-10-24 22:37 ` [PATCH 4/4] staging: slicoss: Fixes block comment style Amarjargal Gundjalam
@ 2015-10-25 14:48 ` Amarjargal Gundjalam
  2015-10-25 14:48   ` [PATCH v2 1/4] staging: slicoss: Removes multiple blank lines Amarjargal Gundjalam
                     ` (3 more replies)
  4 siblings, 4 replies; 13+ messages in thread
From: Amarjargal Gundjalam @ 2015-10-25 14:48 UTC (permalink / raw)
  To: outreachy-kernel

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(-)

-- 
1.7.9.5



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

* [PATCH v2 1/4] staging: slicoss: Removes multiple blank lines
  2015-10-25 14:48 ` [PATCH v2 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
@ 2015-10-25 14:48   ` Amarjargal Gundjalam
  2015-10-25 14:48   ` [PATCH v2 2/4] staging: slicoss: Removes unnecessary space after a cast Amarjargal Gundjalam
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Amarjargal Gundjalam @ 2015-10-25 14:48 UTC (permalink / raw)
  To: outreachy-kernel

This patch fixes the checkpatch.pl check:

CHECK: Please don't use multiple blank lines

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
---
 drivers/staging/slicoss/slic.h    |    2 --
 drivers/staging/slicoss/slicoss.c |    5 -----
 2 files changed, 7 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 00b8af6..6ccd1d5 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -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))                                       \
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 3600176..a226055 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -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) {
-- 
1.7.9.5



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

* [PATCH v2 2/4] staging: slicoss: Removes unnecessary space after a cast
  2015-10-25 14:48 ` [PATCH v2 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
  2015-10-25 14:48   ` [PATCH v2 1/4] staging: slicoss: Removes multiple blank lines Amarjargal Gundjalam
@ 2015-10-25 14:48   ` Amarjargal Gundjalam
  2015-10-25 14:48   ` [PATCH v2 3/4] staging: slicoss: Adds space around operators Amarjargal Gundjalam
  2015-10-25 14:48   ` [PATCH v2 4/4] staging: slicoss: Fixes block comment style Amarjargal Gundjalam
  3 siblings, 0 replies; 13+ messages in thread
From: Amarjargal Gundjalam @ 2015-10-25 14:48 UTC (permalink / raw)
  To: outreachy-kernel

This patch fixes the checkpatch.pl check:

CHECK: No space is necessary after a cast

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
---
 drivers/staging/slicoss/slicoss.c |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index a226055..c88ed69 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -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;
 
-- 
1.7.9.5



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

* [PATCH v2 3/4] staging: slicoss: Adds space around operators
  2015-10-25 14:48 ` [PATCH v2 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
  2015-10-25 14:48   ` [PATCH v2 1/4] staging: slicoss: Removes multiple blank lines Amarjargal Gundjalam
  2015-10-25 14:48   ` [PATCH v2 2/4] staging: slicoss: Removes unnecessary space after a cast Amarjargal Gundjalam
@ 2015-10-25 14:48   ` Amarjargal Gundjalam
  2015-10-25 14:48   ` [PATCH v2 4/4] staging: slicoss: Fixes block comment style Amarjargal Gundjalam
  3 siblings, 0 replies; 13+ messages in thread
From: Amarjargal Gundjalam @ 2015-10-25 14:48 UTC (permalink / raw)
  To: outreachy-kernel

This patch fixes the checkpatch.pl check:

CHECK: spaces preferred around that ‘’

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
---
 drivers/staging/slicoss/slic.h    |    4 ++--
 drivers/staging/slicoss/slicoss.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 6ccd1d5..92c6862 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -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__ */
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index c88ed69..8ce9000 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -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)
-- 
1.7.9.5



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

* [PATCH v2 4/4] staging: slicoss:  Fixes block comment style
  2015-10-25 14:48 ` [PATCH v2 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
                     ` (2 preceding siblings ...)
  2015-10-25 14:48   ` [PATCH v2 3/4] staging: slicoss: Adds space around operators Amarjargal Gundjalam
@ 2015-10-25 14:48   ` Amarjargal Gundjalam
  3 siblings, 0 replies; 13+ messages in thread
From: Amarjargal Gundjalam @ 2015-10-25 14:48 UTC (permalink / raw)
  To: outreachy-kernel

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 <amarjargal.gundjalam@gmail.com>
---
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(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 92c6862..c95b3ab 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 {
@@ -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 {
diff --git a/drivers/staging/slicoss/slichw.h b/drivers/staging/slicoss/slichw.h
index 21cd02b..9723b4a 100644
--- a/drivers/staging/slicoss/slichw.h
+++ b/drivers/staging/slicoss/slichw.h
@@ -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 */
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 8ce9000..b23a2d1 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -158,11 +158,14 @@ static void slic_mcast_set_bit(struct adapter *adapter, char *address)
 	unsigned char crcpoly;
 
 	/* 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 */
+	/*
+	 * we use bits 1-8 (lsb), bitwise reversed,
+	 * 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
+	/*
+	 * We only have space on the SLIC for 64 entries.  Lop
 	 * off the top two bits. (2^6 = 64)
 	 */
 	crcpoly &= 0x3F;
@@ -176,7 +179,8 @@ static void slic_mcast_set_mask(struct adapter *adapter)
 	__iomem struct slic_regs *slic_regs = adapter->slic_regs;
 
 	if (adapter->macopts & (MAC_ALLMCAST | MAC_PROMISC)) {
-		/* Turn on all multicast addresses. We have to do this for
+		/*
+		 * Turn on all multicast addresses. We have to do this for
 		 * promiscuous mode as well as ALLMCAST mode.  It saves the
 		 * Microcode from having to keep state about the MAC
 		 * configuration.
@@ -185,7 +189,8 @@ static void slic_mcast_set_mask(struct adapter *adapter)
 		slic_reg32_write(&slic_regs->slic_mcasthigh, 0xFFFFFFFF,
 				 FLUSH);
 	} else {
-		/* Commit our multicast mast to the SLIC by writing to the
+		/*
+		 * Commit our multicast mast to the SLIC by writing to the
 		 * multicast address mask registers
 		 */
 		slic_reg32_write(&slic_regs->slic_mcastlow,
@@ -242,7 +247,8 @@ static void slic_link_config(struct adapter *adapter,
 
 	if ((linkspeed == LINK_AUTOSPEED) || (linkspeed == LINK_1000MB)) {
 		if (adapter->flags & ADAPT_FLAGS_FIBERMEDIA) {
-			/*  We've got a fiber gigabit interface, and register
+			/*
+			 * We've got a fiber gigabit interface, and register
 			 *  4 is different in fiber mode than in copper mode
 			 */
 
@@ -260,16 +266,22 @@ static void slic_link_config(struct adapter *adapter,
 				      PCR_AUTONEG_RST));
 				slic_reg32_write(wphy, phy_config, FLUSH);
 			} else {	/* forced 1000 Mb FD*/
-				/* power down phy to break link
-				   this may not work) */
+				/*
+				 * power down phy to break link
+				 * 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  */
+				/*
+				 * wait, Marvell says 1 sec,
+				 * try to get away with 10 ms
+				 */
 				mdelay(10);
 
-				/* disable auto-neg, set speed/duplex,
-				   soft reset phy, powerup */
+				/*
+				 * disable auto-neg, set speed/duplex,
+				 * soft reset phy, powerup
+				 */
 				phy_config =
 				    (MIICR_REG_PCR |
 				     (PCR_RESET | PCR_SPEED_1000 |
@@ -278,7 +290,8 @@ static void slic_link_config(struct adapter *adapter,
 			}
 		} else {	/* copper gigabit */
 
-			/* Auto-Negotiate or 1000 Mb must be auto negotiated
+			/*
+			 * Auto-Negotiate or 1000 Mb must be auto negotiated
 			 * We've got a copper gigabit interface, and
 			 * register 4 is different in copper mode than
 			 * in fiber mode
@@ -290,8 +303,10 @@ 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 +319,10 @@ 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 +353,10 @@ 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);
 		}
@@ -350,9 +369,11 @@ static void slic_link_config(struct adapter *adapter,
 		mdelay(10);
 
 		if (adapter->subsysid != SLIC_1GB_CICADA_SUBSYS_ID) {
-			/* if a Marvell PHY
-			   disable auto-neg, set speed,
-			   soft reset phy, powerup */
+			/*
+			 * if a Marvell PHY
+			 * 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 +550,13 @@ 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);
@@ -541,8 +564,10 @@ static int slic_card_download(struct adapter *adapter)
 	mdelay(10);
 	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 */
+	/*
+	 * stall for 20 ms, long enough for ucode to init card
+	 * and reach mainloop
+	 */
 	mdelay(20);
 
 	return 0;
@@ -602,9 +627,11 @@ static void slic_mac_address_config(struct adapter *adapter)
 	slic_reg32_write(&slic_regs->slic_wraddrah, value2, FLUSH);
 	slic_reg32_write(&slic_regs->slic_wraddrbh, value2, FLUSH);
 
-	/* Write our multicast mask out to the card.  This is done */
-	/* here in addition to the slic_mcast_addr_set routine     */
-	/* because ALL_MCAST may have been enabled or disabled     */
+	/*
+	 * Write our multicast mask out to the card.  This is done
+	 * here in addition to the slic_mcast_addr_set routine
+	 * because ALL_MCAST may have been enabled or disabled
+	 */
 	slic_mcast_set_mask(adapter);
 }
 
@@ -885,10 +912,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;
@@ -2049,8 +2076,8 @@ static void slic_xmit_complete(struct adapter *adapter)
 		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].
@@ -2758,10 +2785,12 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
 			oemfruformat = pOeeprom->OemFruFormat;
 			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 */
+			/*
+			 * Minor kludge for Oasis card
+			 * 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 */
@@ -2784,14 +2813,14 @@ 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 +2919,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



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

end of thread, other threads:[~2015-10-25 14:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-24 22:37 [PATCH 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
2015-10-24 22:37 ` [PATCH 1/4] staging: slicoss: Removes multiple blank lines Amarjargal Gundjalam
2015-10-24 22:37 ` [PATCH 2/4] staging: slicoss: Removes unnecessary space after a cast Amarjargal Gundjalam
2015-10-24 22:37 ` [PATCH 3/4] staging: slicoss: Adds space around operators Amarjargal Gundjalam
2015-10-24 22:37 ` [PATCH 4/4] staging: slicoss: Fixes block comment style Amarjargal Gundjalam
2015-10-25  7:40   ` [Outreachy kernel] " Julia Lawall
2015-10-25 10:57     ` amarjargal
2015-10-25 11:04       ` Julia Lawall
2015-10-25 14:48 ` [PATCH v2 0/4] staging: slicoss: Fixes multiple checkpatch issues Amarjargal Gundjalam
2015-10-25 14:48   ` [PATCH v2 1/4] staging: slicoss: Removes multiple blank lines Amarjargal Gundjalam
2015-10-25 14:48   ` [PATCH v2 2/4] staging: slicoss: Removes unnecessary space after a cast Amarjargal Gundjalam
2015-10-25 14:48   ` [PATCH v2 3/4] staging: slicoss: Adds space around operators Amarjargal Gundjalam
2015-10-25 14:48   ` [PATCH v2 4/4] staging: slicoss: Fixes block comment style Amarjargal Gundjalam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.