Skip to content

Commit 2f3dd39

Browse files
bebarinoTzung-Bi Shih
authored andcommitted
platform/chrome: cros_ec_proto: Mark outdata as const
The 'outdata' is copied to the data buffer in cros_ec_cmd() before being sent over to the EC. Mark the argument as const so that callers can pass const pointers to this function and so that callers know the data won't be modified. Cc: Prashant Malani <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Acked-by: Prashant Malani <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent 14e7c01 commit 2f3dd39

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/platform/chrome/cros_ec_proto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ EXPORT_SYMBOL_GPL(cros_ec_get_sensor_count);
10041004
int cros_ec_cmd(struct cros_ec_device *ec_dev,
10051005
unsigned int version,
10061006
int command,
1007-
void *outdata,
1007+
const void *outdata,
10081008
size_t outsize,
10091009
void *indata,
10101010
size_t insize)

include/linux/platform_data/cros_ec_proto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ bool cros_ec_check_features(struct cros_ec_dev *ec, int feature);
258258

259259
int cros_ec_get_sensor_count(struct cros_ec_dev *ec);
260260

261-
int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command, void *outdata,
261+
int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command, const void *outdata,
262262
size_t outsize, void *indata, size_t insize);
263263

264264
/**

0 commit comments

Comments
 (0)