Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754592AbbKFF0s (ORCPT ); Fri, 6 Nov 2015 00:26:48 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33860 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752660AbbKFF0q (ORCPT ); Fri, 6 Nov 2015 00:26:46 -0500 From: Ksenija Stanojevic To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Ksenija Stanojevic Subject: [PATCH] Staging: gdm72xx: Fix sparse warning Date: Thu, 5 Nov 2015 21:26:35 -0800 Message-Id: <1446787595-20309-1-git-send-email-ksenija.stanojevic@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3067 Lines: 92 Fix following sparse warnings by adding new structure for user-space data (struct data_us) in wm_ioctl.h: drivers/staging/gdm72xx/gdm_wimax.c:381:37: warning: incorrect type in argument 1 (different address spaces) drivers/staging/gdm72xx/gdm_wimax.c:381:37: expected void [noderef] *to drivers/staging/gdm72xx/gdm_wimax.c:381:37: got void *buf drivers/staging/gdm72xx/gdm_wimax.c:404:41: warning: incorrect type in argument 2 (different address spaces) drivers/staging/gdm72xx/gdm_wimax.c:404:41: expected void const [noderef] *from drivers/staging/gdm72xx/gdm_wimax.c:404:41: got void *buf Signed-off-by: Ksenija Stanojevic --- drivers/staging/gdm72xx/gdm_wimax.c | 8 ++++---- drivers/staging/gdm72xx/wm_ioctl.h | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index b8eea21..362a980 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -363,7 +363,7 @@ static void kdelete(void **buf) } } -static int gdm_wimax_ioctl_get_data(struct data_s *dst, struct data_s *src) +static int gdm_wimax_ioctl_get_data(struct data_us *dst, struct data_s *src) { int size; @@ -379,7 +379,7 @@ static int gdm_wimax_ioctl_get_data(struct data_s *dst, struct data_s *src) return 0; } -static int gdm_wimax_ioctl_set_data(struct data_s *dst, struct data_s *src) +static int gdm_wimax_ioctl_set_data(struct data_s *dst, struct data_us *src) { if (!src->size) { dst->size = 0; @@ -469,7 +469,7 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) } if (req->cmd == SIOCG_DATA) { ret = gdm_wimax_ioctl_get_data( - &req->data, &nic->sdk_data[req->data_id]); + &req->udata, &nic->sdk_data[req->data_id]); if (ret < 0) return ret; } else if (req->cmd == SIOCS_DATA) { @@ -481,7 +481,7 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) req->data.buf); } ret = gdm_wimax_ioctl_set_data( - &nic->sdk_data[req->data_id], &req->data); + &nic->sdk_data[req->data_id], &req->udata); if (ret < 0) return ret; } diff --git a/drivers/staging/gdm72xx/wm_ioctl.h b/drivers/staging/gdm72xx/wm_ioctl.h index ed8f649..066765d 100644 --- a/drivers/staging/gdm72xx/wm_ioctl.h +++ b/drivers/staging/gdm72xx/wm_ioctl.h @@ -78,6 +78,11 @@ struct data_s { void *buf; }; +struct data_us { + int size; + void __user *buf; +}; + struct wm_req_s { union { char ifrn_name[IFNAMSIZ]; @@ -85,6 +90,7 @@ struct wm_req_s { unsigned short cmd; unsigned short data_id; struct data_s data; + struct data_us udata; /* NOTE: sizeof(struct wm_req_s) must be less than sizeof(struct ifreq). */ }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/