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.
Unified · Split
| @@ -1004,7 +1004,7 @@ EXPORT_SYMBOL_GPL(cros_ec_get_sensor_count); · 1003 unmodified lines | ||
| 1004 | 1004 | int cros_ec_cmd(struct cros_ec_device *ec_dev, |
| 1005 | 1005 | unsigned int version, |
| 1006 | 1006 | int command, |
| 1007 | − void *outdata, | |
| 1007 | + const void *outdata, | |
| 1008 | 1008 | size_t outsize, |
| 1009 | 1009 | void *indata, |
| 1010 | 1010 | size_t insize) |
| @@ -258,7 +258,7 @@ bool cros_ec_check_features(struct cros_ec_dev *ec, int feature); · 257 unmodified lines | ||
| 258 | 258 | |
| 259 | 259 | int cros_ec_get_sensor_count(struct cros_ec_dev *ec); |
| 260 | 260 | |
| 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, | |
| 262 | 262 | size_t outsize, void *indata, size_t insize); |
| 263 | 263 | |
| 264 | 264 | /** |