[RFC PATCH 3/7] PID namespace translation support

Eugene Syromiatnikov esyr at redhat.com
Wed Jun 10 21:09:44 UTC 2020


On Mon, Jun 08, 2020 at 09:21:26PM +0200, Ákos Uzonyi wrote:
> On Mon, 8 Jun 2020 at 21:16, Ákos Uzonyi <uzonyi.akos at gmail.com> wrote:
> > +static uint8_t
> > +lg2(uint64_t n)
> > +{
> > +       uint8_t res = 0;
> > +       while (n) {
> > +               res++;
> > +               n >>= 1;
> > +       }
> > +       return res;
> > +}
> 
> Should it be moved to utils.c?

There are ilog2* functions present in util.c now, I think it's better
to switch to them.  It probably needs a bit of rework, as it was
originally written for using with klong type only.



More information about the Strace-devel mailing list