Message ID | 20231207-tps6598x_update-v1-3-dc21b5301d91@wolfvision.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4723523vqy; Thu, 7 Dec 2023 03:52:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhOVxvvO8fr9TJkBZzKqP5ngo2+6z8J/QkInwx0T/seFQ/ksCodvwzJyXkYYKYXZsrVybt X-Received: by 2002:a17:903:1c9:b0:1d0:6ffd:6109 with SMTP id e9-20020a17090301c900b001d06ffd6109mr3302640plh.43.1701949924582; Thu, 07 Dec 2023 03:52:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701949924; cv=pass; d=google.com; s=arc-20160816; b=Mitk8WAqT6SY14LqmLrKhFwts4WDZYUt7yFBomXEFuikYzciswuMNrPVo9jDFP9L8I VzHEa3qDOFDeDVkYDzPYxH38A2BP7osiM87jKd8g5SaA9xst5lgqkbao7H/d5Z38fFM9 2dAp4TIx7tpNamwzCDUslK/9Vm7kdPOmPDAML1WV+3QpeGlh+KPqLoCv5vx4gBuCDyx+ MSz77KTeLB5G5fe0ksFxwPGj6gp3bTUTl78gxy5V6FH/R1tbu/0br11pRwuXYLFYnceF 9N6R3WF41u3IkB1fXmG7jX+Lc9VECuacVB+q4BDARn9Z8xcgVygUXRvhoVgqveR7CRRa lt4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:cc:to:in-reply-to:references :message-id:content-transfer-encoding:subject:date:from :dkim-signature; bh=qmn+xRnKSGtQIicZhyD/lr/8Jjsxgyoot2OSa2cnruQ=; fh=skg4aWcIne/NkBvGBSxiPFt6u1LkY77F5jj9Umi9ZmE=; b=i/k4MaQQ/OQFy0DzobtqDTXyno6HmdQLrVyPUC3tA6Uwo32rbTondG4JJ4QV/NX71v 3tj+rwoX3AAoVgk9dUQqyNHP6fj8+cT5TqduIQYqmv7ULYQBLa3PkXeYJeeZWK34sRMK 1IiGNT+gJpZ7VU0xG8LmY2x2r3OJcuYShprwqKP0mpmgjqBU+Sk+44fhUboCUR68OdnG cVNpjzoEYwTYdE1thj5ZEespyjPqkTq+guDx49D5ADrS5NgxZ/5Y1rGpAybF4oyO6lAR 1zqKzXlOcF9tZ/sfj1KmyF96KuCAcAomFep7K02FCVXW2b/YhFclz31bzgD005toNXUj u03w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=SWqaKI4A; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y17-20020a17090322d100b001d0af284622si1031322plg.427.2023.12.07.03.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 03:52:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=SWqaKI4A; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 63D3A8068960; Thu, 7 Dec 2023 03:51:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379143AbjLGLvY (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Thu, 7 Dec 2023 06:51:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379007AbjLGLvP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 7 Dec 2023 06:51:15 -0500 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2064.outbound.protection.outlook.com [40.107.20.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 908C019A; Thu, 7 Dec 2023 03:51:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=izb0lvQ/x/16ob626iW1DDuFCJ6gC3jjY20/ziRuXC9JsHszDTbwk8b98SojWFr8yw0DbaoHqC675MeZmGuQ0jc8HZ7IKH0q/iSaGkV9TwW/98twxcFeoSwCdEtJAPdIF1w6Nnha2RcpsbSKrNTUGfjUsXVCw0FszfyMInK4nfYuULz/65FOl0gqe2CmZY6fgTPJK/LK6X5u92PDsuYVcSOHKQG1/gHq+N/79yNdefigaZf2MkZQIB0B8ZcGHUjuewEAB8hQHw9WhBz/i9d9HT3zQxH5C0RQppbJM3SGxIFjgQTAXWUJLYv8I9EOQjcmLuZEMTTXz5Oj3q6/xR7e4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qmn+xRnKSGtQIicZhyD/lr/8Jjsxgyoot2OSa2cnruQ=; b=gG5riPDyroX9S90X+3MhxuNb64ukEfx8q8GOdFAt2qSGExzFzpDFeHNpnWzrNmouoWXvNxWW2Y2KwVwYF68IUZZRaU1NkbFNeFJkmli9q6Na/pnQ408ZSszN7l7xoKMG6V2o4jQEtq/WgDK2OKGMfnOXZM4B61gpBZKYI7Je0VziDJ1lmtcSL3Zt/pjFMk7bKYZ1lu9VruHTwKCv9ERe+qVE4VGC1OoBd8oWuviyxEynDA41MLAAes+C8dHNaRD68Kausjs4LFAqvvVZh/+vFUvJLGoKPvVFMTvzknbUsXmNYcquyYHVfub5FC0N20OtPpox6HEvMDj8Ws0z4sKq1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qmn+xRnKSGtQIicZhyD/lr/8Jjsxgyoot2OSa2cnruQ=; b=SWqaKI4APJMe2JmHdK8jhA1IVlljxYbK1HHPQu21RkCTr97ltyd9MWqBin1ooZTRUEvfUqlNgvPBF0/jd0vLRe19iK9tHbexBPJ+vVThN0wSx0JGYGm66OtB+IebLEIv8a/BRwqMFuNuy+ZWEJb0rbVVQNGOo9KxGMPULRhirA0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by DB4PR08MB8054.eurprd08.prod.outlook.com (2603:10a6:10:389::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Thu, 7 Dec 2023 11:51:17 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::6b40:1e6f:7c94:71dc]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::6b40:1e6f:7c94:71dc%4]) with mapi id 15.20.7068.027; Thu, 7 Dec 2023 11:51:17 +0000 From: Javier Carrasco <javier.carrasco@wolfvision.net> Date: Thu, 07 Dec 2023 12:51:08 +0100 Subject: [PATCH 3/4] usb: typec: tipd: declare in_data in as const in exec_cmd functions Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231207-tps6598x_update-v1-3-dc21b5301d91@wolfvision.net> References: <20231207-tps6598x_update-v1-0-dc21b5301d91@wolfvision.net> In-Reply-To: <20231207-tps6598x_update-v1-0-dc21b5301d91@wolfvision.net> To: Heikki Krogerus <heikki.krogerus@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco <javier.carrasco@wolfvision.net> X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1701949872; l=1739; i=javier.carrasco@wolfvision.net; s=20230509; h=from:subject:message-id; bh=EYKG2QkBt3Q9Z4VdE6eA++VrFA30t1cRvwGmQo1q76g=; b=5JVDfkXVegF6CIN4hukYujw0bL4v5DcLfO+MTuIQgMQM8NdRzJgWnpIyTFqr7w2OKq1yhPWNf yCM6XD8543ZB1Z30xxCSKbWvelha1z50OHjHLVftXVxsSobrC2mmpFo X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=tIGJV7M+tCizagNijF0eGMBGcOsPD+0cWGfKjl4h6K8= X-ClientProxiedBy: VI1PR08CA0248.eurprd08.prod.outlook.com (2603:10a6:803:dc::21) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|DB4PR08MB8054:EE_ X-MS-Office365-Filtering-Correlation-Id: 11f2c7ea-5d21-4527-75fc-08dbf71ad075 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3fPf7PXstu/u5jGuW1bUcprz7uXc11inOwCt6yXMcDsdYqfiP3ERMxJ6fy7LGm9RrcSlhbb9ByWFW8mDLUYElwA2Yo95nNv92kVqB9yfhofQ/sM8wIuhbY/wPcNTdqTyU/EnA+uJsG/d4FPqh1563vVPlHqixfDpZx6jMm96JGPS8u/S7QWMCj47t6BTQ1SuNRALs6tk/NApE6slidZmw84PrM0ye9n7Baz18Qv/YjxzOU78Wyd1no+EHTx0ZVi6tVAmJYGi/JwgNYiCm7YPDgNavjSA5vVMVpx+TQ6CSoGXTChoK5sbC+lG5SLiAolwunxXUdA1afa7Tybf+z9ml3UgneRLzebh8zh6Q4ecMWw5z9ZK7Sm50ICRN+VlcHi9T1822CbTIsleS5e1MBbV9sAFYsByQ7TJK2w/pjlvtvVneQZMfA76V4ZxMLSVWL0IQuHYvYDM3eXOXxXnABL+iXOy3nOOPeuah0QQGlOF4QQCO/ZXkvnGX/V1wmSyPrxHVACw9jHKX+Aue0mJHG5kBvvffFU9SH8neblWsMZn3waMckzQmUMveD/wLUHQPWAu9eYo5QinUg+5u65RUNh7k+6vG4BYGb7AuKfIwEvRpMHpcVptN04eRtO/eAj0+uGb X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR08MB4974.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39840400004)(136003)(396003)(376002)(366004)(346002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(52116002)(38100700002)(5660300002)(38350700005)(2906002)(2616005)(6512007)(83380400001)(6666004)(6506007)(107886003)(26005)(110136005)(36756003)(6486002)(478600001)(41300700001)(44832011)(66946007)(66556008)(66476007)(86362001)(8936002)(4326008)(316002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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ymh0JiHgf7sXfsE5vVb3UK/42/gsJb6zrihIRObhsNEG+mJazHV5Lv79WriX1cV5J?= =?utf-8?q?flDChLpBUqgNECAxgvNlRKDPaVKisCsBXNYQ1YKiyumoEx2XKyHsxJR62JFfSVeNn?= =?utf-8?q?INULcEUGCb33ciL8oBX/r/k9wRmE6EOM4LlhG1yVEeoT5+R0D+6JMjfFVVApL9vlZ?= =?utf-8?q?vTANCSzg3gqMNHcO38RPGZZW1vuPT/vBDvMdHWqJz6BrvmDGsEk0Z6KewqUGDMMtM?= =?utf-8?q?NOvDmdo2/ATgSlaUbBhKZDEMJikoBycejobqJdJfWOjKYLSqMecSUXCEDF7hHtjJ5?= =?utf-8?q?49wo2ziwpG97hy8UUsoOc2n7hn6OJ0nHWpxwD8ryCzValFv+7BB0ct4EL5y7WSy7a?= =?utf-8?q?3QL/W+H0mr2+DXIzTdHWEbY6tMVHYDIz6tQuep4IzgbtmtF3QqzmAllHbF10eFQRA?= =?utf-8?q?9ebC2zUX8Rh3KAoxKjAbMYixZDbFBlYGkB+VFl2Eg0CSn1FZ02O6boVjI54xnxOGe?= =?utf-8?q?bzG5YzY7g+52nsUIYk5fAy+qYONEbEpn3d976cjBzXSiSCnbwKseGiLElM6RvhsJK?= =?utf-8?q?PacV9GRCFYx0y0cawvPwdqrdk8yCXjLK5BMg3PElcbdp/TysT1Sf3qIBPZVIM2JxQ?= =?utf-8?q?NDH1QIl3yrtGForLlgtQuWpEKUKOTiw2IxrS3cjlBSNV2OUuQBGaihr/J5nr2yKdX?= =?utf-8?q?CzOCvepPGOmV6Y2Fd+9wsyF4rFLjlAHNSGr01Nvfdu/8ceWMh2l8WQo=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 11f2c7ea-5d21-4527-75fc-08dbf71ad075 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2023 11:51:14.2591 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CpetL/K0PjQMRcgRwfRIqXkiRY7NvVzsiee9iNsmikvlenkpzmW/ggJxFVfgMAujR71M+gsomYXMMj19slePBiJpAYNrFR9RYO/ng/5Faug= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB8054 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 07 Dec 2023 03:51:45 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784623844373430027 X-GMAIL-MSGID: 1784623844373430027 |
Series |
usb: typec: tipd: add patch update support for tps6598x
|
|
Commit Message
Javier Carrasco
Dec. 7, 2023, 11:51 a.m. UTC
The input data passed to execute commands with tps6598x_exec_cmd()
is not supposed to be modified by the function. Moreover, this data is
passed to tps6598x_exec_cmd_tmo() and finally to tps6598x_block_write(),
which expects a const pointer.
The current implementation does not produce any bugs, but it discards
const qualifiers from the pointers passed as arguments. This leads to
compile issues if 'discarded-qualifiers' is active and a const pointer
is passed to the function, which is the case if data from a firmware
structure is passed to execute update commands. Adding the const
modifier to in_data prevents such issues and provides code consistency.
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
---
drivers/usb/typec/tipd/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 165a1391dc72..cd5214c9799e 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -330,7 +330,7 @@ static void tps6598x_disconnect(struct tps6598x *tps, u32 status) } static int tps6598x_exec_cmd_tmo(struct tps6598x *tps, const char *cmd, - size_t in_len, u8 *in_data, + size_t in_len, const u8 *in_data, size_t out_len, u8 *out_data, u32 cmd_timeout_ms, u32 res_delay_ms) { @@ -396,7 +396,7 @@ static int tps6598x_exec_cmd_tmo(struct tps6598x *tps, const char *cmd, } static int tps6598x_exec_cmd(struct tps6598x *tps, const char *cmd, - size_t in_len, u8 *in_data, + size_t in_len, const u8 *in_data, size_t out_len, u8 *out_data) { return tps6598x_exec_cmd_tmo(tps, cmd, in_len, in_data,