From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5308E376467 for ; Mon, 4 May 2026 09:17:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777886239; cv=none; b=CNiJlSU5Xwzx4nHLWn3pN3XGpqtdDIICDvhMCfr6Z1NmAGHWQYk+Z2HrJ5DGoLx2UZZLOdhiiQ70oRy3+TS+B5CymqK5g+j2vz3Pz+vZQ8Yb0npH6jLM2/4fs1kJGCQ3ZER7DgrD2QIzqLnkWS1NREQt8fdVQNtVCMeFf3OJVBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777886239; c=relaxed/simple; bh=6FrODT2ZjHyBdDyannBtEzjomylqmnCzFA6S+a44xiE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fWGbl88QenyAiQBESkVXL+YKJmIrDO0WZdC0vLhUdCOlVS+XdSR9stv95DpQ8Zh/ODHeHHf0W+dFT2QgR3jEeMMBc6KS8TULTMhaN/itI+MtL5fiPxsML96kvwswNZZUeKhI1h7znPmTXpq16Pyhd5QwFwuCnq4wRBlGUX2t2Ao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D2Pjl7Au; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D2Pjl7Au" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4891e86fabeso47995345e9.1 for ; Mon, 04 May 2026 02:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777886237; x=1778491037; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=2bDiiYv6DmJYWv+J0npT1YM58b8GYRgLdrDapx8OI3Q=; b=D2Pjl7Aux0uMQSI0m0s0FzuWRmMSFYwlXduhhg5g/vj0UlHd/31jB/eR4cLbQCutcw SfwhY+e7dHp0ChGUtIq3EbjQPocVdvWVXvVS/o+MyhGqzcA8gQKmQUBKJjEACmEu/JQS hLbICu7YW0fNMiI6sXqprhVYUYKW2c4K2CHNNusAaDx3rE1vX+BOz/Pgyxd8xgIBoRBl 1IBgVJP3ehzUPsMDCouQs4eZ/g4N1tvBPYvcwJlGM3hbT9X+rcc6+Bamyw+G7kg7YSEZ xIzl3glhvE3wYv625ERpsvvUW73JdTBVq8ubIdMOWlK7Draf9CSaeLOiqNo4Rw9riekX 6k3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777886237; x=1778491037; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=2bDiiYv6DmJYWv+J0npT1YM58b8GYRgLdrDapx8OI3Q=; b=Xc2pxLUvbFjO16dm+Xi3/xk40UQcfgCs7VFjCDklqpiSDEcy+BlcevVoHEcIyPLcFZ jvgRFYsdxr54ZfvRs6jwFmFQDGgIorMTusEoSBSthKr8M+Yo3evOc/UdMxpGKr0gdRFa py13PymXNDOj7XinnzT60nYNbfLw9D+wZ/8MG0PAOMekZfao1jkbcrdqpjDo/kTu/gs7 YqFm0v7SJfaj5GLfNndV8ovTNm2o2NgJC1XqYtDrLucyiNU0rJIcPPNQkdmg9QY25fhq YsuOkhrnoZcE2AmOBAPt2xQd8MCggdJcfSbBJjoieAGgPvF4eHatBJjyD8OMz4wPt3gy QtrA== X-Forwarded-Encrypted: i=1; AFNElJ/gUXSwCDrtcRbgy5r2UlxPWOg819W+H+/1gDZ3G5T/P+th52+rk5xUhDKpdTXvU4u3uPA6crMpED2WES0=@vger.kernel.org X-Gm-Message-State: AOJu0Ywin0kEN/p5IVykcVw/wN+gwY45nHIwJPpl8P1txGuINJHQo+Cy Fg1UNnvFqUFDdMy+hrNhmMqqPR3fQj3SZSmTgpvW6iBolFBHUHqWlRM9 X-Gm-Gg: AeBDieu4EC9SKqF7T54IUDTNHfWdGOX+XZ6SYppwl1/9pe9pKegxNCY5sbXLzduS9Ok dvgUP1HIg5Z5daUHYNqhERqxiX7WwrN2AcPkxVcdiUh1dznS8iOGJz64FUA9p/7zdiUUp772Sni 0Gl6KBYobOuIVYSP49Y4qzluxVZj1Woc4lhYOYgFQekQ0OEza0klXjMpFR6IwKo4MRvmKgq+Lcj /8S6ZUVBNQm7QZhw8Ujp1EvlEznNiCCGSlUn6Rv52/URCgsk2tbneci96iqNKJ5tIVMCXkNnmPk 0/ciLNHrHsFfFNVsNz6g8O1Ujy9rk1LlikBdFSViH6pWIVNHnWjCVGkz5T+GzQyfbMUbb6kGxgU CoPtQftQPvPx470ikhVZXCmgmWK8c82eLtnYyxPOLwzeA6RMF/YqhXLcyde36VsKXMLsjpPrjB0 Uf/9eUORnQZGBdPSvE+AkDvbqnYHN8feA1E70G6fg1dL4vDw== X-Received: by 2002:a05:600c:a30a:b0:488:8840:e5ae with SMTP id 5b1f17b1804b1-48a98674f9emr105042995e9.24.1777886236451; Mon, 04 May 2026 02:17:16 -0700 (PDT) Received: from foxbook (bgt227.neoplus.adsl.tpnet.pl. [83.28.83.227]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-44a981dee0bsm24119164f8f.19.2026.05.04.02.17.15 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 04 May 2026 02:17:16 -0700 (PDT) Date: Mon, 4 May 2026 11:17:12 +0200 From: Michal Pecio To: Greg KH , Alan Stern , Mathias Nyman Cc: "Xuetao (kirin)" , , , Subject: [PATCH v2 3/3] usb: core: Clean up SuperSpeed/eUSB2 descriptor validation logging Message-ID: <20260504111712.2e3b9fc1.michal.pecio@gmail.com> In-Reply-To: <20260504111353.55ba2530.michal.pecio@gmail.com> References: <20260504111353.55ba2530.michal.pecio@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Core usually prints endpoint addresses with 0x%X format. Change this code to use it too, instead of just %d. Particularly for IN, 0x83 seems more readable than 131. While at that, fix checkpatch warnings about multi-line quoted strings, as well as missing or doubled whitespace in those strings. Signed-off-by: Michal Pecio --- v2: new patch in series drivers/usb/core/config.c | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 74945cd30cd2..6b718f8a6697 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -56,8 +56,7 @@ static void usb_parse_ssp_isoc_endpoint_companion(struct device *ddev, desc = (struct usb_ssp_isoc_ep_comp_descriptor *) buffer; if (desc->bDescriptorType != USB_DT_SSP_ISOC_ENDPOINT_COMP || size < USB_DT_SSP_ISOC_EP_COMP_SIZE) { - dev_notice(ddev, "Invalid SuperSpeedPlus isoc endpoint companion" - "for config %d interface %d altsetting %d ep %d.\n", + dev_notice(ddev, "Invalid SuperSpeedPlus isoc endpoint companion for config %d interface %d altsetting %d ep 0x%X.\n", cfgno, inum, asnum, ep->desc.bEndpointAddress); return; } @@ -91,7 +90,7 @@ static void usb_parse_eusb2_isoc_endpoint_companion(struct device *ddev, size -= h->bLength; } - dev_notice(ddev, "No eUSB2 isoc ep %d companion for config %d interface %d altsetting %d\n", + dev_notice(ddev, "No eUSB2 isoc ep 0x%X companion for config %d interface %d altsetting %d\n", ep->desc.bEndpointAddress, cfgno, inum, asnum); } @@ -115,9 +114,7 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, } if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP) { - dev_notice(ddev, "No SuperSpeed endpoint companion for config %d " - " interface %d altsetting %d ep %d: " - "using minimum values\n", + dev_notice(ddev, "No SuperSpeed endpoint companion for config %d interface %d altsetting %d ep 0x%X: using minimum values\n", cfgno, inum, asnum, ep->desc.bEndpointAddress); /* Fill in some default values. @@ -141,42 +138,32 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, /* Check the various values */ if (usb_endpoint_xfer_control(&ep->desc) && desc->bMaxBurst != 0) { - dev_notice(ddev, "Control endpoint with bMaxBurst = %d in " - "config %d interface %d altsetting %d ep %d: " - "setting to zero\n", desc->bMaxBurst, - cfgno, inum, asnum, ep->desc.bEndpointAddress); + dev_notice(ddev, "Control endpoint with bMaxBurst = %d in config %d interface %d altsetting %d ep 0x%X: setting to zero\n", + desc->bMaxBurst, cfgno, inum, asnum, ep->desc.bEndpointAddress); ep->ss_ep_comp.bMaxBurst = 0; } else if (desc->bMaxBurst > 15) { - dev_notice(ddev, "Endpoint with bMaxBurst = %d in " - "config %d interface %d altsetting %d ep %d: " - "setting to 15\n", desc->bMaxBurst, - cfgno, inum, asnum, ep->desc.bEndpointAddress); + dev_notice(ddev, "Endpoint with bMaxBurst = %d in config %d interface %d altsetting %d ep 0x%X: setting to 15\n", + desc->bMaxBurst, cfgno, inum, asnum, ep->desc.bEndpointAddress); ep->ss_ep_comp.bMaxBurst = 15; } if ((usb_endpoint_xfer_control(&ep->desc) || usb_endpoint_xfer_int(&ep->desc)) && desc->bmAttributes != 0) { - dev_notice(ddev, "%s endpoint with bmAttributes = %d in " - "config %d interface %d altsetting %d ep %d: " - "setting to zero\n", + dev_notice(ddev, "%s endpoint with bmAttributes = %d in config %d interface %d altsetting %d ep 0x%X: setting to zero\n", usb_endpoint_xfer_control(&ep->desc) ? "Control" : "Bulk", desc->bmAttributes, cfgno, inum, asnum, ep->desc.bEndpointAddress); ep->ss_ep_comp.bmAttributes = 0; } else if (usb_endpoint_xfer_bulk(&ep->desc) && desc->bmAttributes > 16) { - dev_notice(ddev, "Bulk endpoint with more than 65536 streams in " - "config %d interface %d altsetting %d ep %d: " - "setting to max\n", + dev_notice(ddev, "Bulk endpoint with more than 65536 streams in config %d interface %d altsetting %d ep 0x%X: setting to max\n", cfgno, inum, asnum, ep->desc.bEndpointAddress); ep->ss_ep_comp.bmAttributes = 16; } else if (usb_endpoint_xfer_isoc(&ep->desc) && !USB_SS_SSP_ISOC_COMP(desc->bmAttributes) && USB_SS_MULT(desc->bmAttributes) > 3) { - dev_notice(ddev, "Isoc endpoint has Mult of %d in " - "config %d interface %d altsetting %d ep %d: " - "setting to 3\n", + dev_notice(ddev, "Isoc endpoint has Mult of %d in config %d interface %d altsetting %d ep 0x%X: setting to 3\n", USB_SS_MULT(desc->bmAttributes), cfgno, inum, asnum, ep->desc.bEndpointAddress); ep->ss_ep_comp.bmAttributes = 2; @@ -199,9 +186,7 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, if (le16_to_cpu(desc->wBytesPerInterval) > max_tx || (le16_to_cpu(desc->wBytesPerInterval) < usb_endpoint_maxp(&ep->desc) && usb_endpoint_is_int_in(&ep->desc))) { - dev_notice(ddev, "%s endpoint with wBytesPerInterval of %d in " - "config %d interface %d altsetting %d ep %d: " - "setting to %d\n", + dev_notice(ddev, "%s endpoint with wBytesPerInterval of %d in config %d interface %d altsetting %d ep 0x%X: setting to %d\n", usb_endpoint_xfer_isoc(&ep->desc) ? "Isoc" : "Int", le16_to_cpu(desc->wBytesPerInterval), cfgno, inum, asnum, ep->desc.bEndpointAddress, -- 2.48.1