Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2484434ybx; Fri, 8 Nov 2019 05:05:29 -0800 (PST) X-Google-Smtp-Source: APXvYqwLMb9wULVQZjy/kOPhU7pXyPKtLhIN1SBfKDJwpaMswF77uEtwVGOa1qgfjytsQ2XR4dZr X-Received: by 2002:adf:f20d:: with SMTP id p13mr7905441wro.325.1573218329093; Fri, 08 Nov 2019 05:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573218329; cv=none; d=google.com; s=arc-20160816; b=Xi5eUyJ3XJcdcf+zDoylecjZgO5EeETqNdNJpuJpwXWEwRJKDeq4uZ8INQ4gZHGeO4 AHbl0T5gl9mI8EonNV/fX5rjWZuvs6kd0abJessEDlPfTgw1+/NVpp6j7DA/QdJD1U5G su+cQWsKneTcq5Zn1KuCkF7pFXtvdNmwLCLZlcFjmiMKmjRfCtMaVWOA/2c4Mp7hZFtb wbfW6aYKQQgrEhO/KZTNSyEyaQjQUsOcM48/cWJU9RQ6TGiDlDPyRKNVlAVLIzpVosIn 9HfS1naJ8AOFbvlOfZ2lZOWA+CXRVRlUQD0/Dp79NVDfCtoIxFmsNFdogisafhEW5uV7 S+QQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Rl5uwkPm7ODgb0mKXC73DMWhjRD0JTB3vFmrVrN5ZB0=; b=g+YdPAVK3rQZsdY1EfaUNloJhcuYx8915ba/amU5YEE66rff5b6cOp84/gvQcUKtZa LIUbvOwqPewTKyrYlve6wrAS9o8MPnAGgmACf4ygbbthokGFz+IpbDlKh+hp+UKbMYmk gJY07tlffVx86Qf1Nm4Je4a4bR/i2Bq9pmpL1F+eOCtlHGu4MG9oN9YXYIG9mQ5Wy4mX nnCvPcPJuOxnR7ZG4gJJw3SktLQ8NgmPccFbF1xOxVbBMqLyCCYjexR+BZWRsmGwpbwD Rh/mRnaUmKDTrKIbeteU4oXoW/fMrTyHLQXea2DmhCQd1NCHyD7Yers9N5hg31SvrEIK 6bAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=iVy3OBxW; 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 j52si4843861eda.438.2019.11.08.05.05.03; Fri, 08 Nov 2019 05:05:29 -0800 (PST) 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; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=iVy3OBxW; 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 S1731781AbfKHNDc (ORCPT + 99 others); Fri, 8 Nov 2019 08:03:32 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:42887 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730083AbfKHNCM (ORCPT ); Fri, 8 Nov 2019 08:02:12 -0500 Received: by mail-lj1-f195.google.com with SMTP id n5so6124257ljc.9 for ; Fri, 08 Nov 2019 05:02:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rl5uwkPm7ODgb0mKXC73DMWhjRD0JTB3vFmrVrN5ZB0=; b=iVy3OBxWjNuefDddBNbhbl7Cs/NtWVdjCC/od1h2NY+gSnjfqrNC9xMyzWE6JCHadL meWz1TdGa1kFUaFe1LBV/jM67MkOrHyRosHmDMbLKH/YlGIs4KIFUjA0IRlMr2sAmplm OZODn39ovzWFKJB/jcopkfA5Ou+HMW8/g56bE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rl5uwkPm7ODgb0mKXC73DMWhjRD0JTB3vFmrVrN5ZB0=; b=U66sjXOhtfZvy0FGBirt9bkHxkOPCmHijRfryCwGOqsdLZtmPvU8KTas9WbWwytcfN vZvX3NYta0dPExrs1C0xF1bkOg7/S2qoNK3VPoLd+tWdXDIV9qjw6WlvHUEwbCVn2dmO L45E7KmvnKiiOo1gQToFwPAFiQBzxkn+GoylaU+6K4DVT6WuP59SD94SuW632uxQuUzf isQl9d826K8fdwwPRzpvIEki4ic7WkxwtruAbhBRAvz2keUXpMKBOBOQ8K72VFCPrqoY Oicp+yG7frvuOI5TInzzJW54DnjXYcNyYRjOiYGV3HP/t/G8w/KFDk8L/nhbWMvTpVBH azzw== X-Gm-Message-State: APjAAAWuH+Ms1Txdp/q+3NBqic5ovtpowulxjYPFObf1/DNJL3mtwWkx G9/1dkL3joBG/4MrEQVg2Wq5tg== X-Received: by 2002:a05:651c:1124:: with SMTP id e4mr6831944ljo.52.1573218130055; Fri, 08 Nov 2019 05:02:10 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id d28sm2454725lfn.33.2019.11.08.05.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 05:02:09 -0800 (PST) From: Rasmus Villemoes To: Qiang Zhao , Li Yang , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Scott Wood , Rasmus Villemoes , linux-serial@vger.kernel.org Subject: [PATCH v4 33/47] serial: ucc_uart: access __be32 field using be32_to_cpu Date: Fri, 8 Nov 2019 14:01:09 +0100 Message-Id: <20191108130123.6839-34-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191108130123.6839-1-linux@rasmusvillemoes.dk> References: <20191108130123.6839-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The buf member of struct qe_bd is a __be32, so to make this work on little-endian hosts, use be32_to_cpu when reading it. Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index f5ea84928a3b..a5330582b610 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -343,7 +343,7 @@ static int qe_uart_tx_pump(struct uart_qe_port *qe_port) /* Pick next descriptor and fill from buffer */ bdp = qe_port->tx_cur; - p = qe2cpu_addr(bdp->buf, qe_port); + p = qe2cpu_addr(be32_to_cpu(bdp->buf), qe_port); *p++ = port->x_char; qe_iowrite16be(1, &bdp->length); @@ -371,7 +371,7 @@ static int qe_uart_tx_pump(struct uart_qe_port *qe_port) while (!(qe_ioread16be(&bdp->status) & BD_SC_READY) && (xmit->tail != xmit->head)) { count = 0; - p = qe2cpu_addr(bdp->buf, qe_port); + p = qe2cpu_addr(be32_to_cpu(bdp->buf), qe_port); while (count < qe_port->tx_fifosize) { *p++ = xmit->buf[xmit->tail]; xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); @@ -491,7 +491,7 @@ static void qe_uart_int_rx(struct uart_qe_port *qe_port) } /* get pointer */ - cp = qe2cpu_addr(bdp->buf, qe_port); + cp = qe2cpu_addr(be32_to_cpu(bdp->buf), qe_port); /* loop through the buffer */ while (i-- > 0) { -- 2.23.0