From patchwork Fri Nov 6 22:17:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 320864 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1674365ilc; Fri, 6 Nov 2020 14:18:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJztVXjM44DkS+MYGjI33oA/cBOrzoGlLMWVd7K07Np3VPvjk4mplGbaPPH2mk43JLTXfa0X X-Received: by 2002:a17:906:60c8:: with SMTP id f8mr4423795ejk.14.1604701101176; Fri, 06 Nov 2020 14:18:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604701101; cv=none; d=google.com; s=arc-20160816; b=CNOOse2jJOIUDGmwL8n6sljF/e3C9lgTG7jND5LmhCQ+5S2xAm/12hufRgHUCErPG3 EmYWbhN1Mt9pnGNCpF9mohGW/63mtqoia+gtgM/862OH6/F+ZnL3cQGQZvJoodOlTIEi RKBm0DPTEyxsFjRmE7ZU307VuAszavZKbzHK/Xjba8BjZxekGmHq1EoIh+W7bBlZBH2F lU8SsnZs00T30TWKSGkPXO7sfs++XnbKQWJ6ihG1DiikkBMCL4KvdYAYO1E+vcqD1TjE 9pz2k+hCl0JxrdEkha1+n2Bf5DADU51ZmUZZpCZvOelXDi2oKhfj/Ek8zC03aipsZp6V p3mQ== 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=wSCD4mBDNcNfMHCO05E1xdtmvyVdsxUf46MXY1CYUwE=; b=DFl1SmZPuUFhpD8PEKmRFjQ7iNDcRzLqYYT3HzD5LKW8aOLXVEMRnOlwfSnsOTc8dG YQQnTWc4kK+qpKGzzAhI7smk0RxYYxZmRycBE1GyrxIhL354WF55V8v3JUs6001zNHfO 84tG56eKWWWH1KILHe0aA1xD1cBe76TGFukGK+mNs9VGmQpGqDEc6GPFG4+YoX0yuceG L94NU8nSVGvQmtvBLOSep+F6SJQUXttKCClac7cScfcBr9JWsCmha5WyjAz6rnIUpgCd OYwsX8BBhcgxUQlhXZJa+5u6D5Ycg9M+zbe2IOIqkgOB/1EmBVFmMiqxk2KndLP5bvYO V1dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WYhuh1We; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 ci4si1848008ejb.436.2020.11.06.14.18.21; Fri, 06 Nov 2020 14:18:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=WYhuh1We; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S1728926AbgKFWSS (ORCPT + 2 others); Fri, 6 Nov 2020 17:18:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:41542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728915AbgKFWSP (ORCPT ); Fri, 6 Nov 2020 17:18:15 -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 48D73208C7; Fri, 6 Nov 2020 22:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604701094; bh=0nZsvJC7bKvsWii/4F8rVLDyxbI5Zs8ZxzeJcfM4j+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WYhuh1WeMtLDKBKefKeaic5NUOJzadJ53FzEB2UQXzCEHinw7qCsI6CYtNMqeEdoy 6S+yFjM7lHpx1DLzo4Uj1ON7HLGgFJLCfQxucvGzoWLz9fYorSMk3baiAp5pVpG2hb Zn0EDsMTOs9P9nrFdTdwsyIEN5Us7lupQKr+BlvM= 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 07/28] phonet: use siocdevprivate Date: Fri, 6 Nov 2020 23:17:22 +0100 Message-Id: <20201106221743.3271965-8-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: linux-wireless@vger.kernel.org From: Arnd Bergmann phonet has a single private ioctl that is broken in compat mode on big-endian machines today because the data returned from it is never copied back to user space. Move it over to the ndo_siocdevprivate callback, which also fixes the compat issue. Signed-off-by: Arnd Bergmann --- drivers/net/usb/cdc-phonet.c | 5 +++-- net/phonet/pn_dev.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) -- 2.27.0 diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index dba847f28096..5f6d34acf871 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c @@ -253,7 +253,8 @@ static int usbpn_close(struct net_device *dev) return usb_set_interface(pnd->usb, num, !pnd->active_setting); } -static int usbpn_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) +static int usbpn_siocdevprivate(struct net_device *dev, struct ifreq *ifr, + void __user *data, int cmd) { struct if_phonet_req *req = (struct if_phonet_req *)ifr; @@ -269,7 +270,7 @@ static const struct net_device_ops usbpn_ops = { .ndo_open = usbpn_open, .ndo_stop = usbpn_close, .ndo_start_xmit = usbpn_xmit, - .ndo_do_ioctl = usbpn_ioctl, + .ndo_siocdevprivate = usbpn_siocdevprivate, }; static void usbpn_setup(struct net_device *dev) diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index ac0fae06cc15..876d0ae5f9fd 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c @@ -233,11 +233,11 @@ static int phonet_device_autoconf(struct net_device *dev) struct if_phonet_req req; int ret; - if (!dev->netdev_ops->ndo_do_ioctl) + if (!dev->netdev_ops->ndo_siocdevprivate) return -EOPNOTSUPP; - ret = dev->netdev_ops->ndo_do_ioctl(dev, (struct ifreq *)&req, - SIOCPNGAUTOCONF); + ret = dev->netdev_ops->ndo_siocdevprivate(dev, (struct ifreq *)&req, + NULL, SIOCPNGAUTOCONF); if (ret < 0) return ret;