Skip to contentSkip to conversation

staging: slicoss: minor changes to clean some code

PATCH New Sergio Paracuellos 1 participant 3 messages Nov 24, 2016 Staging

lore
Share & tools
lore
#0 lore raw

v3 cover staging: slicoss: minor changes to clean some code

This patchset clean some code in slicoss driver:
* Removes not used macro.
* Remove a macro and just inline code.

Changes in v2:
* Remove inline function into inline code.

Changes in v3:
* Replace '=' in favour of '+='.

Sergio Paracuellos (2):
staging: slicoss: remove not used UPDATE_STATS macro
staging: slicoss: remove UPDATE_STATS_GB macro and inline code

 drivers/staging/slicoss/slic.h    | 13 ----------
 drivers/staging/slicoss/slicoss.c | 52 +++++++++++++++++++--------------------
 2 files changed, 25 insertions(+), 40 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v3 1/2 staging: slicoss: remove not used UPDATE_STATS macro

This patch remove UPDATE_STATS macro from
header slic.h which is not being used.

---
 drivers/staging/slicoss/slic.h | 8 --------
 1 file changed, 8 deletions(-)
drivers/staging/slicoss/slic.h +0 -8
index 1f6562c..2c05868 100644
@@ -548,14 +548,6 @@ static inline void slic_flush_write(struct adapter *adapter)
 	ioread32(adapter->regs + SLIC_REG_HOSTID);
 }
 
-#define UPDATE_STATS(largestat, newstat, oldstat)                        \
-{                                                                        \
-	if ((newstat) < (oldstat))                                       \
-		(largestat) += ((newstat) + (0xFFFFFFFF - oldstat + 1)); \
-	else                                                             \
-		(largestat) += ((newstat) - (oldstat));                  \
-}
-
 #define UPDATE_STATS_GB(largestat, newstat, oldstat)                     \
 {                                                                        \
 	(largestat) += ((newstat) - (oldstat));                          \
Signature · 1 line
1.9.1
#2 lore raw

PATCH v3 2/2 staging: slicoss: remove UPDATE_STATS_GB macro and inline code

In reply to Sergio Paracuellos

This patch removes UPDATE_STATS_GB macro in slic.h header file and just inline code. This improve readability.

---
 drivers/staging/slicoss/slic.h    |  5 ----
 drivers/staging/slicoss/slicoss.c | 52 +++++++++++++++++++--------------------
 2 files changed, 25 insertions(+), 32 deletions(-)
drivers/staging/slicoss/slic.h +0 -5
index 2c05868..2893bdf 100644
@@ -548,11 +548,6 @@ static inline void slic_flush_write(struct adapter *adapter)
 	ioread32(adapter->regs + SLIC_REG_HOSTID);
 }
 
-#define UPDATE_STATS_GB(largestat, newstat, oldstat)                     \
-{                                                                        \
-	(largestat) += ((newstat) - (oldstat));                          \
-}
-
 #if BITS_PER_LONG == 64
 #define   SLIC_GET_ADDR_LOW(_addr)  (u32)((u64)(_addr) & \
 	0x00000000FFFFFFFF)
drivers/staging/slicoss/slicoss.c +25 -27

70 lines not on this page · raw message

Signature · 1 line
1.9.1