From patchwork Tue Dec 31 16:33:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 3422171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ABB919F295 for ; Tue, 31 Dec 2013 16:58:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C01A12011E for ; Tue, 31 Dec 2013 16:58:53 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F20E2011D for ; Tue, 31 Dec 2013 16:58:52 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vy2Ky-0000Uy-CZ; Tue, 31 Dec 2013 16:38:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vy2K9-0003Ik-81; Tue, 31 Dec 2013 16:37:45 +0000 Received: from mail-we0-f175.google.com ([74.125.82.175]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vy2Ju-0003Gb-Ms for linux-arm-kernel@lists.infradead.org; Tue, 31 Dec 2013 16:37:32 +0000 Received: by mail-we0-f175.google.com with SMTP id t60so11275514wes.34 for ; Tue, 31 Dec 2013 08:37:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id; bh=lMnl3265rslmtPKbxkrgFWBIbyjwUrXtwuiSNURXzVA=; b=HvZbMfHwIKx7NRS/M5iYOnvCruaRy3BPc5SibHdw5IYYbCh6mvsJRCqteo3BCSQtlb zAbftESYTc/uBNjUsA1E+NU+6odMT39OdI+mZ/GQ1ubS4TrkgKF62AqJ2uwJ4rhGvTbk duTdNrR3Wg2kSuhP5TvZ2QAhQUZ1DVh9gSzVgB/B3PChtMUD3hnGYFNP6FB86TQSaXbG QdrdEkfp/UpbnjhlQYKmWLjdNiN8llSCqbTRYGf65k4CloGIqLEIGM6Tz0q4KA/eZMWG zNUk7+VeAPfvXGXhUGHariRBpDO8tTsML4T1GGA2ivxcIpkdTUr83jg4hEo4hVtEcpsg wy2w== X-Received: by 10.180.126.9 with SMTP id mu9mr49052881wib.14.1388507828826; Tue, 31 Dec 2013 08:37:08 -0800 (PST) Received: from stedf17-labo202.ds.jdsu.net. (4-161.80-90.static-ip.oleane.fr. [90.80.161.4]) by mx.google.com with ESMTPSA id cx3sm76145771wib.0.2013.12.31.08.37.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Dec 2013 08:37:08 -0800 (PST) From: jjhiblot@traphandler.com To: nicolas.ferre@atmel.com Subject: [PATCH] at91: ohci: fixed broken sanity check Date: Tue, 31 Dec 2013 17:33:44 +0100 Message-Id: <1388507624-10636-1-git-send-email-jjhiblot@traphandler.com> X-Mailer: git-send-email 1.8.4.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131231_113730_874108_8A063FFB X-CRM114-Status: GOOD ( 11.67 ) X-Spam-Score: -2.6 (--) Cc: jean-jacques hiblot , Jean-Jacques Hiblot , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: jean-jacques hiblot The test (pdev->resource[1].flags != IORESOURCE_IRQ) is broken because the flags value may contain not only the information IORESSOURCE_IRQ but also the IRQ type (IORESOURCE_IRQ_HIGHLEVEL for example). Signed-off-by: Jean-Jacques Hiblot --- drivers/usb/host/ohci-at91.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 418444e..df9c8a4 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -142,8 +142,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, return -ENODEV; } - if ((pdev->resource[0].flags != IORESOURCE_MEM) - || (pdev->resource[1].flags != IORESOURCE_IRQ)) { + if (!(pdev->resource[0].flags & IORESOURCE_MEM) + || !(pdev->resource[1].flags & IORESOURCE_IRQ)) { pr_debug("hcd probe: invalid resource type\n"); return -ENODEV; }