From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30240C433E7 for ; Thu, 3 Sep 2020 06:40:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09C6C206EB for ; Thu, 3 Sep 2020 06:40:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727866AbgICGki (ORCPT ); Thu, 3 Sep 2020 02:40:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:55582 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbgICGkh (ORCPT ); Thu, 3 Sep 2020 02:40:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 225EBAC1F; Thu, 3 Sep 2020 06:40:37 +0000 (UTC) Date: Thu, 03 Sep 2020 08:40:34 +0200 Message-ID: From: Takashi Iwai To: Alan Stern Cc: Greg Kroah-Hartman , himadrispandya@gmail.com, dvyukov@google.com, linux-usb@vger.kernel.org, perex@perex.cz, tiwai@suse.com, linux-kernel@vger.kernel.org, marcel@holtmann.org, johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org, alsa-devel@alsa-project.org, "Gustavo A. R. Silva" , Eli Billauer , Emiliano Ingrassia , Alexander Tsoy , "Geoffrey D. Bennett" , Jussi Laako , Nick Kossifidis , Dmitry Panchenko , Chris Wulff , Jesus Ramos Subject: Re: [PATCH 01/10] USB: move snd_usb_pipe_sanity_check into the USB core In-Reply-To: <20200903004553.GA642955@rowland.harvard.edu> References: <20200902110115.1994491-1-gregkh@linuxfoundation.org> <20200902110115.1994491-2-gregkh@linuxfoundation.org> <20200903004553.GA642955@rowland.harvard.edu> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 03 Sep 2020 02:45:53 +0200, Alan Stern wrote: > > In a few places here this check is completely unnecessary. All it does > is verify that the device does have an endpoint 0 and the the type of > the endpoint matches the type of the pipe. Well, every USB device > always has an endpoint 0, and it is always a bidirectional control > endpoint. Therefore a simple static check is all you need: There's no > point calling usb_pipe_type_check() when the pipe is of the form > usb_{snd|rcv}ctrlpipe(dev, 0). > > In short, this check should be removed completely; it does nothing. Fair enough, but I think those removals should be in another patch. thanks, Takashi