* [PATCH] nvmet: use unsigned type for u64
@ 2020-06-12 1:16 Chaitanya Kulkarni
2020-06-17 8:07 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Chaitanya Kulkarni @ 2020-06-12 1:16 UTC (permalink / raw)
To: linux-nvme; +Cc: hch, Chaitanya Kulkarni, sagi
In function nvmet_subsys_atte_version_show() which uses the NVME_XXX()
macros related to version (of type u64) get rid of the int type cast
when printing subsys version and use appropriate format specifier for
u64.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
drivers/nvme/target/configfs.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index 419e0d4ce79b..cdec47de89ed 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -862,14 +862,14 @@ static ssize_t nvmet_subsys_attr_version_show(struct config_item *item,
struct nvmet_subsys *subsys = to_subsys(item);
if (NVME_TERTIARY(subsys->ver))
- return snprintf(page, PAGE_SIZE, "%d.%d.%d\n",
- (int)NVME_MAJOR(subsys->ver),
- (int)NVME_MINOR(subsys->ver),
- (int)NVME_TERTIARY(subsys->ver));
-
- return snprintf(page, PAGE_SIZE, "%d.%d\n",
- (int)NVME_MAJOR(subsys->ver),
- (int)NVME_MINOR(subsys->ver));
+ return snprintf(page, PAGE_SIZE, "%llu.%llu.%llu\n",
+ NVME_MAJOR(subsys->ver),
+ NVME_MINOR(subsys->ver),
+ NVME_TERTIARY(subsys->ver));
+
+ return snprintf(page, PAGE_SIZE, "%llu.%llu\n",
+ NVME_MAJOR(subsys->ver),
+ NVME_MINOR(subsys->ver));
}
static ssize_t nvmet_subsys_attr_version_store(struct config_item *item,
--
2.27.0
_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nvmet: use unsigned type for u64
2020-06-12 1:16 [PATCH] nvmet: use unsigned type for u64 Chaitanya Kulkarni
@ 2020-06-17 8:07 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2020-06-17 8:07 UTC (permalink / raw)
To: Chaitanya Kulkarni; +Cc: hch, linux-nvme, sagi
On Thu, Jun 11, 2020 at 06:16:59PM -0700, Chaitanya Kulkarni wrote:
> In function nvmet_subsys_atte_version_show() which uses the NVME_XXX()
> macros related to version (of type u64) get rid of the int type cast
> when printing subsys version and use appropriate format specifier for
> u64.
Applied to nvme-5.9.
_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-17 8:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-12 1:16 [PATCH] nvmet: use unsigned type for u64 Chaitanya Kulkarni
2020-06-17 8:07 ` Christoph Hellwig
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).