Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] fix post-fence error
@ 2007-10-27  0:02 Roel Kluin
  2007-10-27 12:02 ` Sergei Shtylyov
  0 siblings, 1 reply; 8+ messages in thread
From: Roel Kluin @ 2007-10-27  0:02 UTC (permalink / raw)
  To: linux-mips

In the same file:

typedef struct {
        unsigned long sig[4];
} irix_sigset_t;
---
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index a0a9105..d65c51c 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -527,7 +527,7 @@ asmlinkage int irix_sigpoll_sys(unsigned long __user *set,
 
 		expire = schedule_timeout_interruptible(expire);
 
-		for (i=0; i<=4; i++)
+		for (i=0; i<4; i++)
 			tmp |= (current->pending.signal.sig[i] & kset.sig[i]);
 
 		if (tmp)

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

* Re: [PATCH] fix post-fence error
  2007-10-27  0:02 [PATCH] fix post-fence error Roel Kluin
@ 2007-10-27 12:02 ` Sergei Shtylyov
  2007-10-27 12:16   ` Roel Kluin
  0 siblings, 1 reply; 8+ messages in thread
From: Sergei Shtylyov @ 2007-10-27 12:02 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linux-mips

Hello.

Roel Kluin wrote:

> In the same file:

> typedef struct {
>         unsigned long sig[4];
> } irix_sigset_t;
> ---
> diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
> index a0a9105..d65c51c 100644
> --- a/arch/mips/kernel/irixsig.c
> +++ b/arch/mips/kernel/irixsig.c
> @@ -527,7 +527,7 @@ asmlinkage int irix_sigpoll_sys(unsigned long __user *set,
>  
>  		expire = schedule_timeout_interruptible(expire);
>  
> -		for (i=0; i<=4; i++)
> +		for (i=0; i<4; i++)

    Could also add spaces between the operands and operators (like 
above/below), while at it...

>  			tmp |= (current->pending.signal.sig[i] & kset.sig[i]);

WBR, Sergei

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

* Re: [PATCH] fix post-fence error
  2007-10-27 12:02 ` Sergei Shtylyov
@ 2007-10-27 12:16   ` Roel Kluin
  2007-10-27 12:18     ` Sergei Shtylyov
  2007-10-29 15:02     ` Ralf Baechle
  0 siblings, 2 replies; 8+ messages in thread
From: Roel Kluin @ 2007-10-27 12:16 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-mips

Sergei Shtylyov wrote:
> 
>    Could also add spaces between the operands and operators (like
> above/below), while at it...
> 
like this?
--
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index a0a9105..11e74fe 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -527,7 +527,7 @@ asmlinkage int irix_sigpoll_sys(unsigned long __user *set,
 
 		expire = schedule_timeout_interruptible(expire);
 
-		for (i=0; i<=4; i++)
+		for (i = 0; i < 4; i++)
 			tmp |= (current->pending.signal.sig[i] & kset.sig[i]);
 
 		if (tmp)

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

* Re: [PATCH] fix post-fence error
  2007-10-27 12:16   ` Roel Kluin
@ 2007-10-27 12:18     ` Sergei Shtylyov
  2007-10-29 15:02     ` Ralf Baechle
  1 sibling, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2007-10-27 12:18 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linux-mips

Roel Kluin wrote:

>>   Could also add spaces between the operands and operators (like
>>above/below), while at it...

> like this?

    Exactly.

WBR, Sergei

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

* Re: [PATCH] fix post-fence error
  2007-10-27 12:16   ` Roel Kluin
  2007-10-27 12:18     ` Sergei Shtylyov
@ 2007-10-29 15:02     ` Ralf Baechle
  2007-10-29 15:36       ` Sergei Shtylyov
  1 sibling, 1 reply; 8+ messages in thread
From: Ralf Baechle @ 2007-10-29 15:02 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Sergei Shtylyov, linux-mips

On Sat, Oct 27, 2007 at 02:16:45PM +0200, Roel Kluin wrote:

> Sergei Shtylyov wrote:
> > 
> >    Could also add spaces between the operands and operators (like
> > above/below), while at it...
> > 
> like this?

Thanks. I didn't like the magic numbers in the code so I went for below
patch instead.

Cheers,

  Ralf

From: Ralf Baechle <ralf@linux-mips.org>

[MIPS] IRIX: Fix off-by-one error in signal compat code.

Based on original patch by Roel Kluin <12o3l@tiscali.nl>.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index a0a9105..5052f47 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -24,8 +24,12 @@
 
 #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP)))
 
+#define _IRIX_NSIG		128
+#define _IRIX_NSIG_BPW		BITS_PER_LONG
+#define _IRIX_NSIG_WORDS	(_IRIX_NSIG / _IRIX_NSIG_BPW)
+
 typedef struct {
-	unsigned long sig[4];
+	unsigned long sig[_IRIX_NSIG_WORDS];
 } irix_sigset_t;
 
 struct sigctx_irix5 {
@@ -527,7 +531,7 @@ asmlinkage int irix_sigpoll_sys(unsigned long __user *set,
 
 		expire = schedule_timeout_interruptible(expire);
 
-		for (i=0; i<=4; i++)
+		for (i=0; i < _IRIX_NSIG_BPW; i++)
 			tmp |= (current->pending.signal.sig[i] & kset.sig[i]);
 
 		if (tmp)

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

* Re: [PATCH] fix post-fence error
  2007-10-29 15:02     ` Ralf Baechle
@ 2007-10-29 15:36       ` Sergei Shtylyov
  2007-10-29 19:18         ` Ralf Baechle
  0 siblings, 1 reply; 8+ messages in thread
From: Sergei Shtylyov @ 2007-10-29 15:36 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Roel Kluin, linux-mips

Hello.

Ralf Baechle wrote:

>>Sergei Shtylyov wrote:

>>>   Could also add spaces between the operands and operators (like
>>>above/below), while at it...

>>like this?

> Thanks. I didn't like the magic numbers in the code so I went for below
> patch instead.

> Cheers,

>   Ralf

> From: Ralf Baechle <ralf@linux-mips.org>

> [MIPS] IRIX: Fix off-by-one error in signal compat code.

> Based on original patch by Roel Kluin <12o3l@tiscali.nl>.

> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

    I'm afraid this new patch is wrong...

> diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
> index a0a9105..5052f47 100644
> --- a/arch/mips/kernel/irixsig.c
> +++ b/arch/mips/kernel/irixsig.c
> @@ -24,8 +24,12 @@
>  
>  #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP)))
>  
> +#define _IRIX_NSIG		128
> +#define _IRIX_NSIG_BPW		BITS_PER_LONG
> +#define _IRIX_NSIG_WORDS	(_IRIX_NSIG / _IRIX_NSIG_BPW)
> +
>  typedef struct {
> -	unsigned long sig[4];
> +	unsigned long sig[_IRIX_NSIG_WORDS];
>  } irix_sigset_t;
>  
>  struct sigctx_irix5 {
> @@ -527,7 +531,7 @@ asmlinkage int irix_sigpoll_sys(unsigned long __user *set,
>  
>  		expire = schedule_timeout_interruptible(expire);
>  
> -		for (i=0; i<=4; i++)
> +		for (i=0; i < _IRIX_NSIG_BPW; i++)

    Did you mean _IRIX_NSIG_WORDS? :-/

>  			tmp |= (current->pending.signal.sig[i] & kset.sig[i]);
>  
>  		if (tmp)

WBR, Sergei

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

* Re: [PATCH] fix post-fence error
  2007-10-29 15:36       ` Sergei Shtylyov
@ 2007-10-29 19:18         ` Ralf Baechle
  2007-10-29 20:05           ` Sergei Shtylyov
  0 siblings, 1 reply; 8+ messages in thread
From: Ralf Baechle @ 2007-10-29 19:18 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Roel Kluin, linux-mips

On Mon, Oct 29, 2007 at 06:36:05PM +0300, Sergei Shtylyov wrote:

>    I'm afraid this new patch is wrong...

Indeed.  Thanks for proofreading, even if after the fact ...

  Ralf

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

* Re: [PATCH] fix post-fence error
  2007-10-29 19:18         ` Ralf Baechle
@ 2007-10-29 20:05           ` Sergei Shtylyov
  0 siblings, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2007-10-29 20:05 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Roel Kluin, linux-mips

Ralf Baechle wrote:

>>   I'm afraid this new patch is wrong...

> Indeed.  Thanks for proofreading, even if after the fact ...

    You were too quick with commit. :-)
    Could also convert all of this construct to a proper kernel style:

         for (i = 0; i < _IRIX_NSIG_BPW; i++)

>   Ralf

WBR, Sergei

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

end of thread, other threads:[~2007-10-29 20:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-27  0:02 [PATCH] fix post-fence error Roel Kluin
2007-10-27 12:02 ` Sergei Shtylyov
2007-10-27 12:16   ` Roel Kluin
2007-10-27 12:18     ` Sergei Shtylyov
2007-10-29 15:02     ` Ralf Baechle
2007-10-29 15:36       ` Sergei Shtylyov
2007-10-29 19:18         ` Ralf Baechle
2007-10-29 20:05           ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox