History

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.

Stephen Boyd committed 3 years ago

Commit 2f3dd391 parent 14e7c012 files · +2 −2Browse files

Unified · Split

2 files
  1. drivers/platform/chrome/cros_ec_proto.c +1 −1
  2. include/linux/platform_data/cros_ec_proto.h +1 −1
drivers/platform/chrome/cros_ec_proto.c+1−1
@@ -1004,7 +1004,7 @@ EXPORT_SYMBOL_GPL(cros_ec_get_sensor_count); · 1003 unmodified lines
1004int cros_ec_cmd(struct cros_ec_device *ec_dev,1004int cros_ec_cmd(struct cros_ec_device *ec_dev,
1005 unsigned int version,1005 unsigned int version,
1006 int command,1006 int command,
1007 void *outdata,1007 const void *outdata,
1008 size_t outsize,1008 size_t outsize,
1009 void *indata,1009 void *indata,
1010 size_t insize)1010 size_t insize)
include/linux/platform_data/cros_ec_proto.h+1−1
@@ -258,7 +258,7 @@ bool cros_ec_check_features(struct cros_ec_dev *ec, int feature); · 257 unmodified lines
258 258
259int cros_ec_get_sensor_count(struct cros_ec_dev *ec);259int cros_ec_get_sensor_count(struct cros_ec_dev *ec);
260 260
261int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command, void *outdata,261int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command, const void *outdata,
262 size_t outsize, void *indata, size_t insize);262 size_t outsize, void *indata, size_t insize);
263 263
264/**264/**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t