Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp495336ybg; Fri, 12 Jun 2020 07:04:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFVx6S1XJvLIGk9rmnjqQyeIwV2VJmpidDBnHnZtMCTrfB3QxFVKtPqKDShTfApV5VDaP5 X-Received: by 2002:a17:906:22da:: with SMTP id q26mr843118eja.256.1591970676323; Fri, 12 Jun 2020 07:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591970676; cv=none; d=google.com; s=arc-20160816; b=CLc/5cT5/aVtiDYPYX7gV/Dn33X8nCglvRWMNtZfE7n1b0vdsntLiZItrkPaUmgVKV ST1YKOTGvzKEMdMw9mPRsFRQOE0tcoCEviQZ4c1yaLAOM3cLWlkWghP5W4XlUSOTGcLQ hfxkfpXwX7lsXKL3v6RLnRC0YCrZI3jOd1OKva/VIGv7Jq8zRdhLQ7Lg4KUdvBPRYfHc RAqXNGqfDH8A4NM/p7HNDI9Jy2eUke6cAIf11xpPdqcIyGaGI5xX0B4q+VD2WAiQn8dL 3+5HX+rwo/ej1H35ZUfWXFExmh9yxN/YHZmhV4WlviHeJLasKIf/H1Y9fQPFXqwPdsh3 0P+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FGVrueEtjKcAJus0fLJLDlUmMgnk+fdvt3qpYRKw2os=; b=UnPfRm+zczAVkISSvbehQ2i6Py7dWNsr9ozoKY9OYvr+6H4NqhtstqBsWrXf0IDmxH 9kFwf7iaoHkpgqVn4Drm2USAoiXa+L2LdzOi5ea2kwx1vcWH/CVh5FMwxVWTZub9x+k4 jG0YMVcAW9k0ZctKE5QlSZvLpBe6ba1qSBGFw78FisPq+htawn76zaxgbOPqDXxjlSAu NNp7eULzk0usQDAMcdG0MpJ5R6D2Hmm0Cx8XO0KzU1LgioY7LbtLutYkgWk5osnjaBCP VQ5Qa/297mz+p2sZzd1rBbng+RCRoW861z+0DyC2ouwYLG79hzGeOxTHVCUlkWxbWpve 98dw== 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 ar22si4015988ejc.434.2020.06.12.07.04.02; Fri, 12 Jun 2020 07:04:36 -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 S1726283AbgFLOCN (ORCPT + 99 others); Fri, 12 Jun 2020 10:02:13 -0400 Received: from netrider.rowland.org ([192.131.102.5]:59631 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726085AbgFLOCM (ORCPT ); Fri, 12 Jun 2020 10:02:12 -0400 Received: (qmail 13466 invoked by uid 1000); 12 Jun 2020 10:02:11 -0400 Date: Fri, 12 Jun 2020 10:02:11 -0400 From: Alan Stern To: Macpaul Lin Cc: Felipe Balbi , Greg Kroah-Hartman , Matthias Brugger , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Jim Lin , Siqi Lin , Mediatek WSD Upstream , Macpaul Lin Subject: Re: [PATCH] usb: replace hardcoded maximum usb string length by definition Message-ID: <20200612140211.GA12639@rowland.harvard.edu> References: <1591939967-29943-1-git-send-email-macpaul.lin@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1591939967-29943-1-git-send-email-macpaul.lin@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 12, 2020 at 01:32:47PM +0800, Macpaul Lin wrote: > Replace hardcoded maximum usb string length (126 bytes) by definition > "MAX_USB_STRING_LEN". > > Signed-off-by: Macpaul Lin ... > diff --git a/include/linux/usb.h b/include/linux/usb.h > index 9f3c721..df4a9cb 100644 > --- a/include/linux/usb.h > +++ b/include/linux/usb.h > @@ -1815,6 +1815,8 @@ static inline int usb_get_ptm_status(struct usb_device *dev, void *data) > 0, data); > } > > +/* USB String descriptors can contain at most 126 characters. */ > +#define MAX_USB_STRING_LEN 126 This definition belongs in include/uapi/linux/usb/ch9.h (near the definition of struct usb_string_descriptor) because it is part of the USB standard rather than specific to the Linux USB stack. Alan Stern