Commit 25a6ca89 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] large dev_t - second series (5/15)

	cdevname() killed, there was only one remaining user
(tty_paranoia_check()) and in that case cdevname() was worse
than plain major:minor (basically, it's "you've got corrupted
inode that was supposed to belong to tty device; here's what
I'd found in ->i_rdev")
parent fee64f65
......@@ -181,17 +181,16 @@ inline int tty_paranoia_check(struct tty_struct *tty, struct inode *inode,
const char *routine)
{
#ifdef TTY_PARANOIA_CHECK
static const char badmagic[] = KERN_WARNING
"Warning: bad magic number for tty struct (%s) in %s\n";
static const char badtty[] = KERN_WARNING
"Warning: null TTY for (%s) in %s\n";
if (!tty) {
printk(badtty, cdevname(inode->i_rdev), routine);
printk(KERN_WARNING
"null TTY for (%d:%d) in %s\n",
imajor(inode), iminor(inode), routine);
return 1;
}
if (tty->magic != TTY_MAGIC) {
printk(badmagic, cdevname(inode->i_rdev), routine);
printk(KERN_WARNING
"bad magic number for tty struct (%d:%d) in %s\n",
imajor(inode), iminor(inode), routine);
return 1;
}
#endif
......
......@@ -328,27 +328,6 @@ struct file_operations def_chr_fops = {
.open = chrdev_open,
};
const char *cdevname(kdev_t dev)
{
static char buffer[40];
const char *name = "unknown-char";
unsigned int major = major(dev);
unsigned int minor = minor(dev);
int i = major_to_index(major);
struct char_device_struct *cd;
read_lock(&chrdevs_lock);
for (cd = chrdevs[i]; cd; cd = cd->next)
if (cd->major == major)
break;
if (cd)
name = cd->name;
sprintf(buffer, "%s(%d,%d)", name, major, minor);
read_unlock(&chrdevs_lock);
return buffer;
}
static struct kobject *exact_match(dev_t dev, int *part, void *data)
{
struct cdev *p = data;
......
......@@ -1156,7 +1156,6 @@ extern struct block_device *lookup_bdev(const char *);
extern struct block_device *open_bdev_excl(const char *, int, int, void *);
extern void close_bdev_excl(struct block_device *, int);
extern const char * cdevname(kdev_t);
extern void init_special_inode(struct inode *, umode_t, dev_t);
/* Invalid inode operations -- fs/bad_inode.c */
......
......@@ -511,7 +511,6 @@ EXPORT_SYMBOL(vsnprintf);
EXPORT_SYMBOL(vsscanf);
EXPORT_SYMBOL(__bdevname);
EXPORT_SYMBOL(bdevname);
EXPORT_SYMBOL(cdevname);
EXPORT_SYMBOL(simple_strtoull);
EXPORT_SYMBOL(simple_strtoul);
EXPORT_SYMBOL(simple_strtol);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment