Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1657512rdb; Mon, 2 Oct 2023 17:34:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHEs2WJq66v2YOSao5YLNi3QW4x4HlvIRf4vDmSS0/evE0QJk1jk9h3CeHHOQlx5QPBt7J1 X-Received: by 2002:a05:6e02:d52:b0:34b:af03:e2a with SMTP id h18-20020a056e020d5200b0034baf030e2amr11812553ilj.31.1696293290311; Mon, 02 Oct 2023 17:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696293290; cv=none; d=google.com; s=arc-20160816; b=BGIzhaBRtP+u6Sv5h1lZlRoq+5fDec9htNI13OhxLQBOO1j0Co9HAf2+xf1Y5QJ3Xh hXhCHNMFb3xrywaVSVq2AgaZby9/4ZREAaUF+c+lngUuzy4WIXdYTnpR4UHOz9qGSwGF k5Egy+5Sj/FGT9sQhqR/+a7t1XfdbyWzAMecpLQ/Ko/YO562RtzL/9DTPiziMdfUJtUj L49OZpxFrHjs8H86dHAN7iY0RiMZar92RdNBAityPoy5gorAycmK3p56xUwGiSoUclB4 mmKuMrEtqYUzY5KpH21y+iS0x3unUO8WduRaEPjmBkezuR4t1AiDRYm9P+JwHS7Qwyo9 M/8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=L5aF3XmMYuXB9m+K+yR4UudzmAD6ahXZqfX5b3PlkQE=; fh=YJV7s35UDfTu410NGMNaxLgUC83Mipoa1f3x561mYKo=; b=m4IoYCorHJqSUS84vvy37NOHVJJ7fDT0MVe68QiTv0/4A922Wn7SDRL5WbCZGY66aV 8hTqBdH8l4qIWEJn6Ui08GHomataQUwIRSom1P056D2ba8FUxFEMMglb0iYwJK+aeK1m nU5qvKSZtBoGE0cLFSsUtWy7HdIQpB1ppkWtCga5vSetzz95ZEhGbf6Rpb4ti+LaQEjz HqFqb2WuEfR1djwBXhvPSiDuQQZRFKbxSFXWQ30gOem0aAecO6ZnZUaS1xIZYt9mWuuo vnrkWWdurXam62NcriOyFbmEOKvnX2+8ZwneTrXcKQGK9cpLhUNLIhF6qq+OItLvFfuw LInA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IytwKypd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id bv126-20020a632e84000000b00578a2da998asi172690pgb.304.2023.10.02.17.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 17:34:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IytwKypd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id A168E824696D; Mon, 2 Oct 2023 17:34:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238917AbjJCAep (ORCPT + 99 others); Mon, 2 Oct 2023 20:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbjJCAei (ORCPT ); Mon, 2 Oct 2023 20:34:38 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3740CA1 for ; Mon, 2 Oct 2023 17:34:35 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-694f3444f94so263224b3a.2 for ; Mon, 02 Oct 2023 17:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696293274; x=1696898074; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L5aF3XmMYuXB9m+K+yR4UudzmAD6ahXZqfX5b3PlkQE=; b=IytwKypdFdUkI8XLCrk8w3O0hr8I2t72AyHHEWFlg897Se2Ngtm8B/uJ9S1H3KKh7S HS53rojFm/iBjoscCiBHmnHpAPaF+GYQC/hsLetXemp7Edj2IcnLBCFZaF0XbSnYsL95 Qwd+M4SFEmqf/l06NNu1ftVIRLpu7QUrsu/KE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696293274; x=1696898074; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L5aF3XmMYuXB9m+K+yR4UudzmAD6ahXZqfX5b3PlkQE=; b=GaI6auzW7s+kiqXm3XvL00asAJltysRxkh1SrIgD5IoEyTSh9IH2or7t55lhpJoRZt nIZm2M0anU3Qt1/kLCCHDj+SqjPFSSLY90fEQBVAlOMa7g1bIbNjGVaRpPetz0U5g15Y dorJ4RfneIAzOirA5HpJngreINpMZz4SgLBcwRcyMMZCD5XyTkil9v2HotUvHba8bXxR 2YnsGNMpIdlZnMpI7tccGzWLHy8xa6XEe13j/0KgNhJX4dqW1mrVAVswiyYBVEPSyjlE snOqVfRSwz+0IpMkn/muB2baBcrhgF2AE1end0z8nfMeCrDeLELi8v4lD05LabrwEurW 073w== X-Gm-Message-State: AOJu0Yzl/fwItTroZxMRVTr9y8r22OCTr030PtqENENKQO5L5ufZ3qvR pNvg0X4UHt+TELWM5H+6OKGmnw== X-Received: by 2002:a05:6a00:b87:b0:693:3d55:2ba6 with SMTP id g7-20020a056a000b8700b006933d552ba6mr16207301pfj.9.1696293274608; Mon, 02 Oct 2023 17:34:34 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:11a:201:f676:8db:8677:aefe]) by smtp.gmail.com with ESMTPSA id bm2-20020a056a00320200b0068a13b0b300sm101368pfb.11.2023.10.02.17.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 17:34:34 -0700 (PDT) From: Stephen Boyd To: Benson Leung , Tzung-Bi Shih Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, chrome-platform@lists.linux.dev, Prashant Malani Subject: [PATCH 3/4] platform/chrome: cros_typec_vdm: Mark port_amode_ops const Date: Mon, 2 Oct 2023 17:34:27 -0700 Message-ID: <20231003003429.1378109-4-swboyd@chromium.org> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog In-Reply-To: <20231003003429.1378109-1-swboyd@chromium.org> References: <20231003003429.1378109-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 17:34:49 -0700 (PDT) Mark this struct of functions const so it moves to RO memory. Cc: Prashant Malani Signed-off-by: Stephen Boyd --- drivers/platform/chrome/cros_typec_vdm.c | 2 +- drivers/platform/chrome/cros_typec_vdm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/chrome/cros_typec_vdm.c b/drivers/platform/chrome/cros_typec_vdm.c index 20515ee0a20e..3f632fd35000 100644 --- a/drivers/platform/chrome/cros_typec_vdm.c +++ b/drivers/platform/chrome/cros_typec_vdm.c @@ -142,7 +142,7 @@ static int cros_typec_port_amode_vdm(struct typec_altmode *amode, const u32 hdr, sizeof(req), NULL, 0); } -struct typec_altmode_ops port_amode_ops = { +const struct typec_altmode_ops port_amode_ops = { .enter = cros_typec_port_amode_enter, .vdm = cros_typec_port_amode_vdm, }; diff --git a/drivers/platform/chrome/cros_typec_vdm.h b/drivers/platform/chrome/cros_typec_vdm.h index 95a6a75d32b6..631bd2ce4b00 100644 --- a/drivers/platform/chrome/cros_typec_vdm.h +++ b/drivers/platform/chrome/cros_typec_vdm.h @@ -5,7 +5,7 @@ #include -extern struct typec_altmode_ops port_amode_ops; +extern const struct typec_altmode_ops port_amode_ops; void cros_typec_handle_vdm_attention(struct cros_typec_data *typec, int port_num); void cros_typec_handle_vdm_response(struct cros_typec_data *typec, int port_num); -- https://chromeos.dev