From patchwork Fri Mar 1 18:39:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 1050342 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=codethink.co.uk Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 449yrq5Plwz9s5c for ; Sat, 2 Mar 2019 05:39:55 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728295AbfCASju (ORCPT ); Fri, 1 Mar 2019 13:39:50 -0500 Received: from imap1.codethink.co.uk ([176.9.8.82]:40733 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726195AbfCASju (ORCPT ); Fri, 1 Mar 2019 13:39:50 -0500 Received: from [167.98.27.226] (helo=rainbowdash.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1gzn4U-0007U3-DS; Fri, 01 Mar 2019 18:39:46 +0000 Received: from ben by rainbowdash.codethink.co.uk with local (Exim 4.92-RC6) (envelope-from ) id 1gzn4T-0001di-MV; Fri, 01 Mar 2019 18:39:45 +0000 From: Ben Dooks To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "David S . Miller" , linux-kernel@lists.codethink.co.uk, Ben Dooks Subject: [PATCH] net: fixup address-space warnings in compat_mc_{get, set}sockopt() Date: Fri, 1 Mar 2019 18:39:44 +0000 Message-Id: <20190301183944.6260-1-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add __user attributes in some of the casts in this function to avoid the following sparse warnings: net/compat.c:592:57: warning: cast removes address space of expression net/compat.c:592:57: warning: incorrect type in initializer (different address spaces) net/compat.c:592:57: expected struct compat_group_req [noderef] *gr32 net/compat.c:592:57: got void * net/compat.c:613:65: warning: cast removes address space of expression net/compat.c:613:65: warning: incorrect type in initializer (different address spaces) net/compat.c:613:65: expected struct compat_group_source_req [noderef] *gsr32 net/compat.c:613:65: got void * net/compat.c:634:60: warning: cast removes address space of expression net/compat.c:634:60: warning: incorrect type in initializer (different address spaces) net/compat.c:634:60: expected struct compat_group_filter [noderef] *gf32 net/compat.c:634:60: got void * net/compat.c:672:52: warning: cast removes address space of expression net/compat.c:672:52: warning: incorrect type in initializer (different address spaces) net/compat.c:672:52: expected struct compat_group_filter [noderef] *gf32 net/compat.c:672:52: got void * Signed-off-by: Ben Dooks --- net/compat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/compat.c b/net/compat.c index 3d348198004f..8c8c57d814af 100644 --- a/net/compat.c +++ b/net/compat.c @@ -589,7 +589,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname, case MCAST_JOIN_GROUP: case MCAST_LEAVE_GROUP: { - struct compat_group_req __user *gr32 = (void *)optval; + struct compat_group_req __user *gr32 = (void __user *)optval; struct group_req __user *kgr = compat_alloc_user_space(sizeof(struct group_req)); u32 interface; @@ -610,7 +610,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname, case MCAST_BLOCK_SOURCE: case MCAST_UNBLOCK_SOURCE: { - struct compat_group_source_req __user *gsr32 = (void *)optval; + struct compat_group_source_req __user *gsr32 = (void __user *)optval; struct group_source_req __user *kgsr = compat_alloc_user_space( sizeof(struct group_source_req)); u32 interface; @@ -631,7 +631,7 @@ int compat_mc_setsockopt(struct sock *sock, int level, int optname, } case MCAST_MSFILTER: { - struct compat_group_filter __user *gf32 = (void *)optval; + struct compat_group_filter __user *gf32 = (void __user *)optval; struct group_filter __user *kgf; u32 interface, fmode, numsrc; @@ -669,7 +669,7 @@ int compat_mc_getsockopt(struct sock *sock, int level, int optname, char __user *optval, int __user *optlen, int (*getsockopt)(struct sock *, int, int, char __user *, int __user *)) { - struct compat_group_filter __user *gf32 = (void *)optval; + struct compat_group_filter __user *gf32 = (void __user *)optval; struct group_filter __user *kgf; int __user *koptlen; u32 interface, fmode, numsrc;