Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4902776imm; Mon, 11 Jun 2018 22:21:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJUwV2dAD6jRmkLzk+x9WjgqvQCZPOyQihjXZLqLo4DjH5HD1WeMuGjTAmtuW9UGYHpJu4X X-Received: by 2002:a65:40c3:: with SMTP id u3-v6mr1930042pgp.252.1528780914658; Mon, 11 Jun 2018 22:21:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528780914; cv=none; d=google.com; s=arc-20160816; b=dw12ajELGnuGnjazDvKQA7QMCRdXM+GbX4JnzWMZd4tTQzWHc813Jj3VHUdtcBsAyp L3t2KPG7/4z6MwmdfEkptiR8fhxvzpyKlKBtWYZ1b/7brmJMxeQS/pQ2zHM4EXxv+oIl Z6Ibd1eXs3s6VUhq1SpdrbChqowGbzAkpkBl0yuCnMRgjIFacBebIw4gONd77ThPDgLd LdVtUcoYBuj8/oONF5LsHBapNzyqjmsuSXKB7R/ja9rVGYjkExGaX94Ujxdo/YLMy30I rkUc3z8R/uqhouzNPQ/WghYOv3LhvL+oiCz63FHLLgWD4HGaVbIxzTlccCkGSfLNFA4U 9dNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Zwkl6Paq6HuNlxGv30TGXuUK3d3ZzP8xRuZt+MUAC/A=; b=kobkg9kC18rEXj4PUXOZOrGi5Z1bZQGQgcDzccJQAJDMrKaV4ZhKwXIo+s1nYDmvCq cr2L1SR1lkLNUljd4+bo+E2mduBwPXc24dW6oTrtB9fDGUXCkEpDUqGnPjwQGBLcax5T jGSIhRYeNIII/CjW8tvQMzWXuH8RzgO24k2lKUmJw+8DyIa7tE4lbMMeW6F461jfZRZ7 adL6PeXfY6pRwaNac4ofgwa9fOiB3OFwIUrgeJ+pOUE/6gMZK+1Ng5aGlScqjBvgtxUK 6gUJpoYyr7lSRbNlU1G1LdXe5gUg1q/sWjYFVZTXUA+vXti41FpVcOEa9eUhdyzm6PiI KXIg== 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 b2-v6si20124pgc.569.2018.06.11.22.21.40; Mon, 11 Jun 2018 22:21:54 -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 S932530AbeFLFUE (ORCPT + 99 others); Tue, 12 Jun 2018 01:20:04 -0400 Received: from gate.crashing.org ([63.228.1.57]:51968 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932137AbeFLFUD (ORCPT ); Tue, 12 Jun 2018 01:20:03 -0400 Received: from pasglop.ozlabs.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w5C5JDa5008698; Tue, 12 Jun 2018 00:19:22 -0500 From: Benjamin Herrenschmidt To: openbmc@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Joel Stanley , Andrew Jeffery , Greg Kroah-Hartman , Benjamin Herrenschmidt Subject: [RFC PATCH 3/5] fsi/scom: Fixup endian annotations Date: Tue, 12 Jun 2018 15:19:09 +1000 Message-Id: <20180612051911.20690-4-benh@kernel.crashing.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180612051911.20690-1-benh@kernel.crashing.org> References: <20180612051911.20690-1-benh@kernel.crashing.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the proper annotated type __be32 and fixup the accessor used for get_scom() Signed-off-by: Benjamin Herrenschmidt --- drivers/fsi/fsi-scom.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c index 8a608db0aa07..6ddfb6021420 100644 --- a/drivers/fsi/fsi-scom.c +++ b/drivers/fsi/fsi-scom.c @@ -51,8 +51,8 @@ static DEFINE_IDA(scom_ida); static int put_scom(struct scom_device *scom_dev, uint64_t value, uint32_t addr) { + __be32 data; int rc; - uint32_t data; mutex_lock(&scom_dev->lock); @@ -79,7 +79,7 @@ static int put_scom(struct scom_device *scom_dev, uint64_t value, static int get_scom(struct scom_device *scom_dev, uint64_t *value, uint32_t addr) { - uint32_t result, data; + __be32 result, data; int rc; @@ -96,14 +96,13 @@ static int get_scom(struct scom_device *scom_dev, uint64_t *value, if (rc) goto bail; - *value |= (uint64_t)cpu_to_be32(result) << 32; + *value |= (uint64_t)be32_to_cpu(result) << 32; rc = fsi_device_read(scom_dev->fsi_dev, SCOM_DATA1_REG, &result, sizeof(uint32_t)); if (rc) goto bail; - *value |= cpu_to_be32(result); - + *value |= be32_to_cpu(result); bail: mutex_unlock(&scom_dev->lock); return rc; -- 2.17.0