Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp706707ybl; Wed, 4 Dec 2019 09:32:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxnxrOC1Q9lnlUe3d2aqgUR7x+Xodh8w95ZppuOJo9EH8HA1CuMUjTh2cL/8Ju/9CvhhYVe X-Received: by 2002:a05:6830:1e69:: with SMTP id m9mr3288987otr.335.1575480768455; Wed, 04 Dec 2019 09:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575480768; cv=none; d=google.com; s=arc-20160816; b=C4ZNX/pJiqf2CUapyppowC9rQfOwO+ozOUf82irr7HeT/hq+E4RiJWUndVL6GGlX7S Sqch1XkkZKBTqw9hXs4oUNkIafWbOjCFQW9YZlax+4VhhxNFVhQ4H9kG0DWA8djFCw4s Zvbw3+AIVPY2GVxmV0NBJWFeTsyYYwZCpaSFECCj2eYA5PmpmIdtP7Je4/jyEZRZPYPY DYkC1SjoNJlc6OQ8OMcmc1Agsh6huzDDJAM2G2l5BSAnfjzw0Z0IjiAMgtAl5xhXOSnE lrhbhhIaiGwuq4aSdmxpOtxWYWUhu8CEgEYcRm+0riz6W+hXfYd06Oar8vODtwUeiYWm iC4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=BZ/LN2myMK7uAXPqjCUJES322AMnZB2HLbeBgWEgDqg=; b=JJTkJ9SRLvvyr4FShlK8nQKvAARXffPMdVvkMu33ID/vsN8aT6oB0/W+1c+AejxGUz NGmU/fDKLmmGId1t+srKZw6MQ5gKpvuHfsdF81mX3eGdRvTljcjS4T4NOjGnIVlS+FDx fXrDurf48EFzCB472zcDISyPlE5bdxNh9TuTXA/rjJCacG6vsjdcvi7omBc7pHJUrDKl cEpPWxrNEINDIHJBHOutUW/FHOyYWWN2LDyJG3qz4Q5GVsjr9WC59ivfopKecl4GAK26 4irJK2IUdjvMUmEmjpSSci00bHeHOamCfhm0B79HnpxEEOtVTeWn1VG8YrsGLh0+ISOO n5uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I5ixV79z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si3632765otq.203.2019.12.04.09.32.32; Wed, 04 Dec 2019 09:32:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I5ixV79z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728177AbfLDRUp (ORCPT + 99 others); Wed, 4 Dec 2019 12:20:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:57528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbfLDRUp (ORCPT ); Wed, 4 Dec 2019 12:20:45 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 151AE2073B; Wed, 4 Dec 2019 17:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575480044; bh=iyZ31RokaK9HqqTas5TQ6lejfCHAxfMdVNWvMvM3gBo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I5ixV79zgSpbVPSPudnWPUjOCx+UOm+86UA9236pLcnn6/ZY7DC0xB7rOEbMuarQc PekbEPUsX0kQR1Ch49FnH7uc8T9a5+q8v4p36C59Zj2sH6tJICPJWV3N6+tCaOHqa+ NeiDE/gAoi8TziYReOit3m/hnd+68q7PA0UJvMgw= Date: Wed, 4 Dec 2019 18:20:42 +0100 From: Greg KH To: "Enrico Weigelt, metux IT consult" Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH] usb: make usb_interrupt_msg() a static inline Message-ID: <20191204172042.GE3627415@kroah.com> References: <20191204143035.31751-1-info@metux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191204143035.31751-1-info@metux.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 04, 2019 at 03:30:35PM +0100, Enrico Weigelt, metux IT consult wrote: > usb_interrupt_msg() effectively is just an alias for usb_bulk_msg(), > no need for being an real function, thus converting it to an > inline function. Why? What did you just save/help with here? This actually made the code worse: > /** > - * usb_interrupt_msg - Builds an interrupt urb, sends it off and waits for completion > - * @usb_dev: pointer to the usb device to send the message to > - * @pipe: endpoint "pipe" to send the message to > - * @data: pointer to the data to send > - * @len: length in bytes of the data to send > - * @actual_length: pointer to a location to put the actual length transferred > - * in bytes > - * @timeout: time in msecs to wait for the message to complete before > - * timing out (if 0 the wait is forever) > - * > - * Context: !in_interrupt () > - * > - * This function sends a simple interrupt message to a specified endpoint and > - * waits for the message to complete, or timeout. > - * > - * Don't use this function from within an interrupt context. If you need > - * an asynchronous message, or need to send a message from within interrupt > - * context, use usb_submit_urb() If a thread in your driver uses this call, > - * make sure your disconnect() method can wait for it to complete. Since you > - * don't have a handle on the URB used, you can't cancel the request. > - * > - * Return: > - * If successful, 0. Otherwise a negative error number. The number of actual > - * bytes transferred will be stored in the @actual_length parameter. > - */ > -int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe, > - void *data, int len, int *actual_length, int timeout) > -{ > - return usb_bulk_msg(usb_dev, pipe, data, len, actual_length, timeout); > -} > -EXPORT_SYMBOL_GPL(usb_interrupt_msg); You now lost all of that wonderful documentation on how to use this function, makeing the kernel harder to use instead of easier. So this is a net-loss overall, ick, why??? greg k-h