Re: [PATCH v5] printk: Userspace format enumeration support

From: Chris Down
Date: Tue Mar 16 2021 - 09:28:04 EST

Petr Mladek writes:
In my mind, pi_start is really just a special case of pi_next, so the code
flow makes sense to me. I'm happy to change it to whatever you like, but
it's not immediately obvious to me what that is :-)

Good question! I have missed that pi_start() can be called also with non-zero
pos when seeking.

OK, pi_start() has to handle pos == 0 special way, so let's handle it
there. Call pi_next() only when pos != 0.

The following code should do the job. I took this from my previous reply.
It is already based on the other suggested changes:

That also looks fine, thanks. I'll hopefully have time to send v6 this week.

Thanks for your detailed feedback! :-)