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

From: Uwe Kleine-König

Date: Tue Nov 24 2026 - 08:16:47 EST


On Tue, Nov 24, 2026 at 10:17:51AM +0000, Charvi Mehta wrote:
>
> On 11/20/26 11:48, Uwe Kleine-König wrote:
> > > +#include <linux/bitfield.h>
> > > +#include <linux/clk.h>
> > > +#include <linux/device.h>
> > > +#include <linux/err.h>
> > > +#include <linux/errno.h>
> > > +#include <linux/io.h>
> > > +#include <linux/mod_devicetable.h>
> > Please don't include <linux/mod_devicetable.h>.
> >
> > > +#include <linux/module.h>
> > > +#include <linux/of.h>
> > > +#include <linux/platform_device.h>
> > <linux/platform_device.h> already provides of_device_id, so
> > <linux/mod_devicetable.h> can just be dropped.
> Thanks, I’ll drop the redundant include.
>
>
> > > [...]
> > > +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.)

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature