linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] syscalls: Fix references to filenames containing syscall defs
@ 2019-11-05  2:29 Mohammad Nasirifar
  2019-11-05  9:34 ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Mohammad Nasirifar @ 2019-11-05  2:29 UTC (permalink / raw)
  To: Arnd Bergmann, Andrew Morton
  Cc: Mohammad Nasirifar, linux-api, linux-arch, linux-kernel,
	Valdis Kletnieks

Fix stale references to files containing syscall definitions in
'include/linux/syscalls.h' and 'include/uapi/asm-generic/unistd.h',
pointing to 'kernel/itimer.c', 'kernel/hrtimer.c', and 'kernel/time.c'.
They are now under 'kernel/time'.

Also definitions of 'getpid', 'getppid', 'getuid', 'geteuid', 'getgid',
'getegid', 'gettid', and 'sysinfo' are now in 'kernel/sys.c'.

To: arnd@arndb.de
To: akpm@linux-foundation.org
Cc: linux-api@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: Mohammad Nasirifar <farnasirim@gmail.com>
---
 include/linux/syscalls.h          | 8 ++++----
 include/uapi/asm-generic/unistd.h | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index f7c561c4dcdd..1dbefa5e00e5 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -584,13 +584,13 @@ asmlinkage long sys_get_robust_list(int pid,
 asmlinkage long sys_set_robust_list(struct robust_list_head __user *head,
 				    size_t len);
 
-/* kernel/hrtimer.c */
+/* kernel/time/hrtimer.c */
 asmlinkage long sys_nanosleep(struct __kernel_timespec __user *rqtp,
 			      struct __kernel_timespec __user *rmtp);
 asmlinkage long sys_nanosleep_time32(struct old_timespec32 __user *rqtp,
 				     struct old_timespec32 __user *rmtp);
 
-/* kernel/itimer.c */
+/* kernel/time/itimer.c */
 asmlinkage long sys_getitimer(int which, struct itimerval __user *value);
 asmlinkage long sys_setitimer(int which,
 				struct itimerval __user *value,
@@ -731,7 +731,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
 			unsigned long arg4, unsigned long arg5);
 asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
 
-/* kernel/time.c */
+/* kernel/time/time.c */
 asmlinkage long sys_gettimeofday(struct timeval __user *tv,
 				struct timezone __user *tz);
 asmlinkage long sys_settimeofday(struct timeval __user *tv,
@@ -739,7 +739,7 @@ asmlinkage long sys_settimeofday(struct timeval __user *tv,
 asmlinkage long sys_adjtimex(struct __kernel_timex __user *txc_p);
 asmlinkage long sys_adjtimex_time32(struct old_timex32 __user *txc_p);
 
-/* kernel/timer.c */
+/* kernel/sys.c */
 asmlinkage long sys_getpid(void);
 asmlinkage long sys_getppid(void);
 asmlinkage long sys_getuid(void);
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index 1fc8faa6e973..6423f5fa4b8e 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -328,13 +328,13 @@ __SC_COMP(__NR_set_robust_list, sys_set_robust_list, \
 __SC_COMP(__NR_get_robust_list, sys_get_robust_list, \
 	  compat_sys_get_robust_list)
 
-/* kernel/hrtimer.c */
+/* kernel/time/hrtimer.c */
 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
 #define __NR_nanosleep 101
 __SC_3264(__NR_nanosleep, sys_nanosleep_time32, sys_nanosleep)
 #endif
 
-/* kernel/itimer.c */
+/* kernel/time/itimer.c */
 #define __NR_getitimer 102
 __SC_COMP(__NR_getitimer, sys_getitimer, compat_sys_getitimer)
 #define __NR_setitimer 103
@@ -507,7 +507,7 @@ __SYSCALL(__NR_prctl, sys_prctl)
 #define __NR_getcpu 168
 __SYSCALL(__NR_getcpu, sys_getcpu)
 
-/* kernel/time.c */
+/* kernel/time/time.c */
 #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
 #define __NR_gettimeofday 169
 __SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday)
@@ -517,7 +517,7 @@ __SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday)
 __SC_3264(__NR_adjtimex, sys_adjtimex_time32, sys_adjtimex)
 #endif
 
-/* kernel/timer.c */
+/* kernel/sys.c */
 #define __NR_getpid 172
 __SYSCALL(__NR_getpid, sys_getpid)
 #define __NR_getppid 173
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] syscalls: Fix references to filenames containing syscall defs
  2019-11-05  2:29 [PATCH 1/1] syscalls: Fix references to filenames containing syscall defs Mohammad Nasirifar
@ 2019-11-05  9:34 ` Thomas Gleixner
  2019-11-05  9:49   ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2019-11-05  9:34 UTC (permalink / raw)
  To: Mohammad Nasirifar
  Cc: Arnd Bergmann, Andrew Morton, Mohammad Nasirifar, linux-api,
	linux-arch, linux-kernel, Valdis Kletnieks

On Mon, 4 Nov 2019, Mohammad Nasirifar wrote:

> Fix stale references to files containing syscall definitions in
> 'include/linux/syscalls.h' and 'include/uapi/asm-generic/unistd.h',
> pointing to 'kernel/itimer.c', 'kernel/hrtimer.c', and 'kernel/time.c'.
> They are now under 'kernel/time'.
> 
> Also definitions of 'getpid', 'getppid', 'getuid', 'geteuid', 'getgid',
> 'getegid', 'gettid', and 'sysinfo' are now in 'kernel/sys.c'.

Can we please remove these file references completely. They are going to be
stale sooner than later again and they really do not provide any value.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] syscalls: Fix references to filenames containing syscall defs
  2019-11-05  9:34 ` Thomas Gleixner
@ 2019-11-05  9:49   ` Arnd Bergmann
  2019-11-06 16:47     ` Mohammad Nasirifar
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2019-11-05  9:49 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Mohammad Nasirifar, Andrew Morton, Mohammad Nasirifar, Linux API,
	linux-arch, linux-kernel, Valdis Kletnieks

On Tue, Nov 5, 2019 at 10:34 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> On Mon, 4 Nov 2019, Mohammad Nasirifar wrote:
> > Fix stale references to files containing syscall definitions in
> > 'include/linux/syscalls.h' and 'include/uapi/asm-generic/unistd.h',
> > pointing to 'kernel/itimer.c', 'kernel/hrtimer.c', and 'kernel/time.c'.
> > They are now under 'kernel/time'.
> >
> > Also definitions of 'getpid', 'getppid', 'getuid', 'geteuid', 'getgid',
> > 'getegid', 'gettid', and 'sysinfo' are now in 'kernel/sys.c'.
>
> Can we please remove these file references completely. They are going to be
> stale sooner than later again and they really do not provide any value.

+1

Good idea!

In the long run, I'd prefer to have a parsable format that can be used to
generate both the header file and the stubs that we currently provide
using SYSCALL_DEFINEx(), but before that I'd like the remaining two
unistd.h files to be converted to syscall.tbl format (Nitesh is still working
on that).

      Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] syscalls: Fix references to filenames containing syscall defs
  2019-11-05  9:49   ` Arnd Bergmann
@ 2019-11-06 16:47     ` Mohammad Nasirifar
  2019-11-06 17:02       ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Mohammad Nasirifar @ 2019-11-06 16:47 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thomas Gleixner, Andrew Morton, Mohammad Nasirifar, Linux API,
	linux-arch, linux-kernel, Valdis Kletnieks

On Tue, Nov 05, 2019 at 10:49:12AM +0100, Arnd Bergmann wrote:
>On Tue, Nov 5, 2019 at 10:34 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>> On Mon, 4 Nov 2019, Mohammad Nasirifar wrote:
>> > Fix stale references to files containing syscall definitions in
>> > 'include/linux/syscalls.h' and 'include/uapi/asm-generic/unistd.h',
>> > pointing to 'kernel/itimer.c', 'kernel/hrtimer.c', and 'kernel/time.c'.
>> > They are now under 'kernel/time'.
>> >
>> > Also definitions of 'getpid', 'getppid', 'getuid', 'geteuid', 'getgid',
>> > 'getegid', 'gettid', and 'sysinfo' are now in 'kernel/sys.c'.
>>
>> Can we please remove these file references completely. They are going to be
>> stale sooner than later again and they really do not provide any value.
I actually refer to them a lot when locating syscall implementations,
which is how I found out that they were stale in the first place.
>
>+1
>
>Good idea!
>
>In the long run, I'd prefer to have a parsable format that can be used to
>generate both the header file and the stubs that we currently provide
>using SYSCALL_DEFINEx(), but before that I'd like the remaining two
>unistd.h files to be converted to syscall.tbl format (Nitesh is still working
>on that).
Sorry I didn't understand, is there anything I can do to follow up on this?
>
>      Arnd


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] syscalls: Fix references to filenames containing syscall defs
  2019-11-06 16:47     ` Mohammad Nasirifar
@ 2019-11-06 17:02       ` Thomas Gleixner
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Gleixner @ 2019-11-06 17:02 UTC (permalink / raw)
  To: Mohammad Nasirifar
  Cc: Arnd Bergmann, Andrew Morton, Mohammad Nasirifar, Linux API,
	linux-arch, linux-kernel, Valdis Kletnieks

On Wed, 6 Nov 2019, Mohammad Nasirifar wrote:

> On Tue, Nov 05, 2019 at 10:49:12AM +0100, Arnd Bergmann wrote:
> > On Tue, Nov 5, 2019 at 10:34 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> > > On Mon, 4 Nov 2019, Mohammad Nasirifar wrote:
> > > > Fix stale references to files containing syscall definitions in
> > > > 'include/linux/syscalls.h' and 'include/uapi/asm-generic/unistd.h',
> > > > pointing to 'kernel/itimer.c', 'kernel/hrtimer.c', and 'kernel/time.c'.
> > > > They are now under 'kernel/time'.
> > > >
> > > > Also definitions of 'getpid', 'getppid', 'getuid', 'geteuid', 'getgid',
> > > > 'getegid', 'gettid', and 'sysinfo' are now in 'kernel/sys.c'.
> > > 
> > > Can we please remove these file references completely. They are going
> > > to be stale sooner than later again and they really do not provide
> > > any value.
>
> I actually refer to them a lot when locating syscall implementations,
> which is how I found out that they were stale in the first place.

# git grep -n 'SYSCALL.*(nanosleep'

kernel/time/hrtimer.c:1945:SYSCALL_DEFINE2(nanosleep, struct ...
kernel/time/hrtimer.c:1965:SYSCALL_DEFINE2(nanosleep_time32, struct ...

Gives you the always correct answer including the line number.

So there is really no value in keeping those file references and have them
outdated once a function or a file moves. It's just matter of fact that
nobody ever fixes them up when a function or a file moves. Why? Because
they have no connection. The compiler does not complain and there are no
tools which could ever validate them. So removing them is the right thing
to do.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-06 17:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05  2:29 [PATCH 1/1] syscalls: Fix references to filenames containing syscall defs Mohammad Nasirifar
2019-11-05  9:34 ` Thomas Gleixner
2019-11-05  9:49   ` Arnd Bergmann
2019-11-06 16:47     ` Mohammad Nasirifar
2019-11-06 17:02       ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).