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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09FC3C6FA82 for ; Mon, 12 Sep 2022 14:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbiILORi (ORCPT ); Mon, 12 Sep 2022 10:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbiILORd (ORCPT ); Mon, 12 Sep 2022 10:17:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58F832610E; Mon, 12 Sep 2022 07:17:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C073BB80D7F; Mon, 12 Sep 2022 14:17:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7344DC433D7; Mon, 12 Sep 2022 14:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662992249; bh=aGq0nN+nEaeWXYxt+doqTW9R/4SDnQkBCNcOcCEmsCs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZlfLpax89DnIeCvbfGgWnusbMfGKwqpDbc8FK85XBv6cSXecxLa0wDC0jHfSDa+UC sYNHjMYvr8WeHg+Qz+V7vKYZ+P1fjO1Uft+HIqCP44y16+taLVJ5xudHmnQc9VuCKN wyFVZb14XErXNBH6NMD7SpgyuBQie1V1LB5oCYovSFUZa3CoQfwxARYosPK1muWDUp duzztajgFzwCEJKB9yWY1dz8vy7IX+i3o/YchMpL8IsHmlcvdI1onAgWgkK4bkVz7Y 23bx/c3BtlB8K4X+cPOm/c7plZefbZRrA9ErCEpze2bvIUHIMLC6sHFfEyGZz5ewM9 bhPquCKL7vUIA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oXkFa-0001K7-1O; Mon, 12 Sep 2022 16:17:26 +0200 Date: Mon, 12 Sep 2022 16:17:26 +0200 From: Johan Hovold To: Greg KH Cc: cgel.zte@gmail.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Xu Panda , Zeal Robot Subject: Re: [PATCH linux-next] USB: serial: ftdi_sio: remove the unneeded result variable Message-ID: References: <20220912133826.18517-1-xu.panda@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 12, 2022 at 04:05:39PM +0200, Greg Kroah-Hartman wrote: > On Mon, Sep 12, 2022 at 01:38:27PM +0000, cgel.zte@gmail.com wrote: > > From: Xu Panda > > > > Return the value usb_control_msg() directly instead of storing > > it in another redundant variable. > > > > Reported-by: Zeal Robot > > Signed-off-by: Xu Panda > > - rv = usb_control_msg(port->serial->dev, > > - usb_sndctrlpipe(port->serial->dev, 0), > > - FTDI_SIO_SET_BAUDRATE_REQUEST, > > - FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, > > - value, index, > > - NULL, 0, WDR_SHORT_TIMEOUT); > > - return rv; > > + return usb_control_msg(port->serial->dev, > > + usb_sndctrlpipe(port->serial->dev, 0), > > + FTDI_SIO_SET_BAUDRATE_REQUEST, > > + FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE, > > + value, index, > > + NULL, 0, WDR_SHORT_TIMEOUT); > > } > > That's really not the correct use of the return value of > usb_control_msg(). Can you fix this up to properly handle the return > value, or better yet, use the usb_control_msg_send() call? It is actually correct since the buffer length is zero here (i.e. it returns a negative errno or 0). But I'm also ignoring patches from this email address as it is used by multiple users, and of which none so far has replied to feedback (as if it's all automated). Johan