From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753096AbaKSMJu (ORCPT ); Wed, 19 Nov 2014 07:09:50 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:19364 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbaKSMJs (ORCPT ); Wed, 19 Nov 2014 07:09:48 -0500 Date: Wed, 19 Nov 2014 15:09:15 +0300 From: Dan Carpenter To: SF Markus Elfring Cc: Greg Kroah-Hartman , Len Brown , Pavel Machek , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: Re: [PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call "wakeup_source_unregister" Message-ID: <20141119120915.GM4905@mwanda> References: <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <546C7E75.9080301@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <546C7E75.9080301@users.sourceforge.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 19, 2014 at 12:26:45PM +0100, SF Markus Elfring wrote: > --- a/drivers/base/power/wakeup.c > +++ b/drivers/base/power/wakeup.c > @@ -267,8 +267,7 @@ int device_wakeup_disable(struct device *dev) > return -EINVAL; > > ws = device_wakeup_detach(dev); > - if (ws) > - wakeup_source_unregister(ws); > + wakeup_source_unregister(ws); In the original code, it's clear that the programmer thought about what happens when the device_wakeup_detach() returns NULL but in the new code that's not clear. I guess the information is still there in the git archive, but why hide the good code by covering it with confusing code? regards, dan carpenter From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Wed, 19 Nov 2014 12:09:15 +0000 Subject: Re: [PATCH 1/1] PM-wakeup: Deletion of an unnecessary check before the function call "wakeup_source_ Message-Id: <20141119120915.GM4905@mwanda> List-Id: References: <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <546C7E75.9080301@users.sourceforge.net> In-Reply-To: <546C7E75.9080301@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: SF Markus Elfring Cc: Greg Kroah-Hartman , Len Brown , Pavel Machek , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org, Julia Lawall On Wed, Nov 19, 2014 at 12:26:45PM +0100, SF Markus Elfring wrote: > --- a/drivers/base/power/wakeup.c > +++ b/drivers/base/power/wakeup.c > @@ -267,8 +267,7 @@ int device_wakeup_disable(struct device *dev) > return -EINVAL; > > ws = device_wakeup_detach(dev); > - if (ws) > - wakeup_source_unregister(ws); > + wakeup_source_unregister(ws); In the original code, it's clear that the programmer thought about what happens when the device_wakeup_detach() returns NULL but in the new code that's not clear. I guess the information is still there in the git archive, but why hide the good code by covering it with confusing code? regards, dan carpenter