* [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry
@ 2018-01-19 0:39 Gustavo A. R. Silva
[not found] ` <20180119003955.GA28885-L1vi/lXTdts+Va1GwOuvDg@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Gustavo A. R. Silva @ 2018-01-19 0:39 UTC (permalink / raw)
To: Oded Gabbay, Alex Deucher, Christian König, David Airlie
Cc: dri-devel, amd-gfx, linux-kernel, Gustavo A. R. Silva
Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element.
This issue was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index c6a7609..7783250 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -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),
--
2.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread[parent not found: <20180119003955.GA28885-L1vi/lXTdts+Va1GwOuvDg@public.gmane.org>]
* Re: [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry 2018-01-19 0:39 [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry Gustavo A. R. Silva @ 2018-01-19 22:18 ` Felix Kuehling 0 siblings, 0 replies; 9+ messages in thread From: Felix Kuehling @ 2018-01-19 22:18 UTC (permalink / raw) To: Gustavo A. R. Silva, Oded Gabbay, Alex Deucher, Christian König, David Airlie Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, linux-kernel-u79uwXL29TY76Z2rM5mHXA Looks good. This change is Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Regards, Felix On 2018-01-18 07:39 PM, Gustavo A. R. Silva wrote: > Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. > > This issue was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> > --- > drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > index c6a7609..7783250 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > @@ -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 amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry @ 2018-01-19 22:18 ` Felix Kuehling 0 siblings, 0 replies; 9+ messages in thread From: Felix Kuehling @ 2018-01-19 22:18 UTC (permalink / raw) To: Gustavo A. R. Silva, Oded Gabbay, Alex Deucher, Christian König, David Airlie Cc: amd-gfx, dri-devel, linux-kernel Looks good. This change is Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Regards, Felix On 2018-01-18 07:39 PM, Gustavo A. R. Silva wrote: > Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. > > This issue was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> > --- > drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > index c6a7609..7783250 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > @@ -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), ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry 2018-01-19 22:18 ` Felix Kuehling (?) @ 2018-01-19 22:30 ` Gustavo A. R. Silva 2018-01-31 15:52 ` Oded Gabbay -1 siblings, 1 reply; 9+ messages in thread From: Gustavo A. R. Silva @ 2018-01-19 22:30 UTC (permalink / raw) To: Felix Kuehling Cc: Oded Gabbay, Alex Deucher, Christian König, David Airlie, amd-gfx, dri-devel, linux-kernel Quoting Felix Kuehling <felix.kuehling@amd.com>: > Looks good. This change is Reviewed-by: Felix Kuehling > <Felix.Kuehling@amd.com> > Thanks Felix. -- Gustavo ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry 2018-01-19 22:30 ` Gustavo A. R. Silva @ 2018-01-31 15:52 ` Oded Gabbay 0 siblings, 0 replies; 9+ messages in thread From: Oded Gabbay @ 2018-01-31 15:52 UTC (permalink / raw) To: Gustavo A. R. Silva Cc: Felix Kuehling, Alex Deucher, Christian König, David Airlie, amd-gfx list, Maling list - DRI developers, Linux-Kernel@Vger. Kernel. Org On Sat, Jan 20, 2018 at 12:30 AM, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote: > > Quoting Felix Kuehling <felix.kuehling@amd.com>: > >> Looks good. This change is Reviewed-by: Felix Kuehling >> <Felix.Kuehling@amd.com> >> > > Thanks Felix. > -- > Gustavo > Applied to -next Oded > > > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry 2018-01-19 22:18 ` Felix Kuehling (?) (?) @ 2018-02-14 21:30 ` Gustavo A. R. Silva 2018-02-15 10:08 ` Oded Gabbay -1 siblings, 1 reply; 9+ messages in thread From: Gustavo A. R. Silva @ 2018-02-14 21:30 UTC (permalink / raw) To: Felix Kuehling, Oded Gabbay, Alex Deucher, Christian König, David Airlie Cc: amd-gfx, dri-devel, linux-kernel Hi all, I was just wondering about the status of this patch. Thanks -- Gustavo On 01/19/2018 04:18 PM, Felix Kuehling wrote: > Looks good. This change is Reviewed-by: Felix Kuehling > <Felix.Kuehling@amd.com> > > Regards, > Felix > > > On 2018-01-18 07:39 PM, Gustavo A. R. Silva wrote: >> Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. >> >> This issue was detected with the help of Coccinelle. >> >> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> >> --- >> drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >> index c6a7609..7783250 100644 >> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >> @@ -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), > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry 2018-02-14 21:30 ` Gustavo A. R. Silva @ 2018-02-15 10:08 ` Oded Gabbay 0 siblings, 0 replies; 9+ messages in thread From: Oded Gabbay @ 2018-02-15 10:08 UTC (permalink / raw) To: Gustavo A. R. Silva Cc: David Airlie, Felix Kuehling, Linux-Kernel@Vger. Kernel. Org, Maling list - DRI developers, amd-gfx list, Alex Deucher, Christian König Hi Gustavo, The patch is queued for the merge window of kernel 4.17 (opens in about 7 weeks from now). Oded On Wed, Feb 14, 2018 at 11:30 PM, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote: > Hi all, > > I was just wondering about the status of this patch. > > Thanks > -- > Gustavo > > > On 01/19/2018 04:18 PM, Felix Kuehling wrote: >> >> Looks good. This change is Reviewed-by: Felix Kuehling >> <Felix.Kuehling@amd.com> >> >> Regards, >> Felix >> >> >> On 2018-01-18 07:39 PM, Gustavo A. R. Silva wrote: >>> >>> Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. >>> >>> This issue was detected with the help of Coccinelle. >>> >>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> >>> --- >>> drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>> b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>> index c6a7609..7783250 100644 >>> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>> @@ -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), >> >> > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry @ 2018-02-15 10:08 ` Oded Gabbay 0 siblings, 0 replies; 9+ messages in thread From: Oded Gabbay @ 2018-02-15 10:08 UTC (permalink / raw) To: Gustavo A. R. Silva Cc: Felix Kuehling, Alex Deucher, Christian König, David Airlie, amd-gfx list, Maling list - DRI developers, Linux-Kernel@Vger. Kernel. Org Hi Gustavo, The patch is queued for the merge window of kernel 4.17 (opens in about 7 weeks from now). Oded On Wed, Feb 14, 2018 at 11:30 PM, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote: > Hi all, > > I was just wondering about the status of this patch. > > Thanks > -- > Gustavo > > > On 01/19/2018 04:18 PM, Felix Kuehling wrote: >> >> Looks good. This change is Reviewed-by: Felix Kuehling >> <Felix.Kuehling@amd.com> >> >> Regards, >> Felix >> >> >> On 2018-01-18 07:39 PM, Gustavo A. R. Silva wrote: >>> >>> Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. >>> >>> This issue was detected with the help of Coccinelle. >>> >>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> >>> --- >>> drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>> b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>> index c6a7609..7783250 100644 >>> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>> @@ -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), >> >> > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry 2018-02-15 10:08 ` Oded Gabbay (?) @ 2018-02-15 16:10 ` Gustavo A. R. Silva -1 siblings, 0 replies; 9+ messages in thread From: Gustavo A. R. Silva @ 2018-02-15 16:10 UTC (permalink / raw) To: Oded Gabbay Cc: Felix Kuehling, Alex Deucher, Christian König, David Airlie, amd-gfx list, Maling list - DRI developers, Linux-Kernel@Vger. Kernel. Org Hi Oded, On 02/15/2018 04:08 AM, Oded Gabbay wrote: > 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 > Oded > > On Wed, Feb 14, 2018 at 11:30 PM, Gustavo A. R. Silva > <garsilva@embeddedor.com> wrote: >> Hi all, >> >> I was just wondering about the status of this patch. >> >> Thanks >> -- >> Gustavo >> >> >> On 01/19/2018 04:18 PM, Felix Kuehling wrote: >>> >>> Looks good. This change is Reviewed-by: Felix Kuehling >>> <Felix.Kuehling@amd.com> >>> >>> Regards, >>> Felix >>> >>> >>> On 2018-01-18 07:39 PM, Gustavo A. R. Silva wrote: >>>> >>>> Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. >>>> >>>> This issue was detected with the help of Coccinelle. >>>> >>>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> >>>> --- >>>> drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>>> b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>>> index c6a7609..7783250 100644 >>>> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>>> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c >>>> @@ -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), >>> >>> >> ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-02-15 16:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-19 0:39 [PATCH] drm/amdkfd: Use ARRAY_SIZE macro in kfd_build_sysfs_node_entry Gustavo A. R. Silva
[not found] ` <20180119003955.GA28885-L1vi/lXTdts+Va1GwOuvDg@public.gmane.org>
2018-01-19 22:18 ` Felix Kuehling
2018-01-19 22:18 ` Felix Kuehling
2018-01-19 22:30 ` Gustavo A. R. Silva
2018-01-31 15:52 ` Oded Gabbay
2018-02-14 21:30 ` Gustavo A. R. Silva
2018-02-15 10:08 ` Oded Gabbay
2018-02-15 10:08 ` Oded Gabbay
2018-02-15 16:10 ` Gustavo A. R. Silva
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.