Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6876004ybc; Thu, 28 Nov 2019 07:01:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxQfZnqMHVGkgDidqCvEG55oGcAWcUEa7Mok1/mqwBhd4E9jCmajUIwqiD5BqOAi1vF4Bcl X-Received: by 2002:a17:906:da1d:: with SMTP id fi29mr56406499ejb.26.1574953278794; Thu, 28 Nov 2019 07:01:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574953278; cv=none; d=google.com; s=arc-20160816; b=MVmA2E+IDwE//K0z3h4TDlvPtREKgkPMgRbZNNtVqLjJ2AullatIIAZ3Y6355A8HG7 al1vlDstTY0KQCcee4DIy4AxTA1AtxJiepZPUZBIuWslB9kagqcZwFVpBjHZIX48ox8m r+BclKND4tTHrW5GJVp1N+DiIvqe+ftNKhX9mBfSsta/UtRcVOs4y08MeNsaWprBYO4G 9Y8Z9N8NMc8SrBlAkWHxWk6OmYBQfDquv0BxgxjHC74b8jP0x7EKjhc8BO230y2o6TdG kMlXgOa1djOvlHeeIUPjNBQG7IG4XfLh7cQBLa80h4vrMWSRuAPeNeuC5tL7ZGrHkW5y YzEA== 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=0x5wbE3oWhrhZ8xGvXaAjigLpm6RmB7AlwGRCMNCtnI=; b=dANtpLDhabU3hF9TDBsJ8R86L2gWInvTLYJRxrs0fFFRPoNw/cxT3Ee+5PccMZ1MFf XLD8YAZSuEZa7Eh6YLx8yPYWJrd2b7FOzq/XsIL2rbTZ97jL9qkmLJLfQqk8R4L/tGGa jUb3Jx0tO+aaGcJg4THGCwoD6kAIohPAkqLD/6+0+yyHhO0RGhSk4LfrnagZUNMKtk2Z r3JLmsVQs75GwlVP3Rsn4H3zNlnKEs/hLsLqrldPIS33MlR75Gvbh+/NOkvYNNLNsBYX wTum1dfl86HEgI+llE2C9mrPYN+vTm5r/0m18srgxBU8BGIZgHlrM2c6BzujfrrsDzCQ EBQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=IG7ILqGG; 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 y12si11711574ejp.299.2019.11.28.07.00.52; Thu, 28 Nov 2019 07:01:18 -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=IG7ILqGG; 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 S1727533AbfK1O56 (ORCPT + 99 others); Thu, 28 Nov 2019 09:57:58 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:33991 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727493AbfK1O5x (ORCPT ); Thu, 28 Nov 2019 09:57:53 -0500 Received: by mail-lf1-f68.google.com with SMTP id l18so2230140lfc.1 for ; Thu, 28 Nov 2019 06:57:51 -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=0x5wbE3oWhrhZ8xGvXaAjigLpm6RmB7AlwGRCMNCtnI=; b=IG7ILqGGC9tpQ8FusycptMBnNxwJXMYm82mpACt/Psiu0vHUsWa927iCp7UiIH/rmb 9xQ2Zj7lLEDuHO/sqXD1kn010Uz5be6KX9wrm88JYO9gw2lgmO8Swi8EEXMC6ivXbyEl kpL465Jo/BdCLfZ4fsLJ9HDEhHnupdiLdWy8A= 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=0x5wbE3oWhrhZ8xGvXaAjigLpm6RmB7AlwGRCMNCtnI=; b=XJ9F0ngw3FbCg3IUSfxt7o8xpw7n3TIzUfvTS1UhCIjwd26EGqnRi3Z7c2v6VJpjAg /P6i+Arnw4Lu/GEWYxEtjZ5DopHtklgp3WWU2S1LwpdCxRsL5FBuuqmdNzLHhsGUUZBc oAoG1nJXRTFW4vr+0ls4U7KGrnh3htWjtWhxFayyB236polgtILgPd1s+OXOZQo60yVC PVe2gONLsk0fKusrl20pAF24owO0ko88YhA67VSZzb8j9R1jA3cW9OYhJmWtrf1LgPd/ yQ6jRH0B8ZZSZkiB6stvbK/r+M+rgUAt1tefkkMjTXJT2vEejWtqiYv7WOr4E7MlQSxg GhAw== X-Gm-Message-State: APjAAAUF/ePCFY4bzHYP9nUvjFNrEY1awK2fDytQSjxoxyTwuBKgQRa4 dojqhbURxlJhlbNMBcwvop8Jkg== X-Received: by 2002:a19:22cc:: with SMTP id i195mr32347477lfi.148.1574953070415; Thu, 28 Nov 2019 06:57:50 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id u2sm2456803lfl.18.2019.11.28.06.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 06:57:49 -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 , Timur Tabi , Rasmus Villemoes , linux-serial@vger.kernel.org Subject: [PATCH v6 34/49] serial: ucc_uart: access __be32 field using be32_to_cpu Date: Thu, 28 Nov 2019 15:55:39 +0100 Message-Id: <20191128145554.1297-35-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191128145554.1297-1-linux@rasmusvillemoes.dk> References: <20191128145554.1297-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. Reviewed-by: Timur Tabi Acked-by: Timur Tabi 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 9436b93d5cfa..afc2a5d69202 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