liquidio: standardization and cleanup
Subsystems (3)
v2 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. Added driver cleanup 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
PATCH v2 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
@@ -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
PATCH v2 2/2 liquidio: cleanup: removed cryptic and misleading macro
In reply to Felix ManlunasFrom: 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
@@ -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
David Miller
maintainerRe: [PATCH v2 net-next 2/2] liquidio: cleanup: removed cryptic and misleading macro
From: Felix Manlunas <[email protected]>
Date: Mon, 24 Jul 2017 17:17:27 -0700
Quoted 22 lines
From: Rick Farrington <[email protected]>
Signed-off-by Rick Farrington <[email protected]>Signed-off-by Felix Manlunas <[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 +0
-2@@ -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
drivers/net/ethernet/cavium/liquidio/octeon_console.c static int __cvmx_bootmem_check_version(struct octeon_device *oct, · line 234
Quoted 5 lines
drivers/net/ethernet/cavium/liquidio/octeon_console.c +1
-1@@ -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));
Too many parenthesis.
When oct->bootmem_desc_addr was the argument to a macro/function, yes the parenthesis were necessary. But now they should be removed.