Message ID | 20231207-tps6598x_update-v1-3-dc21b5301d91@wolfvision.net (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="SWqaKI4A" 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) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: <linux-usb.vger.kernel.org> List-Subscribe: <mailto:linux-usb+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-usb+unsubscribe@vger.kernel.org> 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-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?S5xP6W14/h/icyZjDYPTQT98A2K2?= =?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ChLpBUqgNECAxgvNlRKDPaVKisCsBXNYQ1YKiyumoEx2XKyHsxJR62JFfSVeNn?= =?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 |
Series |
usb: typec: tipd: add patch update support for tps6598x
|
expand
|
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,
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(-)