[LTP] [PATCH] mount03: Convert to new API

Cyril Hrubis chrubis@suse.cz
Mon Jul 18 09:52:34 CEST 2022


Hi!
> @Richie @Li @Metan: There are checkpatch.pl warnings. Yes, kernel folks does not
> like permission warnings. Do we want to follow? Or should we remove these from
> our checkpatch.pl fork (we use constants in many places)?
> 
> $ make check-mount03
> mount03.c:29: WARNING: Symbolic permissions 'S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH' are not preferred. Consider using octal permissions '0644'.
> mount03.c:30: WARNING: Symbolic permissions 'S_IRUSR|S_IXUSR|S_IXGRP|S_IXOTH' are not preferred. Consider using octal permissions '0511'.
> mount03.c:50: WARNING: static char array declaration should probably be static const char
> mount03.c:103: WARNING: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.
> mount03.c:114: WARNING: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.
> mount03.c:125: WARNING: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.
> mount03.c:181: WARNING: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.
> mount03.c:204: WARNING: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.

To be honest I think Linus is right at this one, the single octal number
is way more readable than the bitwise or of four constants, so I would
be inclined to start following the kernel practice here.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list