nvmet: Don't use uuid_le type
Subsystems (2)
PATCH 1/1 nvmet: Don't use uuid_le type
Don't use sizeof(uuid_le) where none of the parameters is type of uuid_le. Since both arguments are u8 [16], use plain number there.
Moreover, uuid_le is a deprecated type, and nvmet is using uuid_t already.
--- drivers/nvme/target/admin-cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/admin-cmd.c +1 -1
@@ -308,7 +308,7 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req)*/ id->nmic = (1 <<0 ); -memcpy (&id->nguid, &ns->nguid,sizeof (uuid_le)); +memcpy (&id->nguid, &ns->nguid,16 ); id->lbaf[0 ].ds = ns->blksize_shift;
Signature · 1 line
2.18.0
Sagi Grimberg
maintainerPATCH 1/1 nvmet: Don't use uuid_le type
Sagi Grimberg
maintainerPATCH 1/1 nvmet: Don't use uuid_le type
In reply to Andy Shevchenkodrivers/nvme/target/admin-cmd.c static void nvmet_execute_identify_ns(struct nvmet_req *req) · line 311
Quoted 3 lines
drivers/nvme/target/admin-cmd.c +1
-1-memcpy (&id->nguid, &ns->nguid,sizeof (uuid_le)); +memcpy (&id->nguid, &ns->nguid,16 );
how about memcpy(&id->nguid, &ns->nguid, sizeof(ns->nguid));
PATCH 1/1 nvmet: Don't use uuid_le type
Quoted 4 lines · Sagi Grimberg
drivers/nvme/target/admin-cmd.c static void nvmet_execute_identify_ns(struct nvmet_req *req) · line 311
Quoted 2 lines
drivers/nvme/target/admin-cmd.c +1
-1-memcpy (&id->nguid, &ns->nguid,sizeof (uuid_le)); +memcpy (&id->nguid, &ns->nguid,16 );how about
memcpy(&id->nguid, &ns->nguid, sizeof(ns->nguid));
I suppose should be sizeof(id->nguid), but I don't care much as long as it doesn't use uuid_le type here.
Signature · 2 lines
Andy Shevchenko <andriy.shevchenko at linux.intel.com> Intel Finland Oy
Christoph Hellwig
maintainerPATCH 1/1 nvmet: Don't use uuid_le type
Quoted 8 lines · Andy Shevchenko
Quoted 4 lines · Sagi Grimberg
drivers/nvme/target/admin-cmd.c static void nvmet_execute_identify_ns(struct nvmet_req *req) · line 311
Quoted 2 lines
drivers/nvme/target/admin-cmd.c +1
-1-memcpy (&id->nguid, &ns->nguid,sizeof (uuid_le)); +memcpy (&id->nguid, &ns->nguid,16 );how about
memcpy(&id->nguid, &ns->nguid, sizeof(ns->nguid));I suppose should be
sizeof(id->nguid), but I don't care much as long as it doesn't useuuid_letype here.
Yes, please use sizeof of the destination field instead of an opencoded number.