Messages in this thread | | | Date | Thu, 21 Mar 2024 13:22:25 +0200 | From | Andy Shevchenko <> | Subject | Re: [PATCH v3 5/6] iio: pressure: Add timestamp and scan_masks for BMP280 driver |
| |
On Wed, Mar 20, 2024 at 10:31:39PM +0100, Vasileios Amoiridis wrote: > On Wed, Mar 20, 2024 at 10:38:03PM +0200, Andy Shevchenko wrote: > > On Wed, Mar 20, 2024 at 07:45:16PM +0100, Vasileios Amoiridis wrote: > > > On Wed, Mar 20, 2024 at 01:07:07PM +0200, Andy Shevchenko wrote: > > > > On Tue, Mar 19, 2024 at 01:29:24AM +0100, Vasileios Amoiridis wrote:
..
> > > > > +enum bmp280_scan { > > > > > + BMP280_TEMP, > > > > > + BMP280_PRESS, > > > > > + BME280_HUMID > > > > > > > > The last is not a terminator, please leave trailing comma. > > > > > > > > > +}; > > > > > > What do you mean it is not a terminator? In general with the enum > > > variables I would write: > > > > > > enum var { a, b, c }; > > > > This example is different to what you used. I.o.w. _this_ example is okay. > > > > > Why in this case there is a comma needed after the BME280_HUMID element? > > > > It's pure style issue that helps to avoid the unneeded churn in the future in > > case the list is getting expanded. You can easily imagine what I mean. > > > > Ok, that definitely makes sense, thank you! In general, should this be applied > to structs as well?
Yes, to structs and/or arrays initializers when the list has a potential expanding. We don't have trailing comma when: 1) it's a terminator entry (nothing must be after); 2) it's on the one line (as in your above example).
-- With Best Regards, Andy Shevchenko
| |