Re: [RFC PATCH 02/28] media: mali-vpu: add Mali VPU platform driver

From: Charvi Mehta

Date: Wed Nov 25 2026 - 07:22:43 EST



On 11/24/26 13:15, Uwe Kleine-König wrote:
[...]
+static const struct of_device_id mali_vpu_dt_match[] = {
+ {
+ .compatible = "arm,mali-v76",
+ .data = &mali_vpu_v76_variant,
+ },
+ {},
s/{},/{ }/
I’ll add the space, keeping the trailing comma for consistency with the
other initializers in the driver.
Which driver? With your full series applied this is the only list
terminator below drivers/media/platform/arm. Note this is
different from

static struct platform_driver mali_vpu_driver = {
.probe = mali_vpu_probe,
.remove = mali_vpu_remove,
.driver = {
.name = MALI_VPU_DRV_NAME,
.of_match_table = mali_vpu_dt_match,
},
};

where the trailing , is right. My request to drop it only applies to
arrays where the empty initializer signals the array's end.

I don't find that documented in the coding style description, but with
next-20261123 checked out:

$ git ls-files drivers | xargs -n 1 perl -g -n -e 'print "$1\n" if m/device_id\s*[a-zA-Z_0-9]*\[\]\s*=\s*{(?:\s*{[^}]*},\s*({\s*(?:\s\/\*[^*]*\*\/)?},?))/' | sort | uniq -c
1 }
1 {
6 { }
1957 { }
405 { },
490 {}
576 {},
1 { /* end */},
2 { /* sentinel */}
1 { /* sentinel */},

So arrays of type \*device_id[] typically end with the terminator having
no trailing comma. (But honestly I'm surprised about nearly 1000
trailing commas, I would have expected that to be much less common, and
drivers/media/platform even has more terminators with a trailing comma
than without. I'm embarrassed.)

I’ll use |{ }|without the trailing comma for the match-table terminator in v2.


Regards,
Charvi