[lkml]   [2018]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [QUEUED v20180920 05/16] stm class: Add a helper for writing data packets
Mathieu Poirier <> writes:

>> +static ssize_t notrace stm_write(struct stm_data *data, unsigned int master,
>> + unsigned int channel, const char *buf, size_t count)
>> +{
>> + ssize_t sz;
>> +
>> + sz = stm_data_write(data, master, channel, true, buf, count);
>> + if (sz > 0)
>> + data->packet(data, master, channel, STP_PACKET_FLAG, 0, 0,
>> + buf);
> The original code the payload of a flag packet was '0' while in this patch
> changes it to be anything. Some external tooling could be very confused.

I think the original intention was so: the 'size' field of ->packet()
refers to how many bytes from the given 'payload' the callback should
use. IOW, with size 0, buf may point to anything (still a valid pointer
though). But that should have been documented better from the beginning,
so you're completely right. I'll make a note to myself to go over the
API bits and sort out stuff like that.


 \ /
  Last update: 2018-10-03 14:59    [W:0.055 / U:5.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site