Skip to contentSkip to conversation

Use MACRO UINT_MAX instead of actual value

PATCH In review Minfei Huang 2 participants 3 messages May 17, 2016 – Jun 8, 2016 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Use MACRO UINT_MAX instead of actual value

It's more elegant to use MACRO UINT_MAX to represent the max value of type unsigned int. So replace the actual value by using this MACRO.

Signed-off-by Minfei Huang <mnghuan at gmail.com>

---
v1:
- fix typo

---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
index 643f457..2c0bb13 100644
@@ -597,7 +597,7 @@ static void nvme_config_discard(struct nvme_ns *ns)
 
 	ns->queue->limits.discard_alignment = logical_block_size;
 	ns->queue->limits.discard_granularity = logical_block_size;
-	blk_queue_max_discard_sectors(ns->queue, 0xffffffff);
+	blk_queue_max_discard_sectors(ns->queue, UINT_MAX);
 	queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, ns->queue);
 }
 
Signature · 1 line
2.6.3
#1 lore raw

Ping. Any comment is appreciate.

Thanks
Minfei

Quoted 27 lines · Minfei Huang

It's more elegant to use MACRO UINT_MAX to represent the max value of type unsigned int. So replace the actual value by using this MACRO.

Signed-off-by Minfei Huang <mnghuan at gmail.com>

---
v1:
- fix typo

---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
index 643f457..2c0bb13 100644
@@ -597,7 +597,7 @@ static void nvme_config_discard(struct nvme_ns *ns)
 
 	ns->queue->limits.discard_alignment = logical_block_size;
 	ns->queue->limits.discard_granularity = logical_block_size;
-	blk_queue_max_discard_sectors(ns->queue, 0xffffffff);
+	blk_queue_max_discard_sectors(ns->queue, UINT_MAX);
 	queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, ns->queue);
 }
 
Signature · 1 line
2.6.3
maintainer
#2 lore raw

PATCH v2 1/1 Use MACRO UINT_MAX instead of actual value

In reply to Minfei Huang
Quoted 2 lines · Minfei Huang

It's more elegant to use MACRO UINT_MAX to represent the max value of type unsigned int. So replace the actual value by using this MACRO.

Added for 4.8, thanks.

Signature · 1 line
Jens Axboe