[Fwd: Minor patch to w1]
PATCH 1/1 [Fwd: Minor patch to w1]
-------- Original Message --------
Subject: Minor patch to w1
Date: Mon, 08 Dec 2008 21:46:05 +0000
From: Jack <[email protected]>
To: [email protected]
Hello Evgeniy,
Please accept my patch for the removal of const on a few functions. This resolves a compile time warning in w1. The buffer parameter ('buf') is definitely not const, since it is always written to after a read.
Of course, I'm a bit new to kernel development, so perhaps I'm missing something. If that is the case, I would appreciate an explanation, so that I won't make the same mistake again.
Regards,
Jack
-------------------------------------------------------------------------------------------
drivers/w1/masters/ds2490.c +0 -0
@@ -819,7 +819,7 @@ static u8 ds9490r_read_byte(void *data)return byte;
}
-static void ds9490r_write_block(void *data, const u8 *buf, int len) +static void ds9490r_write_block(void *data, u8 *buf, int len)
{
struct ds_device *dev = data;drivers/w1/slaves/w1_ds2433.c +0 -0
@@ -154,7 +154,7 @@ out_up:
* @param data The data to write
* @return 0=Success -1=failure
*/
-static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data) +static int w1_f23_write(struct w1_slave *sl, int addr, int len, u8 *data)
{
u8 wrbuf[4];
u8 rdbuf[W1_PAGE_SIZE + 3];drivers/w1/w1.h +1 -1
@@ -127,7 +127,7 @@ struct w1_bus_masteru8 (*read_block)(void *,u8 *,int );/** Same as a series of write_byte() calls */ -void (*write_block)(void *,const u8 *,int ); +void (*write_block)(void *,u8 *,int );/** * Combines two reads and a smart write for ROM searches
@@ -209,7 +209,7 @@ void w1_write_8(struct w1_master *, u8);
u8 w1_read_8(struct w1_master *);
int w1_reset_bus(struct w1_master *);
u8 w1_calc_crc8(u8 *, int);
-void w1_write_block(struct w1_master *, const u8 *, int); +void w1_write_block(struct w1_master *, u8 *, int); u8 w1_read_block(struct w1_master *, u8 *, int); int w1_reset_select_slave(struct w1_slave *sl); void w1_next_pullup(struct w1_master *, int);
drivers/w1/w1_io.c +0 -0
@@ -240,7 +240,7 @@ EXPORT_SYMBOL_GPL(w1_read_8);
* @param len the number of bytes to write
* @return the byte read
*/
-void w1_write_block(struct w1_master *dev, const u8 *buf, int len) +void w1_write_block(struct w1_master *dev, u8 *buf, int len)
{
int i;