lkml.org 
[lkml]   [2007]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: minor device number request for /dev/kvm (kernel-based virtual machine)

On Mar 1 2007 13:58, Avi Kivity wrote:
>
> fs/char_dev.c:
>> int register_chrdev(unsigned int major, const char *name,
>> const struct file_operations *fops)
>> {
>> struct char_device_struct *cd;
>> struct cdev *cdev;
>> char *s;
>> int err = -ENOMEM;
>>
>> cd = __register_chrdev_region(major, 0, 256, name);
>
> So misc minor numbers under 256 are not supported.
>
> What's the way out? Increase the region size? I don't know if that's safe.

If it does not increase memory usage, then possibly:

__register_chrdev_region(major, 0, (~0U) & MINORMASK, name);
or (1<<MINORMASK)-1 if that's more clear


Jan
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-01 14:07    [W:0.739 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site