diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2026-04-15 23:05:55 +0200 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2026-05-06 16:10:46 +0200 |
| commit | a252e830ab7b11d4e5aa8247c6835ac1b8d7fd3a (patch) | |
| tree | 89ead6f13dde8d46763501c85652bcc8bfe74771 /ebpf | |
| parent | f168046842c3cbcc3d02ff81e339de95ac714396 (diff) | |
| download | qemu-a252e830ab7b11d4e5aa8247c6835ac1b8d7fd3a.tar.gz qemu-a252e830ab7b11d4e5aa8247c6835ac1b8d7fd3a.zip | |
cocci: Do not initialize variable used by QSLIST_FOREACH macro
The QSLIST_FOREACH() macro, defined in "qemu/queue.h",
always assigns its iterator variable when entering the
loop. Remove the pointless and possibly misleading
assignment.
Mechanical patch using the following coccinelle spatch:
@@
type T;
identifier e;
iterator FOREACH_MACRO =~ ".*_FOREACH.*";
statement S;
@@
- T *e = ...;
+ T *e;
... when != e
FOREACH_MACRO(e, ...) S
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-Id: <20260415215539.92629-3-philmd@linaro.org>
Diffstat (limited to 'ebpf')
| -rw-r--r-- | ebpf/ebpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ebpf/ebpf.c b/ebpf/ebpf.c index 2d73beb479..a8d441b02c 100644 --- a/ebpf/ebpf.c +++ b/ebpf/ebpf.c @@ -40,7 +40,7 @@ void ebpf_register_binary_data(int id, const void *data, size_t datalen) const void *ebpf_find_binary_by_id(int id, size_t *sz, Error **errp) { - struct ElfBinaryDataEntry *it = NULL; + struct ElfBinaryDataEntry *it; QSLIST_FOREACH(it, &ebpf_elf_obj_list, node) { if (id == it->id) { *sz = it->datalen; |
