Skip to contentSkip to conversation

remove dead code from sys_parisc32.c

RFC In review Christoph Hellwig 5 participants 10 messages Aug 17, 2008 – Jun 15, 2009 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

RFC 1/1 remove dead code from sys_parisc32.c

Unless I'm totally missing something get_fd_set32/set_fd_set32 are completely unused.

arch/parisc/kernel/sys_parisc32.c +0 -61
Index: linux-2.6/arch/parisc/kernel/sys_parisc32.c
===================================================================
@@ -284,68 +284,6 @@ int cp_compat_stat(struct kstat *stat, s
 	return err;
 }
 
-/*** copied from mips64 ***/
-/*
- * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
- * 64-bit unsigned longs.
- */
-
-static inline int
-get_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-	if (ufdset) {
-		unsigned long odd;
-
-		if (!access_ok(VERIFY_WRITE, ufdset, n*sizeof(u32)))
-			return -EFAULT;
-
-		odd = n & 1UL;
-		n &= ~1UL;
-		while (n) {
-			unsigned long h, l;
-			__get_user(l, ufdset);
-			__get_user(h, ufdset+1);
-			ufdset += 2;
-			*fdset++ = h << 32 | l;
-			n -= 2;
-		}
-		if (odd)
-			__get_user(*fdset, ufdset);
-	} else {
-		/* Tricky, must clear full unsigned long in the
-		 * kernel fdset at the end, this makes sure that
-		 * actually happens.
-		 */
-		memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
-	}
-	return 0;
-}
-
-static inline void
-set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	unsigned long odd;
-	n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-
-	if (!ufdset)
-		return;
-
-	odd = n & 1UL;
-	n &= ~1UL;
-	while (n) {
-		unsigned long h, l;
-		l = *fdset++;
-		h = l >> 32;
-		__put_user(l, ufdset);
-		__put_user(h, ufdset+1);
-		ufdset += 2;
-		n -= 2;
-	}
-	if (odd)
-		__put_user(*fdset, ufdset);
-}
#1 lore raw
Quoted 2 lines · Christoph Hellwig

Unless I'm totally missing something get_fd_set32/set_fd_set32 are completely unused.

I think get_fd_set32 was replaced by compat_get_fd_set. In any case, I didn't find any users either.

Quoted 1 line

thanks,
grant

Quoted 78 lines

Index: linux-2.6/arch/parisc/kernel/sys_parisc32.c
===================================================================

arch/parisc/kernel/sys_parisc32.c +0 -63
@@ -284,68 +284,6 @@ int cp_compat_stat(struct kstat *stat, s
 	return err;
 }
 
-/*** copied from mips64 ***/
-/*
- * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
- * 64-bit unsigned longs.
- */
-
-static inline int
-get_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-	if (ufdset) {
-		unsigned long odd;
-
-		if (!access_ok(VERIFY_WRITE, ufdset, n*sizeof(u32)))
-			return -EFAULT;
-
-		odd = n & 1UL;
-		n &= ~1UL;
-		while (n) {
-			unsigned long h, l;
-			__get_user(l, ufdset);
-			__get_user(h, ufdset+1);
-			ufdset += 2;
-			*fdset++ = h << 32 | l;
-			n -= 2;
-		}
-		if (odd)
-			__get_user(*fdset, ufdset);
-	} else {
-		/* Tricky, must clear full unsigned long in the
-		 * kernel fdset at the end, this makes sure that
-		 * actually happens.
-		 */
-		memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
-	}
-	return 0;
-}
-
-static inline void
-set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	unsigned long odd;
-	n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-
-	if (!ufdset)
-		return;
-
-	odd = n & 1UL;
-	n &= ~1UL;
-	while (n) {
-		unsigned long h, l;
-		l = *fdset++;
-		h = l >> 32;
-		__put_user(l, ufdset);
-		__put_user(h, ufdset+1);
-		ufdset += 2;
-		n -= 2;
-	}
-	if (odd)
-		__put_user(*fdset, ufdset);
-}
-
 struct msgbuf32 {
     int mtype;
     char mtext[1];
--

To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Christoph Hellwig

Anyone wants to pick this one up?

Quoted 69 lines · Christoph Hellwig

Unless I'm totally missing something get_fd_set32/set_fd_set32 are completely unused.

Index: linux-2.6/arch/parisc/kernel/sys_parisc32.c
===================================================================

arch/parisc/kernel/sys_parisc32.c +0 -55
@@ -284,68 +284,6 @@ int cp_compat_stat(struct kstat *stat, s
 	return err;
 }
 
-/*** copied from mips64 ***/
-/*
- * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
- * 64-bit unsigned longs.
- */
-
-static inline int
-get_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-	if (ufdset) {
-		unsigned long odd;
-
-		if (!access_ok(VERIFY_WRITE, ufdset, n*sizeof(u32)))
-			return -EFAULT;
-
-		odd = n & 1UL;
-		n &= ~1UL;
-		while (n) {
-			unsigned long h, l;
-			__get_user(l, ufdset);
-			__get_user(h, ufdset+1);
-			ufdset += 2;
-			*fdset++ = h << 32 | l;
-			n -= 2;
-		}
-		if (odd)
-			__get_user(*fdset, ufdset);
-	} else {
-		/* Tricky, must clear full unsigned long in the
-		 * kernel fdset at the end, this makes sure that
-		 * actually happens.
-		 */
-		memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
-	}
-	return 0;
-}
-
-static inline void
-set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	unsigned long odd;
-	n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-
-	if (!ufdset)
-		return;
-
-	odd = n & 1UL;
-	n &= ~1UL;
-	while (n) {
-		unsigned long h, l;
-		l = *fdset++;
-		h = l >> 32;
-		__put_user(l, ufdset);
-		__put_user(h, ufdset+1);

arch/parisc/kernel/sys_parisc32.c int cp_compat_stat(struct kstat *stat, s · line 289

Quoted 10 lines
arch/parisc/kernel/sys_parisc32.c +0 -7
-		ufdset += 2;
-		n -= 2;
-	}
-	if (odd)
-		__put_user(*fdset, ufdset);
-}
-
 struct msgbuf32 {
     int mtype;
     char mtext[1];

---end quoted text---

#4 lore raw
Quoted 6 lines · Christoph Hellwig

Anyone wants to pick this one up?

Quoted 3 lines · Christoph Hellwig

Unless I'm totally missing something get_fd_set32/set_fd_set32 are completely unused.

Heh, sorry. Applied.

#5 lore raw
In reply to Christoph Hellwig

ping?

Quoted 75 lines · Christoph Hellwig

Anyone wants to pick this one up?

Quoted 72 lines · Christoph Hellwig

Unless I'm totally missing something get_fd_set32/set_fd_set32 are completely unused.

Index: linux-2.6/arch/parisc/kernel/sys_parisc32.c
===================================================================

arch/parisc/kernel/sys_parisc32.c +0 -58
@@ -284,68 +284,6 @@ int cp_compat_stat(struct kstat *stat, s
 	return err;
 }
 
-/*** copied from mips64 ***/
-/*
- * Ooo, nasty.  We need here to frob 32-bit unsigned longs to
- * 64-bit unsigned longs.
- */
-
-static inline int
-get_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-	if (ufdset) {
-		unsigned long odd;
-
-		if (!access_ok(VERIFY_WRITE, ufdset, n*sizeof(u32)))
-			return -EFAULT;
-
-		odd = n & 1UL;
-		n &= ~1UL;
-		while (n) {
-			unsigned long h, l;
-			__get_user(l, ufdset);
-			__get_user(h, ufdset+1);
-			ufdset += 2;
-			*fdset++ = h << 32 | l;
-			n -= 2;
-		}
-		if (odd)
-			__get_user(*fdset, ufdset);
-	} else {
-		/* Tricky, must clear full unsigned long in the
-		 * kernel fdset at the end, this makes sure that
-		 * actually happens.
-		 */
-		memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
-	}
-	return 0;
-}
-
-static inline void
-set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
-{
-	unsigned long odd;
-	n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
-
-	if (!ufdset)
-		return;
-
-	odd = n & 1UL;
-	n &= ~1UL;
-	while (n) {
-		unsigned long h, l;
-		l = *fdset++;
-		h = l >> 32;
-		__put_user(l, ufdset);
-		__put_user(h, ufdset+1);
-		ufdset += 2;
-		n -= 2;
-	}
Quoted 8 lines

arch/parisc/kernel/sys_parisc32.c int cp_compat_stat(struct kstat *stat, s · line 289

Quoted 7 lines
arch/parisc/kernel/sys_parisc32.c +0 -4
-	if (odd)
-		__put_user(*fdset, ufdset);
-}
-
 struct msgbuf32 {
     int mtype;
     char mtext[1];

---end quoted text---

---end quoted text---

#6 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines

Anyone wants to pick this one up?

Quoted 2 lines · Christoph Hellwig

Unless I'm totally missing something get_fd_set32/set_fd_set32 are completely unused.

In theory, they were removed in 2004 by this proposed change:
http://lkml.org/lkml/2004/4/17/37

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
#7 lore raw
Quoted 9 lines · John David Anglin
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines

Anyone wants to pick this one up?

Quoted 2 lines · Christoph Hellwig

Unless I'm totally missing something get_fd_set32/set_fd_set32 are completely unused.

In theory, they were removed in 2004 by this proposed change:
http://lkml.org/lkml/2004/4/17/37

The users were removed, the helpers stayed. Kyle promised to put the patch to remove them in last year, but somehow the patch got lost a couple of times :)

#8 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 7 lines · John David Anglin
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines

Anyone wants to pick this one up?

Quoted 2 lines · Christoph Hellwig

Unless I'm totally missing something get_fd_set32/set_fd_set32 are completely unused.

Quoted 6 lines
Quoted 2 lines

In theory, they were removed in 2004 by this proposed change:
http://lkml.org/lkml/2004/4/17/37

The users were removed, the helpers stayed. Kyle promised to put the patch to remove them in last year, but somehow the patch got lost a couple of times :)

Kyle and Helge are the maintainers right now and probably just need to push your original patch. It looks straight forward to me.

thanks
grant

#9 lore raw
In reply to Christoph Hellwig
Quoted 8 lines · Christoph Hellwig
Quoted 7 lines · John David Anglin
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines

Anyone wants to pick this one up?

Quoted 2 lines · Christoph Hellwig

Unless I'm totally missing something get_fd_set32/set_fd_set32 are completely unused.

Quoted 7 lines
Quoted 2 lines

In theory, they were removed in 2004 by this proposed change:
http://lkml.org/lkml/2004/4/17/37

The users were removed, the helpers stayed. Kyle promised to put the patch to remove them in last year, but somehow the patch got lost a couple of times :)

Yeah yeah, I suck. :) I'll send it along tonight.