From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752207AbbCXI5x (ORCPT ); Tue, 24 Mar 2015 04:57:53 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:29687 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751864AbbCXI5s (ORCPT ); Tue, 24 Mar 2015 04:57:48 -0400 Date: Tue, 24 Mar 2015 11:57:50 +0300 From: Dan Carpenter To: Sudip Mukherjee Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , sparmaintainer@unisys.com, linux-kernel@vger.kernel.org, Benjamin Romer , David Kershner Subject: Re: [PATCH] staging: unisys: handle major number properly Message-ID: <20150324085750.GQ10964@mwanda> References: <1426604484-7770-1-git-send-email-sudipm.mukherjee@gmail.com> <20150324083247.GP10964@mwanda> <20150324084316.GA7113@sudip-PC> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150324084316.GA7113@sudip-PC> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2015 at 02:13:16PM +0530, Sudip Mukherjee wrote: > On Tue, Mar 24, 2015 at 11:32:47AM +0300, Dan Carpenter wrote: > > > > } > > > - 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. Yes, but the patch description wasn't clear. You were talking saying the condition was always true because of the types and I am saying the condition is always true because of the order the functions are called. > > > > > [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? I'm pretty sure we're up to v3 at least now. This means redoing the whole series, yes. regards, dan carpenter