Skip to content

Commit fa035da

Browse files
committed
ioctl.c: Remove unnecessary initialization
The "alloc_chrdev_region" function will dynamically choose the major number and store it at "dev". It is unnecessary to initialize the "dev" before the "alloc_chrdev_region" function.
1 parent 0a4aad9 commit fa035da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static struct file_operations fops = {
149149

150150
static int ioctl_init(void)
151151
{
152-
dev_t dev = MKDEV(test_ioctl_major, 0);
152+
dev_t dev;
153153
int alloc_ret = 0;
154154
int cdev_ret = 0;
155155
alloc_ret = alloc_chrdev_region(&dev, 0, num_of_dev, DRIVER_NAME);

0 commit comments

Comments
 (0)