linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Stephen Warren <swarren@wwwdotorg.org>,
	Lee Jones <lee@kernel.org>,
	bcm-kernel-feedback-list@broadcom.com,
	Dom Cobley <popcornmix@gmail.com>, Eric Anholt <eric@anholt.net>
Subject: [PATCH 3/5] staging/vchi: Fix some pointer math for 64-bit.
Date: Mon, 17 Oct 2016 12:44:04 -0700	[thread overview]
Message-ID: <20161017194406.1080-4-eric@anholt.net> (raw)
In-Reply-To: <20161017194406.1080-1-eric@anholt.net>

These were throwing warnings on aarch64, and all are trivially
converted to longs.

Signed-off-by: Eric Anholt <eric@anholt.net>
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 6 +++---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c     | 5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
index c5255bc6c589..3c7165b34dab 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
@@ -121,7 +121,7 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
 		return -ENOMEM;
 	}
 
-	WARN_ON(((int)slot_mem & (PAGE_SIZE - 1)) != 0);
+	WARN_ON(((unsigned long)slot_mem & (PAGE_SIZE - 1)) != 0);
 
 	vchiq_slot_zero = vchiq_init_slots(slot_mem, slot_mem_size);
 	if (!vchiq_slot_zero)
@@ -222,7 +222,7 @@ remote_event_signal(REMOTE_EVENT_T *event)
 int
 vchiq_copy_from_user(void *dst, const void *src, int size)
 {
-	if ((uint32_t)src < TASK_SIZE) {
+	if ((unsigned long)src < TASK_SIZE) {
 		return copy_from_user(dst, src, size);
 	} else {
 		memcpy(dst, src, size);
@@ -375,7 +375,7 @@ create_pagelist(char __user *buf, size_t count, unsigned short type,
 	int run, addridx, actual_pages;
         unsigned long *need_release;
 
-	offset = (unsigned int)buf & (PAGE_SIZE - 1);
+	offset = (unsigned long)buf & (PAGE_SIZE - 1);
 	num_pages = (count + offset + PAGE_SIZE - 1) / PAGE_SIZE;
 
 	*ppagelist = NULL;
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index 93a6ac75791f..6862cbc0d7a9 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -1723,7 +1723,7 @@ parse_rx_slots(VCHIQ_STATE_T *state)
 					min(64, size));
 		}
 
-		if (((unsigned int)header & VCHIQ_SLOT_MASK) + calc_stride(size)
+		if (((unsigned long)header & VCHIQ_SLOT_MASK) + calc_stride(size)
 			> VCHIQ_SLOT_SIZE) {
 			vchiq_log_error(vchiq_core_log_level,
 				"header %p (msgid %x) - size %x too big for "
@@ -2268,7 +2268,8 @@ get_conn_state_name(VCHIQ_CONNSTATE_T conn_state)
 VCHIQ_SLOT_ZERO_T *
 vchiq_init_slots(void *mem_base, int mem_size)
 {
-	int mem_align = (VCHIQ_SLOT_SIZE - (int)mem_base) & VCHIQ_SLOT_MASK;
+	int mem_align = (VCHIQ_SLOT_SIZE -
+			 (unsigned long)mem_base) & VCHIQ_SLOT_MASK;
 	VCHIQ_SLOT_ZERO_T *slot_zero =
 		(VCHIQ_SLOT_ZERO_T *)((char *)mem_base + mem_align);
 	int num_slots = (mem_size - mem_align)/VCHIQ_SLOT_SIZE;
-- 
2.9.3

  parent reply	other threads:[~2016-10-17 19:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 19:44 [PATCH 0/5] staging/vchi: Start on 64-bit cleanup, TODO file Eric Anholt
2016-10-17 19:44 ` [PATCH 1/5] staging/vchi: Fix build error in debugfs ops on aarch64 Eric Anholt
2016-10-17 20:28   ` Greg Kroah-Hartman
2016-10-17 19:44 ` [PATCH 2/5] staging/vchi: Fix build warnings when formatting pointers " Eric Anholt
2016-10-17 20:28   ` Greg Kroah-Hartman
2016-10-17 23:38     ` Eric Anholt
2016-10-18  6:41       ` Greg Kroah-Hartman
2016-10-17 19:44 ` Eric Anholt [this message]
2016-10-25  7:55   ` [PATCH 3/5] staging/vchi: Fix some pointer math for 64-bit Greg Kroah-Hartman
2016-10-25 15:44     ` Eric Anholt
2016-10-17 19:44 ` [PATCH 4/5] staging/vchi: Add a TODO file of things I know we need to deal with Eric Anholt
2016-10-18 14:54   ` popcorn mix
2016-10-17 19:44 ` [PATCH 5/5] MAINTAINERS: Add the staging vchiq driver as a bcm2835 responsibility Eric Anholt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161017194406.1080-4-eric@anholt.net \
    --to=eric@anholt.net \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=popcornmix@gmail.com \
    --cc=swarren@wwwdotorg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).