Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp430636pxu; Fri, 4 Dec 2020 06:49:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeMF4bEL5K8/DmYWL+hynRVhz6N5iw1x6tWjfc7du4+UnPUBUqtv1HYsnvGOwgrO1a2N/2 X-Received: by 2002:a17:906:c007:: with SMTP id e7mr7251578ejz.511.1607093388073; Fri, 04 Dec 2020 06:49:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607093388; cv=none; d=google.com; s=arc-20160816; b=Aa4P6WxYK3lkQhif8eM8Q8lOYs7ClcejSZbWBtWmnNNZWSqTByQyQZ8r7I5nQ269YL DMbfcQP4PInp5+ooD5ZWj4RixoOo0H5Hw+MeUP1U63wMruIrxLAHKu5DucI6UTmWUWVL WFjRfqEWHcECW3nO1zKiUVFkHxcgl0dUULroX86n7MmubL3ZjF6qw8noJx32cLg/KQzl LwUOKLfVFQr9GUzRk6X1+ZKamULCw7Fl6DcdPxpLfhZNhPnZUpM0wBcamS/NFIhfrE5R 1/UMMYlw6nr+hb/y5fQnNlhKWvGameB1PmPpMlvY0uoj1fqqAtrhVzqda8Jx450JoIxP gOfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=YuN8v+wl7n8X6ofmOSfbc2YBxTt+XcxIQ84FcqRFIhU=; b=ogZbWBWqPQ1m6O/LspljiCrfAaw8yrI2rE2cZ4j5S/6YffrqfaryHJydd91B6q5MLd Inx6yzjx2+IStVOkUrUI/NsryHwqJmMjsbaFx57zXh2rDLpp0eIykc7y08Gyr7j3FAuC 9/yXxEroCDsl6I3cayGuQkvd/JV1W7iajz0euqCQWrGbb2tJI9Ykpg3P3Qy/2K4iK1S4 xUqRYfSiXxRSZn6HdqM3UHN1srqBB38sJeX0jWdvxguPiwe3DRcEq0DiU6Ewl83TWBo4 j1txPI5DssZekXLH6/y6zYCXsv/5vFwg+FrKHXCuZFJzft8aYrejQXiMHeGvnJWmbhnN 3gVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 p16si1412469ejo.364.2020.12.04.06.49.23; Fri, 04 Dec 2020 06:49:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1730337AbgLDOqy (ORCPT + 99 others); Fri, 4 Dec 2020 09:46:54 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:40138 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730101AbgLDOqy (ORCPT ); Fri, 4 Dec 2020 09:46:54 -0500 Received: by mail-lj1-f196.google.com with SMTP id y10so6888050ljc.7; Fri, 04 Dec 2020 06:46:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YuN8v+wl7n8X6ofmOSfbc2YBxTt+XcxIQ84FcqRFIhU=; b=UcmsduDCGA67QusEkwL9MO21gdS3K/bhuyVnaAMT8paoq2HP9ep2SAmR1iuhhqPeJa 7OWlt/sUnMUR/982gaHh4LkIy50dK2KKid25NEIMK2vT6F6wRMCzqtjTp2UPuQeQkpTU Dbw0tcty41p5SB/Ga6dgrea9ORNQhiAS7P0+083yp/G1KdH1Ev4t8f+QbI5fpxkZKyvW WsEg5mxhmej9xPNaHrOUnEM/T6uc4vctYa9mQN1OCxF2JtR+aJhHGT/xnemMJOa+Z2yn Jmps8uQ+h9yvodos3wOn9fKAFaFBj//+d+31E7icnEqnStkNe/76Fjz72QIqUr9XhvEV M1mw== X-Gm-Message-State: AOAM530nc2eje2k+C6CNT4ag2MhkyNsZgiWSh7OAMGpzZgwHaiRtLB7/ ga14AS2LQkjvIkINDKGcbVk= X-Received: by 2002:a05:651c:3cf:: with SMTP id f15mr3573033ljp.118.1607093171959; Fri, 04 Dec 2020 06:46:11 -0800 (PST) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id f2sm1810567ljc.118.2020.12.04.06.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 06:46:11 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1klCM9-0005Mv-HH; Fri, 04 Dec 2020 15:46:45 +0100 Date: Fri, 4 Dec 2020 15:46:45 +0100 From: Johan Hovold To: Anant Thazhemadam Cc: Greg Kroah-Hartman , Johan Hovold , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 08/15] usb: misc: idmouse: update to use usb_control_msg_send() Message-ID: References: <20201130011819.2576481-1-anant.thazhemadam@gmail.com> <20201130013031.2580265-1-anant.thazhemadam@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201130013031.2580265-1-anant.thazhemadam@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 30, 2020 at 07:00:31AM +0530, Anant Thazhemadam wrote: > The newer usb_control_msg_{send|recv}() API are an improvement on the > existing usb_control_msg() as it ensures that a short read/write is treated > as an error, data can be used off the stack, and raw usb pipes need not be > created in the calling functions. > For this reason, the instance of usb_control_msg() has been replaced with > usb_control_msg_send() appropriately. > > Signed-off-by: Anant Thazhemadam > --- > drivers/usb/misc/idmouse.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) Especially for control transfers without a data stage there isn't really any benefit of the new helper. I'd just leave this one unchanged. > diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c > index e9437a176518..52126441a633 100644 > --- a/drivers/usb/misc/idmouse.c > +++ b/drivers/usb/misc/idmouse.c > @@ -56,8 +56,9 @@ static const struct usb_device_id idmouse_table[] = { > #define FTIP_SCROLL 0x24 > > #define ftip_command(dev, command, value, index) \ > - usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), command, \ > - USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, value, index, NULL, 0, 1000) > + usb_control_msg_send(dev->udev, 0, command, \ > + USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, \ > + value, index, NULL, 0, 1000, GFP_KERNEL) > > MODULE_DEVICE_TABLE(usb, idmouse_table); Johan