Commit 728774f7 authored by Mitchell Tasman's avatar Mitchell Tasman Committed by Greg Kroah-Hartman
Browse files

staging: vchiq_arm: cast with __force as needed



In several cases where a pointer marked as __user is
(intentionally) assigned or passed to a non-marked target,
cast to the target pointer type with a __force directive
to quiet warnings from sparse.

Signed-off-by: default avatarMitchell Tasman <tasman@leaflabs.com>
Link: https://lore.kernel.org/r/20200519004531.33158-1-tasman@leaflabs.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 49f09554
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -371,14 +371,15 @@ create_pagelist(char __user *buf, size_t count, unsigned short type)
	pagelistinfo->scatterlist = scatterlist;
	pagelistinfo->scatterlist_mapped = 0;

	if (is_vmalloc_addr(buf)) {
	if (is_vmalloc_addr((void __force *)buf)) {
		unsigned long length = count;
		unsigned int off = offset;

		for (actual_pages = 0; actual_pages < num_pages;
		     actual_pages++) {
			struct page *pg = vmalloc_to_page(buf + (actual_pages *
								 PAGE_SIZE));
			struct page *pg =
				vmalloc_to_page((void __force *)(buf +
						 (actual_pages * PAGE_SIZE)));
			size_t bytes = PAGE_SIZE - off;

			if (!pg) {
+3 −1
Original line number Diff line number Diff line
@@ -1209,7 +1209,9 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)

					/* The completion must point to the
					** msgbuf. */
					completion->header = msgbuf;
					completion->header =
						(struct vchiq_header __force *)
						msgbuf;
				}

				if ((completion->reason ==