Hi Andy, On Wed, May 25, 2022 at 08:36:54PM +0300, Andy Shevchenko wrote: > On Wed, May 25, 2022 at 04:01:23PM +0300, Sakari Ailus wrote: > > Instead of adding a new property type, read buffer properties as integers. > > Even though the internal representation in ACPI is different, the data > > type is the same (byte) than on 8-bit integers. > > ... > > > + switch (proptype) { > > + case DEV_PROP_STRING: > > + break; > > + case DEV_PROP_U8 ... DEV_PROP_U64: > > + if (obj->type == ACPI_TYPE_BUFFER) { > > > + if (nval <= obj->buffer.length) > > + break; > > + return -EOVERFLOW; > > Why not traditional pattern and be consistent with default case? > > if (nval > obj->buffer.length) > return -EOVERFLOW; > break; Agreed. > > > + } > > + fallthrough; > > + default: > > + if (nval > obj->package.count) > > + return -EOVERFLOW; > > I would add break statement here. Sounds good. -- Sakari Ailus