From patchwork Sun Jul 1 09:05:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Miguel_Rodr=C3=ADguez_P=C3=A9rez?= X-Patchwork-Id: 10498573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F4041602D6 for ; Sun, 1 Jul 2018 09:06:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E34B228852 for ; Sun, 1 Jul 2018 09:06:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D654C28970; Sun, 1 Jul 2018 09:06:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78BBB28852 for ; Sun, 1 Jul 2018 09:06:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752069AbeGAJGU (ORCPT ); Sun, 1 Jul 2018 05:06:20 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:52138 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752040AbeGAJGS (ORCPT ); Sun, 1 Jul 2018 05:06:18 -0400 Received: by mail-wm0-f67.google.com with SMTP id w137-v6so6078600wmw.1 for ; Sun, 01 Jul 2018 02:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=det.uvigo.gal; s=clouddet; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3JdunhJS2lb4ip8/m1ZmV4DVNxbs1ggtzoKlwxeqhDw=; b=qLbfWuPkxlGkIvEXXyF2VvNp6eddbRdYbs/fT8g40ST+UtM1kUDQtxwxzXvKPuWxnt yhmi33svFJSkHzWl9qlOuCQLYEHWj9NXekUwVJXFavH4K6h4349gkMjF9/OLglYqsNrr yEHspVK4lBmvy+KKYwLY4sC5d9BbcVfbRjAV4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3JdunhJS2lb4ip8/m1ZmV4DVNxbs1ggtzoKlwxeqhDw=; b=uZxPdLnPld7Q/Oono5XAY7Vy0BHaLahQk2JcZPYbpGK8F76HvG3R/AjoqI5k6Dlqhz 9K5vFOwKRReam5VmzIvm8S26oHpPcF92NzsxFA5Ksr1DdmS/jChC3oM3yzvqGOx1ZwmP 4c7pUqWASEJaGCzRgUU3SH2h3giB1Qs9EKfaTIPUXBgByyNWjme1LGB/+ks/11MBWCzn 1OHNC081Fl+5FuSMiQpKAqkMLcND/80XD9DL+zc3aptcqF0a2wVKI+y6iCKsc1beH+Ms B8Nvc3r9Zh3snpq4mYISx5399JhyPKrTDw4A6u7FHPm8aIusuVaFEJXZHAyMpr400oll aflA== X-Gm-Message-State: APt69E17jIsbOAt0uDjzvCuRHOGgXnJRz9K6YFtR34XYWgDvpdDcPmY1 jUouNVgJilM5f4RKzKBqU0kjlg== X-Google-Smtp-Source: AAOMgpcHp1uwzK2NRDyHjgec0eyrh4uNEopKBlyITVb6MKFOnVar0r7nU5ded/u5iIsEwXKm7juJTg== X-Received: by 2002:a1c:8010:: with SMTP id b16-v6mr5968851wmd.9.1530435977510; Sun, 01 Jul 2018 02:06:17 -0700 (PDT) Received: from localhost.localdomain ([82.213.255.206]) by smtp.gmail.com with ESMTPSA id t11-v6sm2832270wro.53.2018.07.01.02.06.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jul 2018 02:06:16 -0700 (PDT) From: =?UTF-8?q?Miguel=20Rodr=C3=ADguez=20P=C3=A9rez?= To: oliver@neukum.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org, gregkh@linuxfoundation.org Cc: =?UTF-8?q?Miguel=20Rodr=C3=ADguez=20P=C3=A9rez?= Subject: [PATCH v3 1/4] Simplify usbnet_cdc_update_filter Date: Sun, 1 Jul 2018 11:05:50 +0200 Message-Id: <20180701090553.7776-2-miguel@det.uvigo.gal> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180701090553.7776-1-miguel@det.uvigo.gal> References: <20180701081550.GA7048@kroah.com> <20180701090553.7776-1-miguel@det.uvigo.gal> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove some unneded varibles to make the code easier to read and, replace the generic usb_control_msg function for the more specific usbnet_write_cmd. Signed-off-by: Miguel Rodríguez Pérez NACKED-BY: Oliver Neukum --- drivers/net/usb/cdc_ether.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 178b956501a7..815ed0dc18fe 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c @@ -77,9 +77,7 @@ static const u8 mbm_guid[16] = { static void usbnet_cdc_update_filter(struct usbnet *dev) { - struct cdc_state *info = (void *) &dev->data; - struct usb_interface *intf = info->control; - struct net_device *net = dev->net; + struct net_device *net = dev->net; u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED | USB_CDC_PACKET_TYPE_BROADCAST; @@ -93,16 +91,13 @@ static void usbnet_cdc_update_filter(struct usbnet *dev) if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) cdc_filter |= USB_CDC_PACKET_TYPE_ALL_MULTICAST; - usb_control_msg(dev->udev, - usb_sndctrlpipe(dev->udev, 0), + usbnet_write_cmd(dev, USB_CDC_SET_ETHERNET_PACKET_FILTER, - USB_TYPE_CLASS | USB_RECIP_INTERFACE, + USB_TYPE_CLASS | USB_DIR_OUT | USB_RECIP_INTERFACE, cdc_filter, - intf->cur_altsetting->desc.bInterfaceNumber, + dev->intf->cur_altsetting->desc.bInterfaceNumber, NULL, - 0, - USB_CTRL_SET_TIMEOUT - ); + 0); } /* probes control interface, claims data interface, collects the bulk