From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754005Ab1LMAO3 (ORCPT ); Mon, 12 Dec 2011 19:14:29 -0500 Received: from perches-mx.perches.com ([206.117.179.246]:47284 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752764Ab1LMAO1 (ORCPT ); Mon, 12 Dec 2011 19:14:27 -0500 Message-ID: <1323735263.3837.13.camel@joe2Laptop> Subject: drivers/dma/sirf-dma.c: boolean and / or confusion From: Joe Perches To: roel , Barry Song Cc: Andrew Morton , LKML , linux-arm-kernel Date: Mon, 12 Dec 2011 16:14:23 -0800 In-Reply-To: <4EE688FC.8090606@gmail.com> References: <4EE688FC.8090606@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.1- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2011-12-13 at 00:06 +0100, roel wrote: > The test not [val1] or not [val2] always evaluates to true Looking at drivers with: $ grep -rP --include=*.[ch] "(\b[\w\[\]\>\._\-]+)\s*\!\=\s*[\w\[\]\>\._\-]+\s*\)\s*\|\|\s*\(\s*\1\s*\!\=" drivers drivers/dma/sirf-dma.c: if ((xt->dir != DMA_MEM_TO_DEV) || (xt->dir != DMA_DEV_TO_MEM)) { Likely the || should be &&