Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2742663pxv; Sun, 27 Jun 2021 07:27:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztZ4/w3ZK3lGJCsgxqjd/OJXL0y9QRHEt3pNRI697QC7u6eazfsbQ26CSYkJDku7boFk5k X-Received: by 2002:a17:907:728a:: with SMTP id dt10mr20301921ejc.280.1624804067055; Sun, 27 Jun 2021 07:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624804067; cv=none; d=google.com; s=arc-20160816; b=SSNhxz8jiS7gC0HumYRVZXL8nbGFOuSvNo6mP3g1SrqIlneZY/b/NQNtIO4hEtjnY2 utQTLVkEp2GLjTRq16iRPPCTi4mGWHhk1tXbSULCtAcQjwM0zOYY090Q820dndoiBLjq sIxVebLNo4rbdmr42cUAU0Tz9nt5JmKrMNgHv0mXIbTJmXrGOpUZb335hPC51D4SN7p4 T6mFWxhkk8WqAEi1kOKIDRciKY6Gic0pU5QtgXBJR3oc+JnW2wjZ9ldCJxZjj99qH1Fe a6HtOvIkYDQe+V3X8C0aJMM7qg1JgTMgvvlhXAltOs5VMviAfLyFyzGhDW5wHhxuve2X 6UYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=CI0HQbCtvQhmRkumlmeWm3fQevRe694n9j6UXpO6IY0=; b=rtcp27TGndFJMiJI47CDCUV8m5r25TMwy8QgmGKTM4pyWRk0PKyMGC9lD00LgWyx5Q O4csbZpTrydQj7hr0pkQENxfsUpoe4mQbMQ13B++YpXQQtfEFnJBrhm+ZF8YTp/AUUz4 0EjtBziQoGoF4skGT4B+C6naOGfxmRqimixCSjCXiw0wULLeJVS//c0OkdOPwonAtCfk BuAw9kqUELKGMj6oouqU1IGlFYcu9nqBcm8ZXIWm0f3YpFs5mf+r1/MiD/iAuHkrBIGJ hOGAVUMhuU42wDDxwVdMvNbIZCPAZkh8N0ZiPDMbMZy7ei0Ul9KpDSd2puG9AlliyALN 3hmA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l4si11606080edr.272.2021.06.27.07.27.23; Sun, 27 Jun 2021 07:27:47 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231158AbhF0O0V (ORCPT + 99 others); Sun, 27 Jun 2021 10:26:21 -0400 Received: from netrider.rowland.org ([192.131.102.5]:55677 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S230304AbhF0O0U (ORCPT ); Sun, 27 Jun 2021 10:26:20 -0400 Received: (qmail 625898 invoked by uid 1000); 27 Jun 2021 10:23:55 -0400 Date: Sun, 27 Jun 2021 10:23:55 -0400 From: Alan Stern To: Igor Kononenko Cc: Felipe Balbi , Greg Kroah-Hartman , openbmc@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/6] usb:gadget:mass-storage: refactoring the SCSI command handling Message-ID: <20210627142355.GD624763@rowland.harvard.edu> References: <20210626211820.107310-1-i.kononenko@yadro.com> <20210626211820.107310-3-i.kononenko@yadro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210626211820.107310-3-i.kononenko@yadro.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 27, 2021 at 12:18:15AM +0300, Igor Kononenko wrote: > Implements a universal way to define SCSI commands and configure > precheck handlers. What is the reason for doing this? At first glance, it appears you have added a great deal of complexity to the driver. The patch replaces a large amount of easily understood (albeit rather repetitious) code with an approximately equal amount of rather complicated code. This does not seem like an improvement. Furthermore, the code you removed is flexible; it easily allows for small variations as neede by some command handlers. But the code you added is all table-driven, which does not easily permit arbitrary variations. > Tested: By probing the USBGadget Mass-Storage on the YADRO VEGMAN > BMC(AST2500) sample, each SCSI command was sent through HOST->BMC; the > USBGadget MassStorage debug print showed all sent commands works > properly. > > Signed-off-by: Igor Kononenko > --- > drivers/usb/gadget/function/f_mass_storage.c | 540 +++++++++++-------- > drivers/usb/gadget/function/storage_common.h | 5 + > 2 files changed, 310 insertions(+), 235 deletions(-) I don't see the point of adding 75 lines to the kernel source if they don't accomplish anything new. Alan Stern