Re: [PATCH] printk: Fix skipped entries after index iterator restart
From: Andy Shevchenko
Date: Tue Nov 24 2026 - 05:42:01 EST
On Tue, Nov 24, 2026 at 11:28:01AM +0100, Petr Mladek wrote:
> On Mon 2026-11-16 11:15:03, Andy Shevchenko wrote:
> > On Mon, Nov 16, 2026 at 10:56:10AM +0200, Avi Weiss wrote:
...
> > > - return pi_next(s, NULL, pos);
> > > + return pi_get_entry(s->file->f_inode->i_private, *pos - 1);
> >
> > Side note (because it seems used more in the same form), we have file_inode()
> > helper and this should idiomatically look as
> >
> > return pi_get_entry(file_inode(s->file)->i_private, *pos - 1);
> >
> > But I haven't checked if the file_inode() is recommended or deprecated API.
>
> Good to know. But honestly, the variant with file_inode(s->file) looks
> less readable to me. IMHO, it is not worth it.
I agree, but I have checked treewide and that's why I put word 'idiomatically'.
All questions to VFS folks :-)
--
With Best Regards,
Andy Shevchenko