* [PATCH] arch: parisc: kernel: sys_parisc: Remove some unused functions
@ 2015-01-02 18:09 Rickard Strandqvist
2015-01-02 18:12 ` Helge Deller
2015-01-02 18:14 ` Al Viro
0 siblings, 2 replies; 3+ messages in thread
From: Rickard Strandqvist @ 2015-01-02 18:09 UTC (permalink / raw)
To: James E.J. Bottomley, Helge Deller
Cc: Rickard Strandqvist, James Hogan, linux-parisc, linux-kernel
Removes some functions that are not used anywhere:
parisc_personality() parisc_fallocate() parisc_sync_file_range()
parisc_fadvise64_64() parisc_readahead() parisc_pwrite64() parisc_pread64()
parisc_ftruncate64() parisc_truncate64()
This was partially found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
arch/parisc/kernel/sys_parisc.c | 81 ---------------------------------------
1 file changed, 81 deletions(-)
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index e1ffea2..65ab69d 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -283,18 +283,6 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
/* Fucking broken ABI */
#ifdef CONFIG_64BIT
-asmlinkage long parisc_truncate64(const char __user * path,
- unsigned int high, unsigned int low)
-{
- return sys_truncate(path, (long)high << 32 | low);
-}
-
-asmlinkage long parisc_ftruncate64(unsigned int fd,
- unsigned int high, unsigned int low)
-{
- return sys_ftruncate(fd, (long)high << 32 | low);
-}
-
/* stubs for the benefit of the syscall_table since truncate64 and truncate
* are identical on LP64 */
asmlinkage long sys_truncate64(const char __user * path, unsigned long length)
@@ -309,62 +297,8 @@ asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg
{
return sys_fcntl(fd, cmd, arg);
}
-#else
-
-asmlinkage long parisc_truncate64(const char __user * path,
- unsigned int high, unsigned int low)
-{
- return sys_truncate64(path, (loff_t)high << 32 | low);
-}
-
-asmlinkage long parisc_ftruncate64(unsigned int fd,
- unsigned int high, unsigned int low)
-{
- return sys_ftruncate64(fd, (loff_t)high << 32 | low);
-}
#endif
-asmlinkage ssize_t parisc_pread64(unsigned int fd, char __user *buf, size_t count,
- unsigned int high, unsigned int low)
-{
- return sys_pread64(fd, buf, count, (loff_t)high << 32 | low);
-}
-
-asmlinkage ssize_t parisc_pwrite64(unsigned int fd, const char __user *buf,
- size_t count, unsigned int high, unsigned int low)
-{
- return sys_pwrite64(fd, buf, count, (loff_t)high << 32 | low);
-}
-
-asmlinkage ssize_t parisc_readahead(int fd, unsigned int high, unsigned int low,
- size_t count)
-{
- return sys_readahead(fd, (loff_t)high << 32 | low, count);
-}
-
-asmlinkage long parisc_fadvise64_64(int fd,
- unsigned int high_off, unsigned int low_off,
- unsigned int high_len, unsigned int low_len, int advice)
-{
- return sys_fadvise64_64(fd, (loff_t)high_off << 32 | low_off,
- (loff_t)high_len << 32 | low_len, advice);
-}
-
-asmlinkage long parisc_sync_file_range(int fd,
- u32 hi_off, u32 lo_off, u32 hi_nbytes, u32 lo_nbytes,
- unsigned int flags)
-{
- return sys_sync_file_range(fd, (loff_t)hi_off << 32 | lo_off,
- (loff_t)hi_nbytes << 32 | lo_nbytes, flags);
-}
-
-asmlinkage long parisc_fallocate(int fd, int mode, u32 offhi, u32 offlo,
- u32 lenhi, u32 lenlo)
-{
- return sys_fallocate(fd, mode, ((u64)offhi << 32) | offlo,
- ((u64)lenhi << 32) | lenlo);
-}
-
asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag)
{
return -ENOMEM;
@@ -374,18 +308,3 @@ asmlinkage int sys_free_hugepages(unsigned long addr)
{
return -EINVAL;
}
-
-long parisc_personality(unsigned long personality)
-{
- long err;
-
- if (personality(current->personality) == PER_LINUX32
- && personality(personality) == PER_LINUX)
- personality = (personality & ~PER_MASK) | PER_LINUX32;
-
- err = sys_personality(personality);
- if (personality(err) == PER_LINUX32)
- err = (err & ~PER_MASK) | PER_LINUX;
-
- return err;
-}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] arch: parisc: kernel: sys_parisc: Remove some unused functions
2015-01-02 18:09 [PATCH] arch: parisc: kernel: sys_parisc: Remove some unused functions Rickard Strandqvist
@ 2015-01-02 18:12 ` Helge Deller
2015-01-02 18:14 ` Al Viro
1 sibling, 0 replies; 3+ messages in thread
From: Helge Deller @ 2015-01-02 18:12 UTC (permalink / raw)
To: Rickard Strandqvist, James E.J. Bottomley
Cc: James Hogan, linux-parisc, linux-kernel
On 01/02/2015 07:09 PM, Rickard Strandqvist wrote:
> Removes some functions that are not used anywhere:
> parisc_personality() parisc_fallocate() parisc_sync_file_range()
> parisc_fadvise64_64() parisc_readahead() parisc_pwrite64() parisc_pread64()
> parisc_ftruncate64() parisc_truncate64()
>
> This was partially found by using a static code analysis program called cppcheck.
NAK.
Those functions implement syscalls specific to the parisc ABI.
They are referenced in the syscall table which gets generated by the ENTRY_OURS()
macro in arch/parisc/kernel/syscall_table.S
Helge
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
> arch/parisc/kernel/sys_parisc.c | 81 ---------------------------------------
> 1 file changed, 81 deletions(-)
>
> diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
> index e1ffea2..65ab69d 100644
> --- a/arch/parisc/kernel/sys_parisc.c
> +++ b/arch/parisc/kernel/sys_parisc.c
> @@ -283,18 +283,6 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
> /* Fucking broken ABI */
>
> #ifdef CONFIG_64BIT
> -asmlinkage long parisc_truncate64(const char __user * path,
> - unsigned int high, unsigned int low)
> -{
> - return sys_truncate(path, (long)high << 32 | low);
> -}
> -
> -asmlinkage long parisc_ftruncate64(unsigned int fd,
> - unsigned int high, unsigned int low)
> -{
> - return sys_ftruncate(fd, (long)high << 32 | low);
> -}
> -
> /* stubs for the benefit of the syscall_table since truncate64 and truncate
> * are identical on LP64 */
> asmlinkage long sys_truncate64(const char __user * path, unsigned long length)
> @@ -309,62 +297,8 @@ asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg
> {
> return sys_fcntl(fd, cmd, arg);
> }
> -#else
> -
> -asmlinkage long parisc_truncate64(const char __user * path,
> - unsigned int high, unsigned int low)
> -{
> - return sys_truncate64(path, (loff_t)high << 32 | low);
> -}
> -
> -asmlinkage long parisc_ftruncate64(unsigned int fd,
> - unsigned int high, unsigned int low)
> -{
> - return sys_ftruncate64(fd, (loff_t)high << 32 | low);
> -}
> #endif
>
> -asmlinkage ssize_t parisc_pread64(unsigned int fd, char __user *buf, size_t count,
> - unsigned int high, unsigned int low)
> -{
> - return sys_pread64(fd, buf, count, (loff_t)high << 32 | low);
> -}
> -
> -asmlinkage ssize_t parisc_pwrite64(unsigned int fd, const char __user *buf,
> - size_t count, unsigned int high, unsigned int low)
> -{
> - return sys_pwrite64(fd, buf, count, (loff_t)high << 32 | low);
> -}
> -
> -asmlinkage ssize_t parisc_readahead(int fd, unsigned int high, unsigned int low,
> - size_t count)
> -{
> - return sys_readahead(fd, (loff_t)high << 32 | low, count);
> -}
> -
> -asmlinkage long parisc_fadvise64_64(int fd,
> - unsigned int high_off, unsigned int low_off,
> - unsigned int high_len, unsigned int low_len, int advice)
> -{
> - return sys_fadvise64_64(fd, (loff_t)high_off << 32 | low_off,
> - (loff_t)high_len << 32 | low_len, advice);
> -}
> -
> -asmlinkage long parisc_sync_file_range(int fd,
> - u32 hi_off, u32 lo_off, u32 hi_nbytes, u32 lo_nbytes,
> - unsigned int flags)
> -{
> - return sys_sync_file_range(fd, (loff_t)hi_off << 32 | lo_off,
> - (loff_t)hi_nbytes << 32 | lo_nbytes, flags);
> -}
> -
> -asmlinkage long parisc_fallocate(int fd, int mode, u32 offhi, u32 offlo,
> - u32 lenhi, u32 lenlo)
> -{
> - return sys_fallocate(fd, mode, ((u64)offhi << 32) | offlo,
> - ((u64)lenhi << 32) | lenlo);
> -}
> -
> asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag)
> {
> return -ENOMEM;
> @@ -374,18 +308,3 @@ asmlinkage int sys_free_hugepages(unsigned long addr)
> {
> return -EINVAL;
> }
> -
> -long parisc_personality(unsigned long personality)
> -{
> - long err;
> -
> - if (personality(current->personality) == PER_LINUX32
> - && personality(personality) == PER_LINUX)
> - personality = (personality & ~PER_MASK) | PER_LINUX32;
> -
> - err = sys_personality(personality);
> - if (personality(err) == PER_LINUX32)
> - err = (err & ~PER_MASK) | PER_LINUX;
> -
> - return err;
> -}
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] arch: parisc: kernel: sys_parisc: Remove some unused functions
2015-01-02 18:09 [PATCH] arch: parisc: kernel: sys_parisc: Remove some unused functions Rickard Strandqvist
2015-01-02 18:12 ` Helge Deller
@ 2015-01-02 18:14 ` Al Viro
1 sibling, 0 replies; 3+ messages in thread
From: Al Viro @ 2015-01-02 18:14 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: James E.J. Bottomley, Helge Deller, James Hogan, linux-parisc,
linux-kernel
On Fri, Jan 02, 2015 at 07:09:50PM +0100, Rickard Strandqvist wrote:
> Removes some functions that are not used anywhere:
> parisc_personality() parisc_fallocate() parisc_sync_file_range()
> parisc_fadvise64_64() parisc_readahead() parisc_pwrite64() parisc_pread64()
> parisc_ftruncate64() parisc_truncate64()
>
> This was partially found by using a static code analysis program called cppcheck.
... which program has ended up missing
#define ENTRY_OURS(_name_) .word parisc_##_name_
and tons of lines like this
ENTRY_OURS(sync_file_range)
in arch/parisc/kernel/syscall_table.S
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-02 18:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-02 18:09 [PATCH] arch: parisc: kernel: sys_parisc: Remove some unused functions Rickard Strandqvist
2015-01-02 18:12 ` Helge Deller
2015-01-02 18:14 ` Al Viro
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).