netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/2] liquidio: standardization and cleanup
@ 2017-07-25  0:15 Felix Manlunas
  2017-07-25  0:16 ` [PATCH v2 net-next 1/2] liquidio: standardization: use min_t instead of custom macro Felix Manlunas
  2017-07-25  0:17 ` [PATCH v2 net-next 2/2] liquidio: cleanup: removed cryptic and misleading macro Felix Manlunas
  0 siblings, 2 replies; 4+ messages in thread
From: Felix Manlunas @ 2017-07-25  0:15 UTC (permalink / raw)
  To: davem
  Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
	ricardo.farrington

From: Rick Farrington <ricardo.farrington@cavium.com>

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

-- 
2.9.0

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

* [PATCH v2 net-next 1/2] liquidio: standardization: use min_t instead of custom macro
  2017-07-25  0:15 [PATCH v2 net-next 0/2] liquidio: standardization and cleanup Felix Manlunas
@ 2017-07-25  0:16 ` Felix Manlunas
  2017-07-25  0:17 ` [PATCH v2 net-next 2/2] liquidio: cleanup: removed cryptic and misleading macro Felix Manlunas
  1 sibling, 0 replies; 4+ messages in thread
From: Felix Manlunas @ 2017-07-25  0:16 UTC (permalink / raw)
  To: davem
  Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
	ricardo.farrington

From: Rick Farrington <ricardo.farrington@cavium.com>

Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
---
 drivers/net/ethernet/cavium/liquidio/octeon_console.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_console.c b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
index e08f760..501ad95 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_console.c
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
@@ -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
-- 
2.9.0

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

* [PATCH v2 net-next 2/2] liquidio: cleanup: removed cryptic and misleading macro
  2017-07-25  0:15 [PATCH v2 net-next 0/2] liquidio: standardization and cleanup Felix Manlunas
  2017-07-25  0:16 ` [PATCH v2 net-next 1/2] liquidio: standardization: use min_t instead of custom macro Felix Manlunas
@ 2017-07-25  0:17 ` Felix Manlunas
  2017-07-26  4:20   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Felix Manlunas @ 2017-07-25  0:17 UTC (permalink / raw)
  To: davem
  Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
	ricardo.farrington

From: Rick Farrington <ricardo.farrington@cavium.com>

Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
---
 drivers/net/ethernet/cavium/liquidio/octeon_console.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_console.c b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
index 501ad95..0770183 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_console.c
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
@@ -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;
-- 
2.9.0

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

* Re: [PATCH v2 net-next 2/2] liquidio: cleanup: removed cryptic and misleading macro
  2017-07-25  0:17 ` [PATCH v2 net-next 2/2] liquidio: cleanup: removed cryptic and misleading macro Felix Manlunas
@ 2017-07-26  4:20   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-07-26  4:20 UTC (permalink / raw)
  To: felix.manlunas
  Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
	ricardo.farrington

From: Felix Manlunas <felix.manlunas@cavium.com>
Date: Mon, 24 Jul 2017 17:17:27 -0700

> From: Rick Farrington <ricardo.farrington@cavium.com>
> 
> Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
> ---
>  drivers/net/ethernet/cavium/liquidio/octeon_console.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_console.c b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
> index 501ad95..0770183 100644
> --- a/drivers/net/ethernet/cavium/liquidio/octeon_console.c
> +++ b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
> @@ -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));

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.

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

end of thread, other threads:[~2017-07-26  4:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25  0:15 [PATCH v2 net-next 0/2] liquidio: standardization and cleanup Felix Manlunas
2017-07-25  0:16 ` [PATCH v2 net-next 1/2] liquidio: standardization: use min_t instead of custom macro Felix Manlunas
2017-07-25  0:17 ` [PATCH v2 net-next 2/2] liquidio: cleanup: removed cryptic and misleading macro Felix Manlunas
2017-07-26  4:20   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).