From: Krzysztof Halasa <khc@pm.waw.pl>
To: Jean Delvare <khali@linux-fr.org>
Cc: <linux-kernel@vger.kernel.org>, lm-sensors@lm-sensors.org
Subject: [PATCH] I2C: *write_block* doesn't modify the data - mark as const
Date: Tue, 06 Jun 2006 16:41:09 +0200 [thread overview]
Message-ID: <m364jez6re.fsf@defiant.localdomain> (raw)
The attached patch marks i2c_smbus_write_block_data() and
i2c_smbus_write_i2c_block_data() buffers as const.
Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -916,6 +916,6 @@ s32 i2c_smbus_write_word_data(struct i2c
}
s32 i2c_smbus_write_block_data(struct i2c_client *client, u8 command,
- u8 length, u8 *values)
+ u8 length, const u8 *values)
{
union i2c_smbus_data data;
@@ -947,7 +947,7 @@ s32 i2c_smbus_read_i2c_block_data(struct
}
s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, u8 command,
- u8 length, u8 *values)
+ u8 length, const u8 *values)
{
union i2c_smbus_data data;
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -94,15 +94,14 @@ extern s32 i2c_smbus_write_byte_data(str
extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command);
extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
u8 command, u16 value);
-extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
- u8 command, u8 length,
- u8 *values);
+extern s32 i2c_smbus_write_block_data(struct i2c_client * client, u8 command,
+ u8 length, const u8 *values);
/* Returns the number of read bytes */
extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
u8 command, u8 *values);
extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
u8 command, u8 length,
- u8 *values);
+ const u8 *values);
/*
* A driver is capable of handling one or more physical devices present on
next reply other threads:[~2006-06-06 14:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-06 14:41 Krzysztof Halasa [this message]
2006-06-06 17:50 ` Jean Delvare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m364jez6re.fsf@defiant.localdomain \
--to=khc@pm.waw.pl \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®