Skip to content

Commit

Permalink
[PATCH] get_cpu_sysdev() signedness fix
Browse files Browse the repository at this point in the history
Doing (int < NR_CPUS) doesn't dtrt if it's negative..

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Andrew Morton authored and Greg Kroah-Hartman committed Mar 20, 2006
1 parent 7423172 commit a29d642
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/base/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int __devinit register_cpu(struct cpu *cpu, int num, struct node *root)
return error;
}

struct sys_device *get_cpu_sysdev(int cpu)
struct sys_device *get_cpu_sysdev(unsigned cpu)
{
if (cpu < NR_CPUS)
return cpu_sys_devices[cpu];
Expand Down
2 changes: 1 addition & 1 deletion include/linux/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct cpu {
};

extern int register_cpu(struct cpu *, int, struct node *);
extern struct sys_device *get_cpu_sysdev(int cpu);
extern struct sys_device *get_cpu_sysdev(unsigned cpu);
#ifdef CONFIG_HOTPLUG_CPU
extern void unregister_cpu(struct cpu *, struct node *);
#endif
Expand Down

0 comments on commit a29d642

Please sign in to comment.