From: linD026 <0086d026@email.ntou.edu.tw> Date: Mon, 13 Sep 2021 06:51:20 +0000 (+0800) Subject: ioctl.c: Remove unnecessary initialization X-Git-Tag: latest~103^2 X-Git-Url: https://www.ivnss.com/gitweb/?a=commitdiff_plain;h=fa035da36e5b8e24a740753f34d8ed1eb2adff95;p=lkmpg 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. --- diff --git a/examples/ioctl.c b/examples/ioctl.c index 23b7ebc..2288e33 100644 --- a/examples/ioctl.c +++ b/examples/ioctl.c @@ -149,7 +149,7 @@ static struct file_operations fops = { static int ioctl_init(void) { - dev_t dev = MKDEV(test_ioctl_major, 0); + dev_t dev; int alloc_ret = 0; int cdev_ret = 0; alloc_ret = alloc_chrdev_region(&dev, 0, num_of_dev, DRIVER_NAME);