lkml.org 
[lkml]   [2015]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: unisys: handle major number properly
On Tue, Mar 24, 2015 at 11:32:47AM +0300, Dan Carpenter wrote:
<snip>
> > }
> > - rc = cdev_add(&file_cdev, MKDEV(MAJOR(majordev), 0), 1);
> > + rc = cdev_add(&file_cdev, MKDEV(major, 0), 1);
>
> This should just be:
>
> rc = cdev_add(&file_cdev, majordev, 1);
>
> So here is my suggestion:
>
> [patch 1] delete dead code I mentioned in my previous email.
> This deletes "registered" and the (MAJOR(majordev) >= 0) check.

that was initially my first patch.

>
> [patch 2] pass majordev to visorchipset_file_cleanup()
> This lets you delete the "majordev" global.
>
> [patch 3] small cleanup in visorchipset_file_init()
>
> - rc = cdev_add(&file_cdev, MKDEV(MAJOR(majordev), 0), 1);
> + rc = cdev_add(&file_cdev, majordev, 1);

and i can also include the removal of that global variable in this
3rd patch.
thanks.. after Greg's review i was thinking i understood the code wrong.
but then will this be a v2 or a whole new series?

regards
sudip

>
> There are several other ways you could break it up but do something like
> that.
>
> regards,
> dan carpenter
>


\
 
 \ /
  Last update: 2015-03-24 10:01    [W:0.066 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site