Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2519066imm; Mon, 24 Sep 2018 05:50:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV633861eQWQDMnCEl+54QGn8pF3sh1g+xWBLkAFR9Ul/X7yn1PAWZ+luYOS1hYdoJpuCbnPR X-Received: by 2002:a17:902:344:: with SMTP id 62-v6mr10711923pld.164.1537793417525; Mon, 24 Sep 2018 05:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537793417; cv=none; d=google.com; s=arc-20160816; b=oPt+71s3NF75pM2nDo+4/6OClmQNxI29X3khEUn7lRwk0Ex0wOF1RIMCXuW13ujaAl VAv5EM5H+0DLNCFj419+bjgZhwDOPrFuipOjmDUFI0tfkEH9V5KuxCRg+46lPG5KzBbb yayDpDXcCcJye+CqeS9lw5nd1tFSeGJ+cSvaFpZPQnNXXyGvAhKLXoLf4ViPPv4htdQ+ PkGRVn1cpdEXBimI9mqjJEeQmpuhjjKsRRXyp8DMIckuCaD/hhgKK9wlQ1xvuh6Z7hhu X9VpBjfCf7fGAPWe8kPHSEmoSvEedvUNNqk6Y+HmkVVJgfj3RmOf9Y9XcieluF2E2aLE NWzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=057JkGbYzucZ3Lx5AcHDKvEztDpDeCbKm1SBy+lFfko=; b=xOcofdfScXjlBprs3P/XsBgrQdELhynbcB4auZE5/bDzWLBqBldpU/8vNwRVZKcbbZ pRObHpD1RPdzxvRJD2pgA5DRR21Nq0uL8TJqfWTc5BwsMMZ34vs67GveVscRMtwBMgqd /gjFIWA+Pj1KtPucn6VEZ3y7X03coO9Z780/vFi0kpqlaP2qljw9EAKDqjOxIXJ/uJm9 gfUvGeq9hXYrySjUJkk0zby2xguuiThZ6Fcnrm7NmYCg0cbRmih3i1Z39yjE1aq/xGcR XQ/eAy1hoH2nf5plbvDVjJnUTjOAJvSXOKGmMUorzOGH2D820nA3KVjAa456UTIFOgTp lBtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m185-v6si7036687pgm.206.2018.09.24.05.50.02; Mon, 24 Sep 2018 05:50:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388629AbeIXSmd (ORCPT + 99 others); Mon, 24 Sep 2018 14:42:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59002 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388096AbeIXSmc (ORCPT ); Mon, 24 Sep 2018 14:42:32 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5031A109A; Mon, 24 Sep 2018 12:40:34 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Burton , Huacai Chen , James Hogan , Ralf Baechle , linux-mips@linux-mips.org, Sasha Levin Subject: [PATCH 4.18 160/235] MIPS: loongson64: cs5536: Fix PCI_OHCI_INT_REG reads Date: Mon, 24 Sep 2018 13:52:26 +0200 Message-Id: <20180924113121.162375180@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Burton [ Upstream commit cd87668d601f622e0ebcfea4f78d116d5f572f4d ] The PCI_OHCI_INT_REG case in pci_ohci_read_reg() contains the following if statement: if ((lo & 0x00000f00) == CS5536_USB_INTR) CS5536_USB_INTR expands to the constant 11, which gives us the following condition which can never evaluate true: if ((lo & 0xf00) == 11) At least when using GCC 8.1.0 this falls foul of the tautoligcal-compare warning, and since the code is built with the -Werror flag the build fails. Fix this by shifting lo right by 8 bits in order to match the corresponding PCI_OHCI_INT_REG case in pci_ohci_write_reg(). Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/19861/ Cc: Huacai Chen Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/mips/loongson64/common/cs5536/cs5536_ohci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/mips/loongson64/common/cs5536/cs5536_ohci.c +++ b/arch/mips/loongson64/common/cs5536/cs5536_ohci.c @@ -138,7 +138,7 @@ u32 pci_ohci_read_reg(int reg) break; case PCI_OHCI_INT_REG: _rdmsr(DIVIL_MSR_REG(PIC_YSEL_LOW), &hi, &lo); - if ((lo & 0x00000f00) == CS5536_USB_INTR) + if (((lo >> PIC_YSEL_LOW_USB_SHIFT) & 0xf) == CS5536_USB_INTR) conf_data = 1; break; default: