buf[4] = BIN2BCD(dt->tm_wday) + 1; 
buf[4] = BIN2BCD(dt->tm_wday + 1); 
static int ds1337_set_datetime(struct i2c_client *client, struct rtc_time *dt){	int result;	u8 buf[8];	u8 val;	struct i2c_msg msg[1];	if (!dt) {		dev_dbg(&client->dev, "%s: EINVAL: dt=NULL\n", __FUNCTION__);		return -EINVAL;	}	dev_dbg(&client->dev, "%s: secs=%d, mins=%d, hours=%d, "		"mday=%d, mon=%d, year=%d, wday=%d\n", __FUNCTION__,		dt->tm_sec, dt->tm_min, dt->tm_hour,		dt->tm_mday, dt->tm_mon, dt->tm_year, dt->tm_wday);	buf[0] = 0;		/* reg offset */	buf[1] = BIN2BCD(dt->tm_sec);	buf[2] = BIN2BCD(dt->tm_min);	buf[3] = BIN2BCD(dt->tm_hour);	buf[4] = BIN2BCD(dt->tm_wday) + 1;	buf[5] = BIN2BCD(dt->tm_mday);	buf[6] = BIN2BCD(dt->tm_mon) + 1;	val = dt->tm_year;	if (val >= 100) {		val -= 100;		buf[6] |= (1 << 7);	}	buf[7] = BIN2BCD(val);	msg[0].addr = client->addr;	msg[0].flags = 0;	msg[0].len = sizeof(buf);	msg[0].buf = &buf[0];	result = i2c_transfer(client->adapter, msg, 1);	if (result == 1)		return 0;	dev_err(&client->dev, "error writing data! %d\n", result);	return -EIO;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/ef9627464490fe67235bbd5724d55345b92c0315/ds1337.c/buggy/drivers/i2c/chips/ds1337.c