Skip to contentSkip to conversation

liquidio: standardization and cleanup

PATCH In review Felix Manlunas 2 participants 4 messages Jul 26, 2017 – Jul 28, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover liquidio: standardization and cleanup

From: Rick Farrington <[email protected]>

This patchset corrects some non-standard macro usage.

1. Replaced custom MIN macro with use of standard 'min_t'.
2. Removed cryptic and misleading macro 'CAST_ULL'.

change log:
V1 -> V2:
1. Add driver cleanup of macro 'CAST_ULL'.
V2 -> V3:
1. Remove extra parentheses from previous usage of macro 'CAST_ULL'.

Rick Farrington (2):
liquidio: standardization: use min_t instead of custom macro
liquidio: cleanup: removed cryptic and misleading macro

 drivers/net/ethernet/cavium/liquidio/octeon_console.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Signature · 1 line
2.9.0
#1 lore raw

PATCH v3 1/2 liquidio: standardization: use min_t instead of custom macro

From: Rick Farrington <[email protected]>

---
 drivers/net/ethernet/cavium/liquidio/octeon_console.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/cavium/liquidio/octeon_console.c +1 -2
index e08f760..501ad95 100644
@@ -42,7 +42,6 @@ module_param(console_bitmask, int, 0644);
 MODULE_PARM_DESC(console_bitmask,
 		 "Bitmask indicating which consoles have debug output redirected to syslog.");
 
-#define MIN(a, b) min((a), (b))
 #define CAST_ULL(v) ((u64)(v))
 
 #define BOOTLOADER_PCI_READ_BUFFER_DATA_ADDR    0x0006c008
@@ -704,7 +703,7 @@ static int octeon_console_read(struct octeon_device *oct, u32 console_num,
 	if (bytes_to_read <= 0)
 		return bytes_to_read;
 
-	bytes_to_read = MIN(bytes_to_read, (s32)buf_size);
+	bytes_to_read = min_t(s32, bytes_to_read, buf_size);
 
 	/* Check to see if what we want to read is not contiguous, and limit
 	 * ourselves to the contiguous block
Signature · 1 line
2.9.0
#2 lore raw

PATCH v3 2/2 liquidio: cleanup: removed cryptic and misleading macro

In reply to Felix Manlunas

From: Rick Farrington <[email protected]>

---
 drivers/net/ethernet/cavium/liquidio/octeon_console.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/cavium/liquidio/octeon_console.c +1 -3
index 501ad95..15ad1ab 100644
@@ -42,8 +42,6 @@ module_param(console_bitmask, int, 0644);
 MODULE_PARM_DESC(console_bitmask,
 		 "Bitmask indicating which consoles have debug output redirected to syslog.");
 
-#define CAST_ULL(v) ((u64)(v))
-
 #define BOOTLOADER_PCI_READ_BUFFER_DATA_ADDR    0x0006c008
 #define BOOTLOADER_PCI_READ_BUFFER_LEN_ADDR     0x0006c004
 #define BOOTLOADER_PCI_READ_BUFFER_OWNER_ADDR   0x0006c000
@@ -233,7 +231,7 @@ static int __cvmx_bootmem_check_version(struct octeon_device *oct,
 	    (exact_match && major_version != exact_match)) {
 		dev_err(&oct->pci_dev->dev, "bootmem ver mismatch %d.%d addr:0x%llx\n",
 			major_version, minor_version,
-			CAST_ULL(oct->bootmem_desc_addr));
+			(long long)oct->bootmem_desc_addr);
 		return -1;
 	} else {
 		return 0;
Signature · 1 line
2.9.0
maintainer
#3 lore raw
In reply to Felix Manlunas

From: Felix Manlunas <[email protected]>
Date: Wed, 26 Jul 2017 12:09:45 -0700

Quoted 4 lines

From: Rick Farrington <[email protected]>

This patchset corrects some non-standard macro usage.

Quoted 8 lines

1. Replaced custom MIN macro with use of standard 'min_t'.
2. Removed cryptic and misleading macro 'CAST_ULL'.

change log:
V1 -> V2:
1. Add driver cleanup of macro 'CAST_ULL'.
V2 -> V3:
1. Remove extra parentheses from previous usage of macro 'CAST_ULL'.

Series applied, thank you.