Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754763AbbLJPTX (ORCPT ); Thu, 10 Dec 2015 10:19:23 -0500 Received: from smtp-out6.electric.net ([192.162.217.190]:55669 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754321AbbLJPTU convert rfc822-to-8bit (ORCPT ); Thu, 10 Dec 2015 10:19:20 -0500 From: David Laight To: "'Felipe Balbi'" , "Geyslan G. Bem" , "peter.senna@gmail.com" CC: "Geyslan G. Bem" , Greg Kroah-Hartman , Johan Hovold , Robert Baldyga , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] usb: remove redundant conditions Thread-Topic: [PATCH] usb: remove redundant conditions Thread-Index: AQHRM11c84mZInHYN0e3/vTOpT/H7p7EVMDQ Date: Thu, 10 Dec 2015 15:17:21 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CBEA973@AcuExch.aculab.com> References: <1449712366-31365-1-git-send-email-geyslan@gmail.com> <87twnqjpzy.fsf@saruman.tx.rr.com> In-Reply-To: <87twnqjpzy.fsf@saruman.tx.rr.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 820 Lines: 26 From: Felipe Balbi > Sent: 10 December 2015 15:14 > "Geyslan G. Bem" writes: > > > This patch removes redundant conditions. > > > > - (!A || (A && B)) is the same as (!A || B). > > - (length && length > 5) can be reduced to a single evaluation. > > > > Caught by: cppcheck > > > > Signed-off-by: Geyslan G. Bem > > --- > > I guess you didn't get previous comment in time; let's split this per > driver so different maintainers can pick their parts. I also suspect that gcc will optimise out the redundant checks as well. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/