From patchwork Sun Dec 23 15:13:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 10741735 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20E6713BF for ; Sun, 23 Dec 2018 15:14:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1058C28618 for ; Sun, 23 Dec 2018 15:14:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 043F8286B9; Sun, 23 Dec 2018 15:14:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DD48286B6 for ; Sun, 23 Dec 2018 15:14:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729134AbeLWPOi (ORCPT ); Sun, 23 Dec 2018 10:14:38 -0500 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:33962 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729073AbeLWPOh (ORCPT ); Sun, 23 Dec 2018 10:14:37 -0500 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id wBNFED47024504; Sun, 23 Dec 2018 07:14:20 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=BKB576Rk7FdAtoMRnB3IR++qNYSRPYmF46etEw2Ls3Q=; b=Lpkq16Fj9Is+CVHV66GCKFyhwjpuuWKFfSoSVO4aVB2XzUnYUj+/ZT4d/dpP0qiHfDem QLYvws4UZdoeoxWDnob+YBt4hfrGcYQROKeipu7nWcj6btboH6vR9ObnB1j5N0H46EMX 8ELAQkc5jJcrZUvqrxZjh8pODIlDNJvM6M4J/qh77w4GxMMUjG8p3vYJRCXCd4KwKVP0 sXP3ZRe3F/buOioKPhBzeCbJ5+KbJ6FR+w3fPXSbHThVKyahGNSdBn7s3UlHrlliZo3Y eKiB2UrNvac2qvve3ZnEzEShvAYiOJVLwInlH4lAjsYBZtHASkBCI0zHsm1HFCEEgGZt oA== Authentication-Results: cadence.com; spf=pass smtp.mailfrom=pawell@cadence.com Received: from nam01-bn3-obe.outbound.protection.outlook.com (mail-bn3nam01lp2056.outbound.protection.outlook.com [104.47.33.56]) by mx0b-0014ca01.pphosted.com with ESMTP id 2phhr2dg14-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 23 Dec 2018 07:14:19 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BKB576Rk7FdAtoMRnB3IR++qNYSRPYmF46etEw2Ls3Q=; b=kYDb+zx/WHUvp3OcmhhBJPzX9GD/PT7BYByJl3IlFuKA4oC1TcK+svdAr/LKjRezSihAcENUGg0ClT632aeI7nELeiVp+zX3UWsMRRWPnxMrGs9NR5jBCrZ4e+17bnql5xnbEKySt4Eb15XlpYgMq9O9W26MPETjzEjgBjIy6WE= Received: from BYAPR07CA0021.namprd07.prod.outlook.com (2603:10b6:a02:bc::34) by BYAPR07MB4408.namprd07.prod.outlook.com (2603:10b6:a02:c1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.23; Sun, 23 Dec 2018 15:14:16 +0000 Received: from DM3NAM05FT034.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::205) by BYAPR07CA0021.outlook.office365.com (2603:10b6:a02:bc::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1446.21 via Frontend Transport; Sun, 23 Dec 2018 15:14:15 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning cadence.com discourages use of 199.43.4.28 as permitted sender) Received: from rmmaillnx1.cadence.com (199.43.4.28) by DM3NAM05FT034.mail.protection.outlook.com (10.152.98.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1471.7 via Frontend Transport; Sun, 23 Dec 2018 15:14:14 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id wBNFE6Hf004426 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Sun, 23 Dec 2018 10:14:13 -0500 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 23 Dec 2018 16:14:08 +0100 Received: from lvlogina.cadence.com (10.165.176.102) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Sun, 23 Dec 2018 16:14:08 +0100 Received: from lvlogina.cadence.com (localhost.localdomain [127.0.0.1]) by lvlogina.cadence.com (8.14.4/8.14.4) with ESMTP id wBNFE6ZW007178; Sun, 23 Dec 2018 15:14:06 GMT Received: (from pawell@localhost) by lvlogina.cadence.com (8.14.4/8.14.4/Submit) id wBNFE60h007162; Sun, 23 Dec 2018 15:14:06 GMT From: Pawel Laszczak To: CC: , , , , , , , , , , , , , , , , , Pawel Laszczak Subject: [PATCH v2 4/5] usb:common Simplify usb_decode_get_set_descriptor function. Date: Sun, 23 Dec 2018 15:13:11 +0000 Message-ID: <1545577992-4013-5-git-send-email-pawell@cadence.com> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1545577992-4013-1-git-send-email-pawell@cadence.com> References: <1545577992-4013-1-git-send-email-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.28;IPV:CAL;SCL:-1;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(39850400004)(346002)(376002)(396003)(2980300002)(36092001)(199004)(189003)(81166006)(51416003)(81156014)(4326008)(26826003)(76176011)(47776003)(8936002)(8676002)(336012)(48376002)(2906002)(97736004)(68736007)(54906003)(53936002)(6916009)(39060400002)(356004)(6666004)(7416002)(26005)(4720700003)(305945005)(50466002)(50226002)(86362001)(2351001)(42186006)(16586007)(186003)(106466001)(316002)(36756003)(105596002)(11346002)(476003)(69596002)(446003)(478600001)(107886003)(426003)(486006)(5660300001)(126002)(87636003)(2616005);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB4408;H:rmmaillnx1.cadence.com;FPR:;SPF:SoftFail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT034;1:76zv4n9+VIMnuP/Ast4e5P9P1olk/c7I7lWxxOOtlfTVPzbDea/Sqy8SQGBlVPIvUEEwHbnSDjWUXZWSJoxu36nAVS9pFXMi0reHhpMgpe/hvRuJ64u8AvZb0K5dweL8 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82ab9ea1-4087-4609-6a57-08d668e94d57 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060);SRVR:BYAPR07MB4408; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4408;3:BoTh+kNNZSwTCfQDctRF3oSZ1LiMKBu0g0G0xeyGTfYF0var7Nvxi08P9hFnX8n08Z7Ua7Bf9QOKYhfDcIOv46cWQupdRA/Wy2uJpB6argq8bjjDK8/3Rjt6B+LAUavcjucUVteb4Xy7vrCYEJaGIotu5kI1t+1r78NIX9RRGAIYaaK76W/I7IO5R/JVWMR6A6GNqOtfR7J1exbLi7DlMEjPvJbsmJ2JMUslfQAzK3KMSuxKA2EZ4qVQ65IYAYK0w+qDrNwLX5TokaYX63/FqHd1B+83STMQ6xCzBs7YTgWK1FkE5Of7aGXwVweI/ui5ue3QTBHOKQKPgCDA49Lbxw==;25:vm3ouknFknnTSCNopDNrWoHYcfoTaiAfCbS0oHcf8lRWeYwKitJflOD/5+EsaKVdxCQPHDYY35xyrk+Q9GY/NdE1uOCGTVo16cte+e21FIKSEN09b5iOq1a/G/2Hr/ZKNG0y1fmRK8mwO+nqYzX0F9lmdLkAglEfC+U5T7zzaYRulEk/iAwlWsZCMQd8VicUiuBrJmap/X0TGt0K471b3EKaYAJ5tt+EEROoLJIIn/VD5yxPWy5R0fjlfpOL2GRS0H6tVzD6FVjrQdxiWwjan2NsulRY5g7V60DMDsk6jPCQ3wzfVT/0Vh6VpZ2l6aFSU+Ekgb5jMmdB9DxbB8TjCQ==;31:lwb6bH7tw468puMSN83E862kBf7p0htWGS+WElfUz3BoLxko+wFv9mb1dQAd7w3ePpBMIKM2a0mgnYwbmiNpTyT6eUKhUUJbkDvwtonVK0Uaf1ATO//9uZMSP8qtufSjZ+jYXopBpswYRxhfmj0uUAwD3W/7I69qaFtJJWjVA7iKBes+LgU7BAaXjOyWg1owQrTuoAE3/7NSCf3KPy21jRXZa+xFZfP2mE0FZ8heHu4= X-MS-TrafficTypeDiagnostic: BYAPR07MB4408: X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4408;20:OMp6uQZnrks+DJoTqsM9dcONX3i6LJowQGx2hXxZzieGiY0RyQUQkKtGOsftFmXf1xbVRGJx1uAe8xvF2Nx7etYEwn3kHX932vtDy1IY5eDU6445ZVRPBNajbvwkOuiUcy3SgrEkZNWVbkX/XF7epFw39Qync4RUIuo9C8zlQ+8zTbfX1aKE3ibTQU9zZK1j1KD5CXofMAW58D9fP26MWBnDMYg39S5yxBeZMCTFp0z87p9ILb9PM1vjSfSprQyBBdO8RIxDm+aW+yBOB2WcMxlFq3xuTz3Q/7WwUachPfzL9LNw2BGl5qk/QHXYbXZjWNJFTgtsq/Ik5T3TPJbG6lLksAMK2KGAS32vt2Z1QoWnbmlNvqI3wzwCho4HmSnpuletUMcexOhsFp6Pe4FGR8ZhqfHQ1Rx4iuFVE8OoMWlXzzmidix0n7OlVhw7R+Qnwkj+Ir5aJCa+QYzBmuU8PF6StE5Tn2hE8RwTtFlfb4oRFC3Ydc9dh6GGlkjPe0hb;4:BlGwxfCgb9VK64v8VpThW4kk7f1QtsNvFp1sgfV601YjAfo2aI7q64xhF2fgLyuay4nTekt6x++ofkieJQzKbV4ri29ZsNNTleWVANJqD23qX0X+xBnxtf78rR2/ewC1whI6KX76a5CYBmnYaSRPJs4qQ4ypuzTY7n8VXlvYXbeTdGaFngFL6pqDhy60UYFxQYW+x0Lhg0Se1IOczy1jCwRH7ewLspFPFbpU2GTgZ8Kib3ZpD3M7zaJSy7eX5HNvJhNZlaTa5pFGNQDzVUCuRg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(3002001)(93006095)(93003095)(10201501046)(3231475)(944501520)(52105112)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:BYAPR07MB4408;BCL:0;PCL:0;RULEID:;SRVR:BYAPR07MB4408; X-Forefront-PRVS: 0895DF8FFD X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4408;23:2Y2TBN+BAEoE8dh2X+E2JQduw0C8E6FUIAe+pVC2EpWKBYEf3TB1HQyPxxMyND4GkN1C7H0W4ymLRo+Su9FjWLnyj3pyYcGO2w6nggoG9uSAFCIg+D095zBNt7SSdzTEhSwURmMLXgu9A16f34xxQtTxPZNxYhqwyQqrv+GiHbiX/tDSEY6T+M8LPP9OiJsmmFabX+B2lBy7mHtWX+D31q3RP+14aBwbBZMF9WfUWOIT+CigmQgPDr46bW99bCUZw3QI6sLI+Du/PNlcbXz4DNnPTQM2a7IOCDq5xmhU+s5eSsK4L6pB/zinqJKt7Cos9IphHqlQoFSlGJVyaBE7GrnJTQ2j7p54giJzZ3t9Ych1Pszekq0RW2UyxmgroylF0ugmlcJEAq24sTk/fkrIWlW8mfNB4HRRDOD/jP51ejf7KPlaxbElqrZC38oTJ0sA5tUO3uIH9oftLITUmvxVhUYivwcxmyQGCOepNrbpfF2GseuuPb8wd+WTtYFMldVMXLaXpIxJVF5LBpTUwlnX/PgduUgMLBewzX0lOKRZ68UZBjwtrhHIprxgfG8lH+5pfpmUQzHesS8yfLhF7yCx4WpGy2ycnKgpx01SkiKpE2OdENoR7r22pxadoq5/3Yyh4E4STOrNNWsu3H/0AXCHgPB0DaSjnva04JGg+yvLbSgABMsMrEEJKJ8MMhNcXqnduoMuaF3Cc5WSqPLzUtQu2I5P1MJl/8qJyITcdLr2en/Ecxks7qH3H27BoDgF1ao6q9UvqhoPTwQktAA+nb9uXifm8nY1LFIHW16MSjTprr+0lIKDlegtoDOA7PfpK9ywkCcE1Cb89gngFFpgEZnfIu5H/1fBocr589+b68yusdjWhbuuijmoiYdi+k6wlm0wQbrSxY3fgHDD0vhyAfd/fRz6mzkNBqqauSZsoEhZtET88ePAY9+tdJh3IbglAkIuuZ87gXTWmbd3Vf8Vr0npPFnk92wqzwe96pv57Oq18Se01csvuIn0S8UCbeaVfP9wmrHW1ulIfLVvt9O0dvAiPmpG/dCZPFaMfKYzHLjd6+Zh24gXHhTKlaLps1t+04Hgc5cm5Kk5AfUMI9t1fA+kPl/7VhWed4WsJK5gMS21tBWhMFr9ZbnLTnXKuWFp9e2HIg31DekZ0TxA693oSZ/NmzPPtPZ8qdOJF9Wqum7aqoUAcPm6OM7X1JpSNYiW2OQ1hCdjM34bHuapx5iRH7SFTlbcD8cqFn17hR4aDqMfx60= X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: BrryDhFPYrWSp8vRt5Iuyydi8M4cO5Aiqo/ad00cW7VpFGljqbfy3CTLFMq7DdT9EXNJBEXHsyICazhuBWMoOmgGtdscVXVlo34X42ox6az3lfrxgFTs55oAAcPvwy4wk0QYWmuK4T3UyW5azFM4I5R65kL8tO5x0ODsZobSSRX0v4FxFnixHUTRJAvZESHckzpe6rcjaROsBhplb1AkrlbkTcxFBhWVLGPBBke+GQUyGVWNST+HzjGtfBQYdZI9EzUZGiBEq4fHzxltA8uO0Ek2cPsUwOnOK2CmOvHXJ0BHKi9g4pXxTJMKC/3iVHlZ X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4408;6:ejcp97Ib5XzIJ8V9F1OJjm6NfVdZzw5ptdcvb9G1T4tPlHD/ft4YXg4RrvrnXCfkO4EUqLoKy6SoZ3ImF2v3VGVKzZvw2j+i130WzGxd7eiH6rd6u6Ik1Xe0XBY9KgxnGm9ixu3YSDPWoKpH+UaUiSQXlVhhEGaegbfW63ZsBBePry9gx9NM32cSlgNenhLCrdTH4UWs6aQdgXIPJONS8cGRURvjSNoi5syt4A38U38xEx+akzd2sOSsskK9J4D81Wc7lO8978Y0Bwv1FyhiuUJyBNyVxnP0D9A1iBO63CqJzSwdE7DWzxSA4aFJVSkSVWalINBP1ehegKi+VAsFm5Mrv6Z2+wtJ7wAoq5IqJluaVLNaMb6S9uXbSG+GRPTPR7jYchnjD3q6KBunbBE8zA1Bf+lL8R78yrZ1PVh+6ybuoTTdae43JOV/iX9C0EkobxCIlmLGdY6qj1yN2Fod2A==;5:b7TiDtMnOQePu3zGpEHSX2GmkPeINgVuYbh5xZUrnmVyiepzFR4viQtRRVdhesJylAZGZ88iXzidpjMHfNirpImG+5sUbZFEOOzbdhLXz+aXMdWRHIW949aWb/E0sNOrq0LkGuA9wSJHXtmjS/jWL4UVKaJawmOIb9WfHTMeSv8=;7:3YuIe0qZne375QBVt1p++Emd3fyYKqmZBilHch/xQcPFVEFC8M7RtP5kDX8uNLhwdoRZANz0gZd4QlmhN+5W/2v+bkE40E2CcJ2mU1gs3blFot/m+JZCsc9BXFuolNIFCtAHSmLijDWCSbGXWKA9fQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4408;20:ev9bgSoJvCzZenB7XmULaTXPsmbX+H1v7Hq+A839kCTMyxgfo3jErisJ2KIAvuBFBi/tQ8ZhFO46YjQ5CqYksgwpxPs8sSPKDeGgKsF0G2yqJAoFUNK4Hykdc8nNCKlbkpf/om0Nz9DZZ6n/TXFKhrvn9dW6Z6Y5AOCWmJkxzWEgECN/jGK58KFX+CcpwM5Ilr/UVtVrdz7joeg+uAAeBztC3FiKSG1cI0bR8ObgoDuEDbzFxqGqJyQn8XhDRuFw X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2018 15:14:14.7965 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82ab9ea1-4087-4609-6a57-08d668e94d57 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[199.43.4.28];Helo=[rmmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4408 X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 include:_spf.salesforce.com include:mktomail.com include:spf-0014ca01.pphosted.com include:spf.protection.outlook.com include:auth.msgapp.com include:spf.mandrillapp.com ~all X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-23_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=787 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812230137 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Patch moves switch responsible for decoding descriptor type outside snprintf. It's little improves code readability. Signed-off-by: Pawel Laszczak --- drivers/usb/common/debug.c | 111 +++++++++++++++++++------------------ 1 file changed, 57 insertions(+), 54 deletions(-) diff --git a/drivers/usb/common/debug.c b/drivers/usb/common/debug.c index 77e565a38f29..c15fa066339c 100644 --- a/drivers/usb/common/debug.c +++ b/drivers/usb/common/debug.c @@ -104,62 +104,65 @@ static void usb_decode_get_set_descriptor(__u8 bRequestType, __u8 bRequest, __u16 wValue, __u16 wIndex, __u16 wLength, char *str) { + char *s; + + switch (wValue >> 8) { + case USB_DT_DEVICE: + s = "Device"; + break; + case USB_DT_CONFIG: + s = "Configuration"; + break; + case USB_DT_STRING: + s = "String"; + break; + case USB_DT_INTERFACE: + s = "Interface"; + break; + case USB_DT_ENDPOINT: + s = "Endpoint"; + break; + case USB_DT_DEVICE_QUALIFIER: + s = "Device Qualifier"; + break; + case USB_DT_OTHER_SPEED_CONFIG: + s = "Other Speed Config"; + break; + case USB_DT_INTERFACE_POWER: + s = "Interface Power"; + break; + case USB_DT_OTG: + s = "OTG"; + break; + case USB_DT_DEBUG: + s = "Debug"; + break; + case USB_DT_INTERFACE_ASSOCIATION: + s = "Interface Association"; + break; + case USB_DT_BOS: + s = "BOS"; + break; + case USB_DT_DEVICE_CAPABILITY: + s = "Device Capability"; + break; + case USB_DT_PIPE_USAGE: + s = "Pipe Usage"; + break; + case USB_DT_SS_ENDPOINT_COMP: + s = "SS Endpoint Companion"; + break; + case USB_DT_SSP_ISOC_ENDPOINT_COMP: + s = "SSP Isochronous Endpoint Companion"; + break; + default: + s = "UNKNOWN"; + break; + } + sprintf(str, "%s %s Descriptor(Index = %d, Length = %d)", bRequest == USB_REQ_GET_DESCRIPTOR ? "Get" : "Set", - ({ char *s; - switch (wValue >> 8) { - case USB_DT_DEVICE: - s = "Device"; - break; - case USB_DT_CONFIG: - s = "Configuration"; - break; - case USB_DT_STRING: - s = "String"; - break; - case USB_DT_INTERFACE: - s = "Interface"; - break; - case USB_DT_ENDPOINT: - s = "Endpoint"; - break; - case USB_DT_DEVICE_QUALIFIER: - s = "Device Qualifier"; - break; - case USB_DT_OTHER_SPEED_CONFIG: - s = "Other Speed Config"; - break; - case USB_DT_INTERFACE_POWER: - s = "Interface Power"; - break; - case USB_DT_OTG: - s = "OTG"; - break; - case USB_DT_DEBUG: - s = "Debug"; - break; - case USB_DT_INTERFACE_ASSOCIATION: - s = "Interface Association"; - break; - case USB_DT_BOS: - s = "BOS"; - break; - case USB_DT_DEVICE_CAPABILITY: - s = "Device Capability"; - break; - case USB_DT_PIPE_USAGE: - s = "Pipe Usage"; - break; - case USB_DT_SS_ENDPOINT_COMP: - s = "SS Endpoint Companion"; - break; - case USB_DT_SSP_ISOC_ENDPOINT_COMP: - s = "SSP Isochronous Endpoint Companion"; - break; - default: - s = "UNKNOWN"; - break; - } s; }), wValue & 0xff, wLength); + s, wValue & 0xff, wLength); } static void usb_decode_get_configuration(__u16 wLength, char *str)