On Thu, Nov 19, 2020 at 12:20:29PM +0000, Cristian Marussi wrote: > Hi Sudeep >
[...] > > > + S32_EXT(SENSOR_RES_EXP(ares)); > > > + dsize += sizeof(adesc->resolution); > > > + > > > + scmi_parse_range_attrs(&a->attrs, > > > + &adesc->attrs); > > > + dsize += sizeof(adesc->attrs); > > > + } > > > + > > > + adesc = (typeof(adesc))((u8 *)adesc + dsize); > > > > Just thinking if we can avoid this my having union comprising of v1 and v2 > > structures ? > > > > Not sure to understand, axis_descr are only v3.0 and in fact this is > called only for v > 2 I think, BUT the problem is that both this and the > main sensor descriptor v3 msg payloads are runtime variable, so that it > is stated in the msg->extended_attrs itself if that particular sensor desc > response that I'm parsing has the additional extended fields or not: > so the dance with dsize to keep track of where the current response ends > and when the next starts...but maybe I've not got really what you meant. > No worries, we can always improve later if possible, you can keep it as for now. [...] > > > + * retrieved via a dedicated (optional) command. > > > + * Since the command is optional, on error carry > > > + * on without any update interval. > > > + */ > > > + if (scmi_sensor_update_intervals(handle, s)) > > > + dev_info(handle->dev, > > > + "Update Intervals not > > > available for sensor ID:%d\n", > > > + s->id); > > > > Can we drop the logging or make it _dbg ? Make flood in a system with 100s > > of > > sensors. > > > > Sure, I was wondering in fact what to do with this: because the command > is optional but it seemed odd to me that an SCMIv3.0 sensor does not > expose any update interval so I wanted to log somehow this anomaly. > (but maybe it's just not an anomaly) > Anything optional can never be anomaly, there is high chance that f/w authors will drop it as it is optional unless it is absolutely necessary. -- Regards, Sudeep