diff mbox series

[2/2] usb: typec: cros-ec-ucsi: Mark cros_ucsi_ops static/const

Message ID 20250109220655.1677506-3-swboyd@chromium.org (mailing list archive)
State Accepted
Commit a181c8ef0b745cdb61151c710f0880d00b8442b7
Headers show
Series usb: typec: cros-ec-ucsi: A couple small cleanups | expand

Commit Message

Stephen Boyd Jan. 9, 2025, 10:06 p.m. UTC
This structure isn't used outside this file and can be marked const so
that it gets moved to read-only memory.

Cc: Pavan Holla <pholla@chromium.org>
Cc: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Cc: Łukasz Bartosik <ukaszb@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 drivers/usb/typec/ucsi/cros_ec_ucsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Łukasz Bartosik Jan. 10, 2025, 1:47 p.m. UTC | #1
On Thu, Jan 9, 2025 at 11:07 PM Stephen Boyd <swboyd@chromium.org> wrote:
>
> This structure isn't used outside this file and can be marked const so
> that it gets moved to read-only memory.
>
> Cc: Pavan Holla <pholla@chromium.org>
> Cc: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> Cc: Łukasz Bartosik <ukaszb@chromium.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>

Reviewed-by: Łukasz Bartosik <ukaszb@chromium.org>

> ---
>  drivers/usb/typec/ucsi/cros_ec_ucsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/ucsi/cros_ec_ucsi.c b/drivers/usb/typec/ucsi/cros_ec_ucsi.c
> index 75646a8d55be..c605c8616726 100644
> --- a/drivers/usb/typec/ucsi/cros_ec_ucsi.c
> +++ b/drivers/usb/typec/ucsi/cros_ec_ucsi.c
> @@ -133,7 +133,7 @@ static int cros_ucsi_sync_control(struct ucsi *ucsi, u64 cmd)
>         return ret;
>  }
>
> -struct ucsi_operations cros_ucsi_ops = {
> +static const struct ucsi_operations cros_ucsi_ops = {
>         .read_version = cros_ucsi_read_version,
>         .read_cci = cros_ucsi_read_cci,
>         .read_message_in = cros_ucsi_read_message_in,
> --
> https://chromeos.dev
>
diff mbox series

Patch

diff --git a/drivers/usb/typec/ucsi/cros_ec_ucsi.c b/drivers/usb/typec/ucsi/cros_ec_ucsi.c
index 75646a8d55be..c605c8616726 100644
--- a/drivers/usb/typec/ucsi/cros_ec_ucsi.c
+++ b/drivers/usb/typec/ucsi/cros_ec_ucsi.c
@@ -133,7 +133,7 @@  static int cros_ucsi_sync_control(struct ucsi *ucsi, u64 cmd)
 	return ret;
 }
 
-struct ucsi_operations cros_ucsi_ops = {
+static const struct ucsi_operations cros_ucsi_ops = {
 	.read_version = cros_ucsi_read_version,
 	.read_cci = cros_ucsi_read_cci,
 	.read_message_in = cros_ucsi_read_message_in,