drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry
Subsystems (3)
PATCH 1/1 drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry
Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element.
This issue was detected with the help of Coccinelle.
--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1 -1
@@ -677,7 +677,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, }/* All hardware blocks have the same number of attributes. */ - num_attrs =sizeof (perf_attr_iommu)/sizeof (struct kfd_perf_attr ); + num_attrs =ARRAY_SIZE (perf_attr_iommu);list_for_each_entry (perf, &dev->perf_props, list) { perf->attr_group = kzalloc(sizeof(struct kfd_perf_attr) * num_attrs + sizeof(struct attribute_group),
Signature · 1 line
2.7.4
Felix Kuehling
maintainerLooks good. This change is Reviewed-by: Felix Kuehling <[email protected]>
Regards,
Felix
Quoted 14 lines · Gustavo A. R. Silva
Use
ARRAY_SIZEinstead of dividing sizeof array with sizeof an element.This issue was detected with the help of Coccinelle.
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdkfd/kfd_topology.c +0
-0
drivers/gpu/drm/amd/amdkfd/kfd_topology.c static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, · line 683
Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1
-1@@ -677,7 +677,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, }/* All hardware blocks have the same number of attributes. */ - num_attrs =sizeof (perf_attr_iommu)/sizeof (struct kfd_perf_attr ); + num_attrs =ARRAY_SIZE (perf_attr_iommu);list_for_each_entry (perf, &dev->perf_props, list) { perf->attr_group = kzalloc(sizeof(struct kfd_perf_attr) * num_attrs + sizeof(struct attribute_group),
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoting Felix Kuehling <[email protected]>:
Quoted 3 lines
Looks good. This change is Reviewed-by: Felix Kuehling <[email protected]>
Thanks Felix.
--
Gustavo
Oded Gabbay
AppliedQuoted 11 lines · Gustavo A. R. Silva
Quoting Felix Kuehling <[email protected]>:
Quoted 3 lines
Looks good. This change is Reviewed-by: Felix Kuehling <[email protected]>
Thanks Felix.
--
Gustavo
Applied to -next
Oded
Quoted 4 lines
Hi all,
I was just wondering about the status of this patch.
Thanks
--
Gustavo
Quoted 31 lines · Felix Kuehling
Looks good. This change is Reviewed-by: Felix Kuehling <[email protected]>
Regards,
FelixQuoted 22 lines · Gustavo A. R. Silva
Use
ARRAY_SIZEinstead of dividing sizeof array with sizeof an element.This issue was detected with the help of Coccinelle.
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1
-1@@ -677,7 +677,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, }/* All hardware blocks have the same number of attributes. */ - num_attrs =sizeof (perf_attr_iommu)/sizeof (struct kfd_perf_attr ); + num_attrs =ARRAY_SIZE (perf_attr_iommu);list_for_each_entry (perf, &dev->perf_props, list) { perf->attr_group = kzalloc(sizeof(struct kfd_perf_attr) * num_attrs + sizeof(struct attribute_group),
Hi Gustavo,
The patch is queued for the merge window of kernel 4.17 (opens in about 7 weeks from now).
Oded
Quoted 46 lines · Gustavo A. R. Silva
Hi all,
I was just wondering about the status of this patch.
Thanks
--
GustavoQuoted 35 lines · Felix Kuehling
Looks good. This change is Reviewed-by: Felix Kuehling <[email protected]>
Regards,
FelixQuoted 24 lines · Gustavo A. R. Silva
Use
ARRAY_SIZEinstead of dividing sizeof array with sizeof an element.This issue was detected with the help of Coccinelle.
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1
-1@@ -677,7 +677,7 @@ static int kfd_build_sysfs_node_entry(structkfd_topology_device *dev, }/* All hardware blocks have the same number of attributes. */ - num_attrs =sizeof (perf_attr_iommu)/sizeof (struct kfd_perf_attr ); + num_attrs =ARRAY_SIZE (perf_attr_iommu);list_for_each_entry (perf, &dev->perf_props, list) { perf->attr_group = kzalloc(sizeof(struct kfd_perf_attr) * num_attrs + sizeof(struct attribute_group),
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Oded,
Quoted 4 lines · Oded Gabbay
Hi Gustavo,
The patch is queued for the merge window of kernel 4.17 (opens in about 7 weeks from now).
Awesome.
Thanks for the info.
--
Gustavo
Quoted 50 lines
Oded
Quoted 46 lines · Gustavo A. R. Silva
Hi all,
I was just wondering about the status of this patch.
Thanks
--
GustavoQuoted 35 lines · Felix Kuehling
Looks good. This change is Reviewed-by: Felix Kuehling <[email protected]>
Regards,
FelixQuoted 24 lines · Gustavo A. R. Silva
Use
ARRAY_SIZEinstead of dividing sizeof array with sizeof an element.This issue was detected with the help of Coccinelle.
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1
-1@@ -677,7 +677,7 @@ static int kfd_build_sysfs_node_entry(structkfd_topology_device *dev, }/* All hardware blocks have the same number of attributes. */ - num_attrs =sizeof (perf_attr_iommu)/sizeof (struct kfd_perf_attr ); + num_attrs =ARRAY_SIZE (perf_attr_iommu);list_for_each_entry (perf, &dev->perf_props, list) { perf->attr_group = kzalloc(sizeof(struct kfd_perf_attr) * num_attrs + sizeof(struct attribute_group),