]> www.infradead.org Git - linux.git/commitdiff
dm ioctl: a small code cleanup in list_version_get_info
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 1 Nov 2022 20:54:01 +0000 (16:54 -0400)
committerMike Snitzer <snitzer@kernel.org>
Thu, 1 Dec 2022 16:43:41 +0000 (11:43 -0500)
No need to modify info->vers if we overwrite it immediately.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-ioctl.c

index 3bfc1583c20a2d348b3642739b0faf5b58ee8e62..cdadc77fa4fcde719080435da3ccbc18b3764982 100644 (file)
@@ -681,7 +681,7 @@ static void list_version_get_info(struct target_type *tt, void *param)
     strcpy(info->vers->name, tt->name);
 
     info->old_vers = info->vers;
-    info->vers = align_ptr(((void *) ++info->vers) + strlen(tt->name) + 1);
+    info->vers = align_ptr((void *)(info->vers + 1) + strlen(tt->name) + 1);
 }
 
 static int __list_versions(struct dm_ioctl *param, size_t param_size, const char *name)