[PATCH] convert that currently tests _NSIG directly to use valid_signal()

Convert most of the current code that uses _NSIG directly to instead use
valid_signal().  This avoids gcc -W warnings and off-by-one errors.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Jesper Juhl
2005-05-01 08:59:14 -07:00
committed by Linus Torvalds
parent e5bdd883a1
commit 7ed20e1ad5
33 changed files with 90 additions and 59 deletions

View File

@@ -23,6 +23,7 @@
#include <linux/skbuff.h>
#include <linux/netlink.h>
#include <linux/syscalls.h>
#include <linux/signal.h>
#include <net/sock.h>
#include "util.h"
@@ -976,8 +977,7 @@ asmlinkage long sys_mq_notify(mqd_t mqdes,
notification.sigev_notify != SIGEV_THREAD))
return -EINVAL;
if (notification.sigev_notify == SIGEV_SIGNAL &&
(notification.sigev_signo < 0 ||
notification.sigev_signo > _NSIG)) {
!valid_signal(notification.sigev_signo)) {
return -EINVAL;
}
if (notification.sigev_notify == SIGEV_THREAD) {