Re: [PATCH v2 15/17] drm/msm/a8xx: Preemption support for A840
From: David Laight
Date: Sat Apr 11 2026 - 10:47:42 EST
On Sat, 11 Apr 2026 06:56:15 -0700
Rob Clark <rob.clark@xxxxxxxxxxxxxxxx> wrote:
> On Fri, Apr 10, 2026 at 7:22 PM Jie Gan <jie.gan@xxxxxxxxxxxxxxxx> wrote:
> >
> >
> >
> > On 3/27/2026 8:14 AM, Akhil P Oommen wrote:
...
> > > + struct a7xx_cp_smmu_info *smmu_info_ptr =
> > > + a6xx_gpu->preempt_smmu[ring->id];
> > > + struct a6xx_preempt_record *record_ptr = a6xx_gpu->preempt[ring->id];
> > > + u64 ttbr0 = ring->memptrs->ttbr0;
> > > + u32 context_idr = ring->memptrs->context_idr;
> >
> > Shall we declare these variables at the top of the function body?
> >
>
> We can use c11 / mixed code/declarations now. It's actually kinda
> required for cleanup.h stuff (which I recommend for new code, where
> possible.. I've been using it for PERFCNTR_CONFIG ioctl that I'm
> working on, and it makes error path cleanup much more straightforward)
It is also still frowned upon for normal variables.
It does make reading code - especially large functions harder.
David
>
> BR,
> -R
>