mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: eric.piel@tremplin-utc.net
To: Andrew Morton <akpm@osdl.org>
Cc: eric.piel@tremplin-utc.net, minyard@acm.org, george@mvista.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Incorrect value for SIGRTMAX
Date: Sat, 24 Jan 2004 23:37:39 +0100	[thread overview]
Message-ID: <1074983859.4012f3b32e87a@mailetu.utc.fr> (raw)
In-Reply-To: <20040124143037.5116ccc9.akpm@osdl.org>

Quoting Andrew Morton <akpm@osdl.org>:


> b) it's casting the result of (foo > N) to unsigned which is nonsensical.
> 
> Your patch doesn't address b).
> 
> I don't thik there's a case in which sigev_signo can be negative anyway. 
> But if there is, the cast should be done like the below, yes?
God! I hadn't catch this one :-) Actually, the cast is needed because
sigev_signo is an int, this catches the (all fobidden) negative values.

Your patch is the right one :-)
Eric
 
> 
>  kernel/posix-timers.c |    3 +--
>  1 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff -puN kernel/posix-timers.c~SIGRTMAX-fix kernel/posix-timers.c
> --- 25/kernel/posix-timers.c~SIGRTMAX-fix	2004-01-24 14:27:13.000000000
> -0800
> +++ 25-akpm/kernel/posix-timers.c	2004-01-24 14:28:21.000000000 -0800
> @@ -344,8 +344,7 @@ static inline struct task_struct * good_
>  		return NULL;
>  
>  	if ((event->sigev_notify & ~SIGEV_NONE & MIPS_SIGEV) &&
> -			event->sigev_signo &&
> -			((unsigned) (event->sigev_signo > SIGRTMAX)))
> +	    (((unsigned)event->sigev_signo > SIGRTMAX) || !event->sigev_signo))
>  		return NULL;
>  
>  	return rtn;
> 


  reply	other threads:[~2004-01-24 22:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-24 21:31 eric.piel
2004-01-24 22:30 ` Andrew Morton
2004-01-24 22:37   ` eric.piel [this message]
2004-01-25  9:21     ` George Anzinger
2004-01-25 10:28       ` eric.piel
2004-01-27  9:19 ` [PATCH] Incorrect value for SIGRTMAX, MIPS nonsense removed, timer_gettime fix George Anzinger
2004-01-27 18:46   ` Andrew Morton
2004-01-27 20:32     ` George Anzinger
2004-01-27  9:31 ` [PATCH] Fine tune the time conversion to eliminate conversion errors George Anzinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1074983859.4012f3b32e87a@mailetu.utc.fr \
    --to=eric.piel@tremplin-utc.net \
    --cc=akpm@osdl.org \
    --cc=george@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®