[PATCH] streamline preempt_count type across archs
authorJesper Juhl <juhl-lkml@dif.dk>
Thu, 23 Jun 2005 07:09:07 +0000 (00:09 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 23 Jun 2005 16:45:19 +0000 (09:45 -0700)
The preempt_count member of struct thread_info is currently either defined
as int, unsigned int or __s32 depending on arch.  This patch makes the type
of preempt_count an int on all archs.

Having preempt_count be an unsigned type prevents the catching of
preempt_count < 0 bugs, and using int on some archs and __s32 on others is
not exactely "neat" - much nicer when it's just int all over.

A previous version of this patch was already ACK'ed by Robert Love, and the
only change in this version of the patch compared to the one he ACK'ed is
that this one also makes sure the preempt_count member is consistently
commented.

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>
22 files changed:
include/asm-arm/thread_info.h
include/asm-arm26/thread_info.h
include/asm-cris/thread_info.h
include/asm-frv/thread_info.h
include/asm-h8300/thread_info.h
include/asm-i386/thread_info.h
include/asm-ia64/thread_info.h
include/asm-m32r/thread_info.h
include/asm-m68k/thread_info.h
include/asm-m68knommu/thread_info.h
include/asm-mips/thread_info.h
include/asm-parisc/thread_info.h
include/asm-ppc/thread_info.h
include/asm-ppc64/thread_info.h
include/asm-s390/thread_info.h
include/asm-sh/thread_info.h
include/asm-sh64/thread_info.h
include/asm-sparc/thread_info.h
include/asm-sparc64/thread_info.h
include/asm-um/thread_info.h
include/asm-v850/thread_info.h
include/asm-x86_64/thread_info.h

index 66c585c..8252a4c 100644 (file)
@@ -49,7 +49,7 @@ struct cpu_context_save {
  */
 struct thread_info {
        unsigned long           flags;          /* low level flags */
-       __s32                   preempt_count;  /* 0 => preemptable, <0 => bug */
+       int                     preempt_count;  /* 0 => preemptable, <0 => bug */
        mm_segment_t            addr_limit;     /* address limit */
        struct task_struct      *task;          /* main task structure */
        struct exec_domain      *exec_domain;   /* execution domain */
index 50f41b5..aff3e56 100644 (file)
@@ -44,7 +44,7 @@ struct cpu_context_save {
  */
 struct thread_info {
        unsigned long           flags;          /* low level flags */
-       __s32                   preempt_count;  /* 0 => preemptable, <0 => bug */
+       int                     preempt_count;  /* 0 => preemptable, <0 => bug */
        mm_segment_t            addr_limit;     /* address limit */
        struct task_struct      *task;          /* main task structure */
        struct exec_domain      *exec_domain;   /* execution domain */
index 53193fe..5ba4b78 100644 (file)
@@ -31,7 +31,7 @@ struct thread_info {
        struct exec_domain      *exec_domain;   /* execution domain */
        unsigned long           flags;          /* low level flags */
        __u32                   cpu;            /* current CPU */
-       __s32                   preempt_count; /* 0 => preemptable, <0 => BUG */
+       int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
 
        mm_segment_t            addr_limit;     /* thread address space:
                                                   0-0xBFFFFFFF for user-thead
index b80a97f..c8cba78 100644 (file)
@@ -33,7 +33,7 @@ struct thread_info {
        unsigned long           flags;          /* low level flags */
        unsigned long           status;         /* thread-synchronous flags */
        __u32                   cpu;            /* current CPU */
-       __s32                   preempt_count;  /* 0 => preemptable, <0 => BUG */
+       int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
 
        mm_segment_t            addr_limit;     /* thread address space:
                                                   0-0xBFFFFFFF for user-thead
index b07c934..bfcc755 100644 (file)
@@ -23,7 +23,7 @@ struct thread_info {
        struct exec_domain *exec_domain;        /* execution domain */
        unsigned long      flags;               /* low level flags */
        int                cpu;                 /* cpu we're on */
-       int                preempt_count;       /* 0 => preemptable, <0 => BUG*/
+       int                preempt_count;       /* 0 => preemptable, <0 => BUG */
        struct restart_block restart_block;
 };
 
index 2cd5727..95add81 100644 (file)
@@ -31,7 +31,7 @@ struct thread_info {
        unsigned long           flags;          /* low level flags */
        unsigned long           status;         /* thread-synchronous flags */
        __u32                   cpu;            /* current CPU */
-       __s32                   preempt_count; /* 0 => preemptable, <0 => BUG */
+       int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
 
 
        mm_segment_t            addr_limit;     /* thread address space:
index 8d5b7e7..7dc8951 100644 (file)
@@ -25,7 +25,7 @@ struct thread_info {
        __u32 flags;                    /* thread_info flags (see TIF_*) */
        __u32 cpu;                      /* current CPU */
        mm_segment_t addr_limit;        /* user-level address space limit */
-       __s32 preempt_count;            /* 0=premptable, <0=BUG; will also serve as bh-counter */
+       int preempt_count;              /* 0=premptable, <0=BUG; will also serve as bh-counter */
        struct restart_block restart_block;
        struct {
                int signo;
index 9f3a0fc..7a6be77 100644 (file)
@@ -28,7 +28,7 @@ struct thread_info {
        unsigned long           flags;          /* low level flags */
        unsigned long           status;         /* thread-synchronous flags */
        __u32                   cpu;            /* current CPU */
-       __s32                   preempt_count; /* 0 => preemptable, <0 => BUG */
+       int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
 
        mm_segment_t            addr_limit;     /* thread address space:
                                                   0-0xBFFFFFFF for user-thread
index 5f58939..2aed24f 100644 (file)
@@ -8,7 +8,7 @@
 struct thread_info {
        struct task_struct      *task;          /* main task structure */
        struct exec_domain      *exec_domain;   /* execution domain */
-       __s32                   preempt_count; /* 0 => preemptable, <0 => BUG */
+       int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
        __u32 cpu; /* should always be 0 on m68k */
        struct restart_block    restart_block;
 
index c8153b7..7b9a3fa 100644 (file)
@@ -36,7 +36,7 @@ struct thread_info {
        struct exec_domain *exec_domain;        /* execution domain */
        unsigned long      flags;               /* low level flags */
        int                cpu;                 /* cpu we're on */
-       int                preempt_count;       /* 0 => preemptable, <0 => BUG*/
+       int                preempt_count;       /* 0 => preemptable, <0 => BUG */
        struct restart_block restart_block;
 };
 
index 7689003..42fcd6f 100644 (file)
@@ -27,7 +27,7 @@ struct thread_info {
        struct exec_domain      *exec_domain;   /* execution domain */
        unsigned long           flags;          /* low level flags */
        __u32                   cpu;            /* current CPU */
-       __s32                   preempt_count; /* 0 => preemptable, <0 => BUG */
+       int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
 
        mm_segment_t            addr_limit;     /* thread address space:
                                                   0-0xBFFFFFFF for user-thead
index fe9b7f8..57bbb76 100644 (file)
@@ -12,7 +12,7 @@ struct thread_info {
        unsigned long flags;            /* thread_info flags (see TIF_*) */
        mm_segment_t addr_limit;        /* user-level address space limit */
        __u32 cpu;                      /* current CPU */
-       __s32 preempt_count;            /* 0=premptable, <0=BUG; will also serve as bh-counter */
+       int preempt_count;              /* 0=premptable, <0=BUG; will also serve as bh-counter */
        struct restart_block restart_block;
 };
 
index e3b5284..27903db 100644 (file)
@@ -20,7 +20,8 @@ struct thread_info {
        unsigned long           flags;          /* low level flags */
        unsigned long           local_flags;    /* non-racy flags */
        int                     cpu;            /* cpu we're on */
-       int                     preempt_count;
+       int                     preempt_count;  /* 0 => preemptable,
+                                                  <0 => BUG */
        struct restart_block    restart_block;
 };
 
index 48b7900..0494df6 100644 (file)
@@ -24,7 +24,7 @@ struct thread_info {
        struct task_struct *task;               /* main task structure */
        struct exec_domain *exec_domain;        /* execution domain */
        int             cpu;                    /* cpu we're on */
-       int             preempt_count;
+       int             preempt_count;          /* 0 => preemptable, <0 => BUG */
        struct restart_block restart_block;
        /* set by force_successful_syscall_return */
        unsigned char   syscall_noerror;
index aade85c..fe101d4 100644 (file)
@@ -50,7 +50,7 @@ struct thread_info {
        struct exec_domain      *exec_domain;   /* execution domain */
        unsigned long           flags;          /* low level flags */
        unsigned int            cpu;            /* current CPU */
-       unsigned int            preempt_count; /* 0 => preemptable */
+       int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
        struct restart_block    restart_block;
 };
 
index 4bbbd9f..46080ce 100644 (file)
@@ -20,7 +20,7 @@ struct thread_info {
        struct exec_domain      *exec_domain;   /* execution domain */
        __u32                   flags;          /* low level flags */
        __u32                   cpu;
-       __s32                   preempt_count; /* 0 => preemptable, <0 => BUG */
+       int                     preempt_count; /* 0 => preemptable, <0 => BUG */
        struct restart_block    restart_block;
        __u8                    supervisor_stack[0];
 };
index 8a32d6b..10f024c 100644 (file)
@@ -22,7 +22,7 @@ struct thread_info {
        struct exec_domain      *exec_domain;   /* execution domain */
        unsigned long           flags;          /* low level flags */
        /* Put the 4 32-bit fields together to make asm offsetting easier. */
-       __s32                   preempt_count; /* 0 => preemptable, <0 => BUG */
+       int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
        __u16                   cpu;
 
        mm_segment_t            addr_limit;
index 104f03c..ff6ccb3 100644 (file)
@@ -30,9 +30,9 @@ struct thread_info {
        struct task_struct      *task;          /* main task structure */
        struct exec_domain      *exec_domain;   /* execution domain */
        unsigned long           flags;          /* low level flags */
-
        int                     cpu;            /* cpu we're on */
-       int                     preempt_count;
+       int                     preempt_count;  /* 0 => preemptable,
+                                                  <0 => BUG */
        int                     softirq_count;
        int                     hardirq_count;
 
index 517caab..0cd6529 100644 (file)
@@ -46,7 +46,7 @@ struct thread_info {
        unsigned long           fault_address;
        struct pt_regs          *kregs;
        struct exec_domain      *exec_domain;
-       int                     preempt_count;
+       int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
        int                     __pad;
 
        unsigned long           *utraps;
index 1feaaf1..97267f0 100644 (file)
@@ -17,7 +17,7 @@ struct thread_info {
        struct exec_domain      *exec_domain;   /* execution domain */
        unsigned long           flags;          /* low level flags */
        __u32                   cpu;            /* current CPU */
-       __s32                   preempt_count;  /* 0 => preemptable, 
+       int                     preempt_count;  /* 0 => preemptable,
                                                   <0 => BUG */
        mm_segment_t            addr_limit;     /* thread address space:
                                                   0-0xBFFFFFFF for user
index e2ef445..e4cfad9 100644 (file)
@@ -30,7 +30,8 @@ struct thread_info {
        struct exec_domain      *exec_domain;   /* execution domain */
        unsigned long           flags;          /* low level flags */
        int                     cpu;            /* cpu we're on */
-       int                     preempt_count;
+       int                     preempt_count;  /* 0 => preemptable,
+                                                  <0 => BUG */
        struct restart_block    restart_block;
 };
 
index f4b3b24..08eb6e4 100644 (file)
@@ -29,7 +29,7 @@ struct thread_info {
        __u32                   flags;          /* low level flags */
        __u32                   status;         /* thread synchronous flags */
        __u32                   cpu;            /* current CPU */
-       int                     preempt_count;
+       int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
 
        mm_segment_t            addr_limit;     
        struct restart_block    restart_block;