libnvdimm: Replace guid_copy() with import_guid() where it makes sense
Subsystems (2)
PATCH 1/1 libnvdimm: Replace guid_copy() with import_guid() where it makes sense
There is a specific API to treat raw data as GUID, i.e. import_guid(). Use it instead of guid_copy() with explicit casting.
--- drivers/acpi/nfit/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/nfit/core.c +1 -1
@@ -2293,7 +2293,7 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, nd_set =devm_kzalloc (dev,sizeof (*nd_set),GFP_KERNEL );if (!nd_set)return -ENOMEM ; -guid_copy (&nd_set->type_guid, (guid_t *) spa->range_guid); +import_guid (&nd_set->type_guid, spa->range_guid); info =devm_kzalloc (dev,sizeof_nfit_set_info (nr),GFP_KERNEL );if (!info)
Signature · 4 lines
2.26.1 _______________________________________________ Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Quoted 4 lines · Andy Shevchenko
There is a specific API to treat raw data as GUID, i.e.
import_guid(). Use it instead ofguid_copy()with explicit casting.Signed-off-by Andy Shevchenko <[email protected]>
Quoted 20 lines
--- drivers/acpi/nfit/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/nfit/core.c +1
-1@@ -2293,7 +2293,7 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, nd_set =devm_kzalloc (dev,sizeof (*nd_set),GFP_KERNEL );if (!nd_set)return -ENOMEM ; -guid_copy (&nd_set->type_guid, (guid_t *) spa->range_guid); +import_guid (&nd_set->type_guid, spa->range_guid); info =devm_kzalloc (dev,sizeof_nfit_set_info (nr),GFP_KERNEL );if (!info)Signature · 1 line
2.26.1
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Quoted 8 lines · Ira Weiny
Quoted 4 lines · Andy Shevchenko
There is a specific API to treat raw data as GUID, i.e.
import_guid(). Use it instead ofguid_copy()with explicit casting.Signed-off-by Andy Shevchenko <[email protected]>Reviewed-by Ira Weiny <[email protected]>
Looks good, applied for 5.8.
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]