From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754467AbbCLOW1 (ORCPT ); Thu, 12 Mar 2015 10:22:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37767 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753779AbbCLOW0 (ORCPT ); Thu, 12 Mar 2015 10:22:26 -0400 Date: Thu, 12 Mar 2015 15:22:22 +0100 From: Greg Kroah-Hartman To: Sudip Mukherjee Cc: Benjamin Romer , David Kershner , sparmaintainer@unisys.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] staging: unisys: remove comparison Message-ID: <20150312142222.GA19785@kroah.com> References: <1426169661-15142-1-git-send-email-sudipm.mukherjee@gmail.com> <1426169661-15142-2-git-send-email-sudipm.mukherjee@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426169661-15142-2-git-send-email-sudipm.mukherjee@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12, 2015 at 07:44:21PM +0530, Sudip Mukherjee wrote: > the macro comparison is always true as MAJOR is defined as > unsiged int. > > Signed-off-by: Sudip Mukherjee > --- > drivers/staging/unisys/visorchipset/file.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c > index 9ca7f1e..a1e8e79 100644 > --- a/drivers/staging/unisys/visorchipset/file.c > +++ b/drivers/staging/unisys/visorchipset/file.c > @@ -82,10 +82,8 @@ visorchipset_file_cleanup(void) > cdev_del(&file_cdev); > file_cdev.ops = NULL; > if (registered) { > - if (MAJOR(majordev) >= 0) { > - unregister_chrdev_region(majordev, 1); > - majordev = MKDEV(0, 0); > - } > + unregister_chrdev_region(majordev, 1); > + majordev = MKDEV(0, 0); If this is really true, then why is someone trying to assign -1 to majordev at the top of the file? :) I suggest you fix this up properly, not by papering over the bug. thanks, greg k-h