Fix signedness of minor2unit().
This commit is contained in:
parent
ec346d1040
commit
3238ec33e1
@ -259,12 +259,12 @@ dev2unit(struct cdev *x)
|
||||
return (minor2unit(minor(x)));
|
||||
}
|
||||
|
||||
int
|
||||
minor2unit(int _minor)
|
||||
u_int
|
||||
minor2unit(u_int _minor)
|
||||
{
|
||||
|
||||
KASSERT((_minor & ~MAXMINOR) == 0, ("Illegal minor %x", _minor));
|
||||
return ((_minor & 0xff) | (_minor >> 8));
|
||||
return ((_minor & 0xff) | ((_minor >> 8) & 0xffff00));
|
||||
}
|
||||
|
||||
int
|
||||
@ -463,7 +463,7 @@ make_dev(struct cdevsw *devsw, int minornr, uid_t uid, gid_t gid, int perms, con
|
||||
return (dev);
|
||||
}
|
||||
KASSERT(!(dev->si_flags & SI_NAMED),
|
||||
("make_dev() by driver %s on pre-existing device (maj=%d, min=%d, name=%s)",
|
||||
("make_dev() by driver %s on pre-existing device (maj=%d, min=%x, name=%s)",
|
||||
devsw->d_name, major(dev), minor(dev), devtoname(dev)));
|
||||
|
||||
va_start(ap, fmt);
|
||||
|
@ -220,7 +220,7 @@ struct cdevsw {
|
||||
|
||||
#define NUMCDEVSW 256
|
||||
|
||||
#define MAXMINOR 0xffff00ff
|
||||
#define MAXMINOR 0xffff00ffU
|
||||
|
||||
/*
|
||||
* XXX: do not use MAJOR_AUTO unless you have no choice. In general drivers
|
||||
@ -269,7 +269,7 @@ int dev2unit(struct cdev *_dev);
|
||||
void dev_lock(void);
|
||||
void dev_unlock(void);
|
||||
int unit2minor(int _unit);
|
||||
int minor2unit(int _minor);
|
||||
u_int minor2unit(u_int _minor);
|
||||
void setconf(void);
|
||||
|
||||
void devfs_create(struct cdev *dev);
|
||||
|
Loading…
x
Reference in New Issue
Block a user