Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Takashi Iwai
On Thu, 16 May 2024 19:34:54 +0200,
Steven Rostedt wrote:
> 
> From: "Steven Rostedt (Google)" 
> 
> [
>This is a treewide change. I will likely re-create this patch again in
>the second week of the merge window of v6.10 and submit it then. Hoping
>to keep the conflicts that it will cause to a minimum.
> ]
> 
> With the rework of how the __string() handles dynamic strings where it
> saves off the source string in field in the helper structure[1], the
> assignment of that value to the trace event field is stored in the helper
> value and does not need to be passed in again.
> 
> This means that with:
> 
>   __string(field, mystring)
> 
> Which use to be assigned with __assign_str(field, mystring), no longer
> needs the second parameter and it is unused. With this, __assign_str()
> will now only get a single parameter.
> 
> There's over 700 users of __assign_str() and because coccinelle does not
> handle the TRACE_EVENT() macro I ended up using the following sed script:
> 
>   git grep -l __assign_str | while read a ; do
>   sed -e 's/\(__assign_str([^,]*[^ ,]\) *,[^;]*/\1)/' $a > /tmp/test-file;
>   mv /tmp/test-file $a;
>   done
> 
> I then searched for __assign_str() that did not end with ';' as those
> were multi line assignments that the sed script above would fail to catch.
> 
> Note, the same updates will need to be done for:
> 
>   __assign_str_len()
>   __assign_rel_str()
>   __assign_rel_str_len()
> 
> I tested this with both an allmodconfig and an allyesconfig (build only for 
> both).
> 
> [1] 
> https://lore.kernel.org/linux-trace-kernel/2024011442.634192...@goodmis.org/
> 
> Cc: Masami Hiramatsu 
> Cc: Mathieu Desnoyers 
> Cc: Linus Torvalds 
> Cc: Julia Lawall 
> Signed-off-by: Steven Rostedt (Google) 

For the sound part
Acked-by: Takashi Iwai 


thanks,

Takashi


Re: [Freedreno] [PATCH v6 29/35] sound: hdac: Migrate to aggregate driver

2022-01-31 Thread Takashi Iwai
On Thu, 27 Jan 2022 21:01:35 +0100,
Stephen Boyd wrote:
> 
> Use an aggregate driver instead of component ops so that we can get
> proper driver probe ordering of the aggregate device with respect to all
> the component devices that make up the aggregate device.
> 
> Cc: Jaroslav Kysela 
> Cc: Takashi Iwai 
> Cc: Kai Vehmanen 
> Cc: Daniel Vetter 
> Cc: "Rafael J. Wysocki" 
> Cc: Rob Clark 
> Cc: Russell King 
> Cc: Saravana Kannan 
> Signed-off-by: Stephen Boyd 

The patch looks good, but just a minor concern:

> +static struct aggregate_driver hdac_aggregate_driver = {
> + .probe = hdac_component_master_bind,
> + .remove = hdac_component_master_unbind,
> + .driver = {
> + .name = "hdac_agg",

Shouldn't we define some standard name scheme?
This one has "hdac_agg", while the patch for HD-audio Realtek stuff
has "realtek_aggregate".

(And maybe the latter one should be something like
"hda_realtek_agg" or such, as Realtek covers pretty different devices
and there might be conflict in future.)

With those considered: please take my ack
Acked-by: Takashi Iwai 


thanks,

Takashi


[Freedreno] [PATCH] drm/msm: Use scnprintf() for avoiding potential buffer overflow

2020-03-11 Thread Takashi Iwai
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai 
---
 drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c 
b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 7fd29829b2fa..1d5c43c22269 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -673,7 +673,7 @@ static char *adreno_gpu_ascii85_encode(u32 *src, size_t len)
return NULL;
 
for (i = 0; i < l; i++)
-   buf_itr += snprintf(buf + buf_itr, buffer_size - buf_itr, "%s",
+   buf_itr += scnprintf(buf + buf_itr, buffer_size - buf_itr, "%s",
ascii85_encode(src[i], out));
 
return buf;
-- 
2.16.4

___
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno