[LTP] [PATCH v3 3/3] max_map_count: replace ifdefs by tst_arch

Cyril Hrubis chrubis@suse.cz
Tue Nov 9 11:47:55 CET 2021


Hi!
> > > +     switch (tst_arch.type) {
> > > +     case TST_X86:
> > > +     case TST_X86_64:
> > > +             /* On x86, there's an old compat vsyscall page */
> > > +             if (!strcmp(buf, "[vsyscall]"))
> > > +                     return true;
> > > +     break;
> > > +     case TST_IA64:
> > > +             /* On ia64, the vdso is not a proper mapping */
> > > +             if (!strcmp(buf, "[vdso]"))
> > > +                     return true;
> > > +     break;
> > > +     case TST_ARM:
> > > +             /* Skip it when run it in aarch64 */
> > > +             if ((!strcmp(un.machine, "aarch64"))
> > > +                             || (!strcmp(un.machine, "aarch64_be")))
> > > +                     return false;
> >
> >                 I wonder if this would be better as:
> >
> >                 if (tst_kernel_bits() == 64)
> >                         return false;
> >
> 
> Actually, we have TST_AARCH64 already, I'd go with switch to that.

That wouldn't work right? Since we are checking here if 32bit ARM binary
runs on 64bit AARCH64 kernel. The tst_arch defines for which
architecture the binary was build while the tst_kernel_bits() checks if
the kernel is 32bit or 64bit.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list