Skip to contentSkip to conversation

Use MICRO UINT_MAX instead of actual value

PATCH Superseded Minfei Huang 3 participants 6 messages Apr 25, 2016 – May 16, 2016 NVMe

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use MICRO UINT_MAX instead of actual value

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

Signed-off-by Minfei Huang <mnghuan at gmail.com>
---
 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
#1 lore raw
Quoted 3 lines

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

You mean macro right?

#2 lore raw
Quoted 5 lines · Sagi Grimberg
Quoted 3 lines

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

You mean macro right?

Yep. Sorry for the typo error.

Thanks
Minfei

#3 lore raw
In reply to Minfei Huang

Ping.

Any comment is appreciate.

Thanks
Minfei

Quoted 24 lines · Minfei Huang

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

Signed-off-by Minfei Huang <mnghuan at gmail.com>
---
 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
#4 lore raw

PATCH 1/1 Use MICRO UINT_MAX instead of actual value

Quoted 3 lines · Minfei Huang

Ping.

Any comment is appreciate.

Hi Minfei, I guess a good idea would be to resend the patch with the typo fixed, as a v2 patch. What do you think?

Cheers,

Guilherme

Quoted 35 lines

Thanks
Minfei

Quoted 22 lines · Minfei Huang

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

Signed-off-by Minfei Huang <mnghuan at gmail.com>
---
  drivers/nvme/host/core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -2
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);
  }
 
--
Quoted 2 lines

2.6.3

_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

#5 lore raw
In reply to Minfei Huang
Quoted 3 lines · Minfei Huang

Ping.

Any comment is appreciate.

Hi Minfei, I guess a good idea would be to resend the patch with the typo fixed, as a v2 patch. What do you think?

Cheers,

Guilherme

Quoted 35 lines

Thanks
Minfei

Quoted 22 lines · Minfei Huang

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

---
  drivers/nvme/host/core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -2
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);
  }
 
--
Quoted 2 lines

2.6.3

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme