Re: [PATCH v2 3/6] iio: accel: mma8452: use local struct device

Andy Shevchenko
2026-04-23T07:51:13Z

On Thu, Apr 23, 2026 at 08:06:20AM +0530, Sanjay Chitroda wrote:
> On 23 April 2026 1:05:33 am IST, Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> >On Wed, Apr 22, 2026 at 10:26:40PM +0530, Sanjay Chitroda wrote:

...

> >> int ret;
> >> + struct device *dev = &client->dev;
> >
> >Keep it in reversed xmas tree order.
> >
> Understood, along with headers would attempt to keep all local variables also
> in chronological order.

I'm not sure. What does chronological mean in this case?

Reversed xmas tree order means to have longest lines first. The assignments may
have dependencies, hence must follow that first and then the reversed xmas
tree. Returned variable might go last in some cases even if it's slightly longer
than other variables for giving it a better visibility.

--
With Best Regards,
Andy Shevchenko