Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755283AbcJQNRh (ORCPT ); Mon, 17 Oct 2016 09:17:37 -0400 Received: from mail-qt0-f172.google.com ([209.85.216.172]:34885 "EHLO mail-qt0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755131AbcJQNQq (ORCPT ); Mon, 17 Oct 2016 09:16:46 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Johannes Thumshirn Date: Mon, 17 Oct 2016 15:16:44 +0200 Message-ID: Subject: Re: drivers/mcb/mcb-parse.c:152: bad if expression To: David Binderman Cc: "linux-kernel@vger.kernel.org" , Michael Moese Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u9HDHhO2002385 Content-Length: 493 Lines: 23 On Mon, Oct 17, 2016 at 1:17 PM, David Binderman wrote: > Hello there, > > drivers/mcb/mcb-parse.c:152:22: warning: logical ‘and’ of mutually exclusive tests is always false [-Wlogical-op] > > Source code is > > if (bar_count <= 0 && bar_count > CHAMELEON_BAR_MAX) > > Maybe better code > > if (bar_count <= 0 || bar_count > CHAMELEON_BAR_MAX) > > Regards > > David Binderman Hi David, Looks reasonable, care to send a patch? Thanks, Johannes