From patchwork Fri Nov 6 22:17:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 320874 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1674795ilc; Fri, 6 Nov 2020 14:19:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFRoEyNV09MpvQfpwZf8QbdvfI3U+YmIzW4Evi6uv4WCryTqLHz/5Qcnt9x+7V7iRqtnTl X-Received: by 2002:a05:6402:22c6:: with SMTP id dm6mr4391176edb.139.1604701151836; Fri, 06 Nov 2020 14:19:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604701151; cv=none; d=google.com; s=arc-20160816; b=zaHSwdaLxycw3sdc1WFW19Ogar0xPA5ibGNddPo1zdgv9G1lq89FXlhs4j8vP+agny RKpbzqtabutZLfOKYCF4LHP4lhHYYzHWnrQx1dTao0wh1A+99pMr46NRjPcsLKkiA7zO OfcALHlwhMBn3MD5J6b6Hr5XayYqwyj0zYILQF0Q5aEcYasNgeqLXCzqAvRl4hXXKfde Y+zBW+CimFyw1hwQ+llHy2jqRyE5iT3BXXHoZw8JCXMArxSILDIb1Ojo8+9yznJNcgXV 6egFSz5WcRBRiVYvabckrezh8JcfHlW59/FLzkRsWIyWRg8IfpfU+ORwBle2S08+AGIH kvig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EuNZyymGvNPFVGy7ePkpGwjRmGNOf/hcO3Lvc62s74s=; b=u2CM7LKUJHaloFH52BE7voc8rSZxBiUgjSX+OhF8y3YKklB5/ZqCk0ghOX9m5EgMU2 1EnCSZHhG8LDvFIX/vfhZuQ55RdpvXGqUtdTHve1XlzbmywUPEXI1Y5Ajcqv5muPheDb ioRADUXPT5C63KbABuCfOr9uVOcb0XlbFrhA6cL+QiS4KklLZASSf9AIornCtAhxW74E sTkG/v4ah0UX3PcQvGPL8fbn+FyJEmVz15ODlosQCnJIFVJnbUJStfqkNqHjBdHWjQHn 1hLoYuJkgIqkBJ6HFJvGrq9Fq9S9OB+5yKDlr2QsSGHCwcoOKhx9ILrRrWLwfPyGjpGL hJvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wMqT8C9u; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si1809018ejd.562.2020.11.06.14.19.11; Fri, 06 Nov 2020 14:19:11 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wMqT8C9u; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729208AbgKFWTK (ORCPT + 8 others); Fri, 6 Nov 2020 17:19:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:42630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728777AbgKFWTH (ORCPT ); Fri, 6 Nov 2020 17:19:07 -0500 Received: from localhost.localdomain (HSI-KBW-46-223-126-90.hsi.kabel-badenwuerttemberg.de [46.223.126.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A418622210; Fri, 6 Nov 2020 22:19:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604701146; bh=MjZ6JfjGRVgBd55ipGAv3Zcz8oLtgmjGkuSG0Rxyjz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wMqT8C9uy6qGHxU1Qp1fwrtcZ9p6bEcCt4HI7Dfmu5jo86nRThpzE3q95C5D4JpRc JI7lD6SC82rg4RcZajbLMi4kpkHV1Alm05o4C6JeGhhc545yyWtnwrYG+H1GC9e2/Q nXXm4GwwNhJSzHvX5/6hjmVd1DLfTKpwY+2qUO0o= From: Arnd Bergmann To: netdev@vger.kernel.org Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, bridge@lists.linux-foundation.org, linux-hams@vger.kernel.org, Jakub Kicinski , Christoph Hellwig , Alexander Viro , Johannes Berg , Andrew Lunn , Heiner Kallweit Subject: [RFC net-next 25/28] hippi: use ndo_siocdevprivate Date: Fri, 6 Nov 2020 23:17:40 +0100 Message-Id: <20201106221743.3271965-26-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201106221743.3271965-1-arnd@kernel.org> References: <20201106221743.3271965-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Arnd Bergmann The rr_ioctl uses private ioctl commands that correctly pass all data through ifr_data, which works fine in compat mode. Change it to use ndo_siocdevprivate as a cleanup. Signed-off-by: Arnd Bergmann --- drivers/net/hippi/rrunner.c | 11 ++++++----- drivers/net/hippi/rrunner.h | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) -- 2.27.0 diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c index 22010384c4a3..7661dbb31162 100644 --- a/drivers/net/hippi/rrunner.c +++ b/drivers/net/hippi/rrunner.c @@ -63,7 +63,7 @@ static const char version[] = static const struct net_device_ops rr_netdev_ops = { .ndo_open = rr_open, .ndo_stop = rr_close, - .ndo_do_ioctl = rr_ioctl, + .ndo_siocdevprivate = rr_siocdevprivate, .ndo_start_xmit = rr_start_xmit, .ndo_set_mac_address = hippi_mac_addr, }; @@ -1568,7 +1568,8 @@ static int rr_load_firmware(struct net_device *dev) } -static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) +static int rr_siocdevprivate(struct net_device *dev, struct ifreq *rq, + void __user *data, int cmd) { struct rr_private *rrpriv; unsigned char *image, *oldimage; @@ -1603,7 +1604,7 @@ static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) error = -EFAULT; goto gf_out; } - error = copy_to_user(rq->ifr_data, image, EEPROM_BYTES); + error = copy_to_user(data, image, EEPROM_BYTES); if (error) error = -EFAULT; gf_out: @@ -1615,7 +1616,7 @@ static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) return -EPERM; } - image = memdup_user(rq->ifr_data, EEPROM_BYTES); + image = memdup_user(data, EEPROM_BYTES); if (IS_ERR(image)) return PTR_ERR(image); @@ -1658,7 +1659,7 @@ static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) return error; case SIOCRRID: - return put_user(0x52523032, (int __user *)rq->ifr_data); + return put_user(0x52523032, (int __user *)data); default: return error; } diff --git a/drivers/net/hippi/rrunner.h b/drivers/net/hippi/rrunner.h index 87533784604f..55377614e752 100644 --- a/drivers/net/hippi/rrunner.h +++ b/drivers/net/hippi/rrunner.h @@ -835,7 +835,8 @@ static int rr_open(struct net_device *dev); static netdev_tx_t rr_start_xmit(struct sk_buff *skb, struct net_device *dev); static int rr_close(struct net_device *dev); -static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); +static int rr_siocdevprivate(struct net_device *dev, struct ifreq *rq, + void __user *data, int cmd); static unsigned int rr_read_eeprom(struct rr_private *rrpriv, unsigned long offset, unsigned char *buf,