[LEDE-DEV] [PATCH] [ubox] syslog: remove unnecessary sizeof struct between messages

John Crispin john at phrozen.org
Sun Mar 12 13:28:53 PDT 2017



On 12/03/2017 18:49, Dan Bugnar wrote:
> I couldn't find a good reason for using the sizeof() here, also I
> worked on a resize feature. I will send my work after this patch
> situation is clarified.
> 

can you send the resize patch series you have ? i'd like to try the
whole set.

	John

> On Fri, Mar 10, 2017 at 12:57 PM, John Crispin <john at phrozen.org> wrote:
>>
>>
>> On 10/03/17 11:06, Dan Bugnar wrote:
>>>
>>> The next message needs to be written after the data of current message.
>>> This was adding "sizeof(struct log_head)" bytes between messages.
>>>
>>> Signed-off-by: Dan Bugnar <danutbug at gmail.com>
>>> ---
>>>   log/syslog.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/log/syslog.c b/log/syslog.c
>>> index ac4f1ae..856fa60 100644
>>> --- a/log/syslog.c
>>> +++ b/log/syslog.c
>>> @@ -51,7 +51,7 @@ static regex_t pat_tstamp;
>>>   static struct log_head*
>>>   log_next(struct log_head *h, int size)
>>>   {
>>> -       struct log_head *n = (struct log_head *)
>>> &h->data[PAD(sizeof(struct log_head) + size)];
>>> +       struct log_head *n = (struct log_head *) &h->data[PAD(size)];
>>>         return (n >= log_end) ? (log) : (n);
>>>   }
>>
>> I think this was related to the resize feature of the log wrapping code. i
>> need to dig into old memories. but i am sure that there was a reason for the
>> sizeof()
>>
>>     John
> 
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
> 



More information about the Lede-dev mailing list