Use terms consistently in function parameter names.
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | man*/: epoll_*(), fcntl(), flock(), ioctl(), msgctl(), *prctl(), ptrace(), quotactl(), reboot(), semctl(), shmctl(), lockf(): Consistently use 'op' and 'operation'man2/ man2/ man2/ +16 more | +217 | 2 replies | |
| 2/2 | clock_nanosleep.2, nanosleep.2: Use 'duration' rather than 'request'man2/ man2/ | +16 | 9 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] Use terms consistently in function parameter names.
Hi!
I finally wrote this patch. I had it in my todo for too long.
In <time.h> functions, use duration, instead of request, as suggested by Elliott.
In ctl functions and similar, there was a lot of variation:
- command - cmd - request - req - option - operation - op
And they all meant the same thing. We have similar problems in the names of the constants, which have similar variability.
In the case of the function parameters, we can easily rename them. I chose 'op', as it seems a reasonable (and short) name, and most of the documentation already used the term 'operation' to refer to the parameter, even in cases where the parameter was names differently.
I would like to ask to kernel maintainers and libc implementations to add some consistency here too, and rename the parameters accordingly, for consistency, or at least use your own consistency, if you don't like this one, but stick to some rules.
In the case of constants, we can't rename them. Too bad. But I'd like to ask programmers to have this in mind for when new constants are added, so that some consistency is followed. (This was something that made me doubt about using 'op', because most constants seem to use '_CMD_' in their names. If you prefer 'cmd' for the parameter names for that reason, let's discuss it.)
Have a lovely day!
Alex
Alejandro Colomar (2):
man*/: epoll_*(), fcntl(), flock(), ioctl(), msgctl(), *prctl(),
ptrace(), quotactl(), reboot(), semctl(), shmctl(), lockf():
Consistently use 'op' and 'operation'
clock_nanosleep.2, nanosleep.2: Use 'duration' rather than 'request'
man2/arch_prctl.2 | 12 +++--- man2/clock_nanosleep.2 | 20 ++++----- man2/epoll_wait.2 | 4 +- man2/fcntl.2 | 70 +++++++++++++++---------------- man2/flock.2 | 6 +-- man2/ioctl.2 | 30 +++++++------- man2/ioctl_console.2 | 8 ++-- man2/ioctl_fideduperange.2 | 2 +- man2/ioctl_getfsmap.2 | 6 +-- man2/ioctl_ns.2 | 2 +- man2/ioctl_tty.2 | 10 ++--- man2/ioctl_userfaultfd.2 | 10 ++--- man2/msgctl.2 | 16 ++++---- man2/nanosleep.2 | 12 +++--- man2/prctl.2 | 84 +++++++++++++++++++------------------- man2/ptrace.2 | 60 +++++++++++++-------------- man2/quotactl.2 | 34 +++++++-------- man2/reboot.2 | 19 +++++---- man2/semctl.2 | 22 +++++----- man2/shmctl.2 | 20 +++++---- man3/lockf.3 | 11 ++--- 21 files changed, 233 insertions(+), 225 deletions(-)
Signature · 1 line
2.43.0