From patchwork Sun Jul 12 21:40:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 29713 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 103B0B6F35 for ; Mon, 13 Jul 2009 07:39:18 +1000 (EST) Received: by ozlabs.org (Postfix) id F21CDDDDFB; Mon, 13 Jul 2009 07:39:17 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 825EEDDDFA for ; Mon, 13 Jul 2009 07:39:17 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751129AbZGLVjM (ORCPT ); Sun, 12 Jul 2009 17:39:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751080AbZGLVjK (ORCPT ); Sun, 12 Jul 2009 17:39:10 -0400 Received: from mail-ew0-f226.google.com ([209.85.219.226]:34101 "EHLO mail-ew0-f226.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbZGLVjJ (ORCPT ); Sun, 12 Jul 2009 17:39:09 -0400 Received: by ewy26 with SMTP id 26so2186270ewy.37 for ; Sun, 12 Jul 2009 14:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=uxSicHo4BGJ0hyZIXmIRwdCDKDjNty4xt4ZoBOhAh04=; b=IvSaGJV60WKCdXrHggZdaYa/h7/BMyTkwSBk8gQJ8mEGoWcm3UDFJy5vRy61WItOnE jiUAJh/3ZAtuH5Je5g0cCQyqex+tfFZU3gerWs67mmOP6GfQJ7wfSW/4CUMKy2m3t+V7 ZEnlfF5lWfll8vE4l1r77BA34jTxrq/0+Z8Ok= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=kILFtaRmilHqE0MTZWR6WxchxFKp4v7tI3/FSx9KML8KGVERaqaNlrkXUwSnzTuBTw Z3DD6it9qPJSNseq+kvihOEUKGTxJQu/2xehdR6nJ8dTv/MMTaXwl+rohen2px2Uoycb E0BfX34u5ffj0L0+VhT5930xcJLlQ5N+70KWo= Received: by 10.210.88.3 with SMTP id l3mr4170700ebb.17.1247434747716; Sun, 12 Jul 2009 14:39:07 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 23sm19852eya.49.2009.07.12.14.39.06 (version=SSLv3 cipher=RC4-MD5); Sun, 12 Jul 2009 14:39:07 -0700 (PDT) Message-ID: <4A5A5852.4010901@gmail.com> Date: Sun, 12 Jul 2009 23:40:34 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: jcliburn@gmail.com CC: atl1-devel@lists.sourceforge.net, Andrew Morton , netdev Subject: [PATCH] atl1c: add missing parentheses Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Parentheses are required or the comparison occurs before the bitand. Signed-off-by: Roel Kluin --- #include int main() { printf("0 & 1 == 0: %u\n", 0 & 1 == 0); printf("1 & 1 == 0: %u\n", 1 & 1 == 0); printf("(0 & 1) == 0: %u\n", (0 & 1) == 0); printf("(1 & 1) == 0: %u\n", (1 & 1) == 0); return 0; } output: 0 & 1 == 0: 0 1 & 1 == 0: 0 (0 & 1) == 0: 1 (1 & 1) == 0: 0 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h index e1658ef..2a1120a 100644 --- a/drivers/net/atl1c/atl1c.h +++ b/drivers/net/atl1c/atl1c.h @@ -188,14 +188,14 @@ struct atl1c_tpd_ext_desc { #define RRS_HDS_TYPE_DATA 2 #define RRS_IS_NO_HDS_TYPE(flag) \ - (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == 0) + ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == 0) #define RRS_IS_HDS_HEAD(flag) \ - (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == \ + ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == \ RRS_HDS_TYPE_HEAD) #define RRS_IS_HDS_DATA(flag) \ - (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == \ + ((((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK) == \ RRS_HDS_TYPE_DATA) /* rrs word 3 bit 0:31 */ @@ -245,7 +245,7 @@ struct atl1c_tpd_ext_desc { #define RRS_PACKET_TYPE_802_3 1 #define RRS_PACKET_TYPE_ETH 0 #define RRS_PACKET_IS_ETH(word) \ - (((word) >> RRS_PACKET_TYPE_SHIFT) & RRS_PACKET_TYPE_MASK == \ + ((((word) >> RRS_PACKET_TYPE_SHIFT) & RRS_PACKET_TYPE_MASK) == \ RRS_PACKET_TYPE_ETH) #define RRS_RXD_IS_VALID(word) \ ((((word) >> RRS_RXD_UPDATED_SHIFT) & RRS_RXD_UPDATED_MASK) == 1)