Const buffers for SMBus/I2C block write functions
Hello List,
Wouldn't it help in some places, when the block write functions would take a const buffer pointer?
Please see the diff below.
Index: include/linux/i2c-dev.h
=================================--- include/linux/i2c-dev.h (revision 5881)
+++ include/linux/i2c-dev.h (working copy)
@@ -258,7 +258,7 @@
}
static inline __s32 i2c_smbus_write_block_data(int file, __u8 command,
- __u8 length, __u8 *values)
+ __u8 length, const __u8 *values)
{
union i2c_smbus_data data;
int i;
@@ -296,7 +296,7 @@
}
static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command,
- __u8 length, __u8 *values)
+ __u8 length, const __u8 *values)
{
union i2c_smbus_data data;
int i;
Roman
Signature · 8 lines
Roman Fietze Telemotive AG Buero Muehlhausen Breitwiesen 73347 Muehlhausen Tel.: +49(0)7335/18493-45 http://www.telemotive.de _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Roman,
Quoted 1 line · Roman Fietze
Hello List,
You're writing to the wrong list. I2C matters are discussed on the linux-i2c list.
Quoted 3 lines
Wouldn't it help in some places, when the block write functions would take a const buffer pointer?
When you post again on linux-i2c, make sure you explain the actual benefit of the change. "It would help in some places" isn't going to fly, especially when you don't even seem to be sure.
Quoted 26 lines
Please see the diff below.
Index:
include/linux/i2c-dev.h
=================================> ---include/linux/i2c-dev.h(revision 5881)
+++include/linux/i2c-dev.h(working copy)(quoted diff) +2
-2@@ -258,7 +258,7 @@ } static inline __s32 i2c_smbus_write_block_data(int file, __u8 command, - __u8 length, __u8 *values) + __u8 length, const __u8 *values) { union i2c_smbus_data data; int i;@@ -296,7 +296,7 @@ } static inline __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command, - __u8 length, __u8 *values) + __u8 length, const __u8 *values) { union i2c_smbus_data data; int i;
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors