Message ID | 20180226211753.10694-1-wsa@the-dreams.de |
---|---|
State | Accepted |
Headers | show |
Series | i2c: reformat comments around i2c_smbus_xfer_emulated() | expand |
On 2018-02-26 22:17, Wolfram Sang wrote: > Use Kernel coding style for better readability. > > Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Minor nit below, consider that. Whatever your decision: Reviewed-by: Peter Rosin <peda@axentia.se> > --- > drivers/i2c/i2c-core-smbus.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c > index 59d5cf376f6af4..a58faa0fc23757 100644 > --- a/drivers/i2c/i2c-core-smbus.c > +++ b/drivers/i2c/i2c-core-smbus.c > @@ -308,17 +308,21 @@ static void i2c_smbus_try_get_dmabuf(struct i2c_msg *msg, u8 init_val) > msg->buf[0] = init_val; > } > > -/* Simulate a SMBus command using the i2c protocol > - No checking of parameters is done! */ > +/* > + * Simulate a SMBus command using the i2c protocol. I2C? > + * No checking of parameters is done! > + */ > static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, > unsigned short flags, > char read_write, u8 command, int size, > union i2c_smbus_data *data) > { > - /* So we need to generate a series of msgs. In the case of writing, we > - need to use only one message; when reading, we need two. We initialize > - most things with sane defaults, to keep the code below somewhat > - simpler. */ > + /* > + * So we need to generate a series of msgs. In the case of writing, we > + * need to use only one message; when reading, we need two. We > + * initialize most things with sane defaults, to keep the code below > + * somewhat simpler. > + */ > unsigned char msgbuf0[I2C_SMBUS_BLOCK_MAX+3]; > unsigned char msgbuf1[I2C_SMBUS_BLOCK_MAX+2]; > int num = read_write == I2C_SMBUS_READ ? 2 : 1; >
> > + * Simulate a SMBus command using the i2c protocol. > > I2C? Yup, thanks!
On Mon, Feb 26, 2018 at 10:17:53PM +0100, Wolfram Sang wrote: > Use Kernel coding style for better readability. > > Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Applied to for-next, with Peter's comment addressed.
diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c index 59d5cf376f6af4..a58faa0fc23757 100644 --- a/drivers/i2c/i2c-core-smbus.c +++ b/drivers/i2c/i2c-core-smbus.c @@ -308,17 +308,21 @@ static void i2c_smbus_try_get_dmabuf(struct i2c_msg *msg, u8 init_val) msg->buf[0] = init_val; } -/* Simulate a SMBus command using the i2c protocol - No checking of parameters is done! */ +/* + * Simulate a SMBus command using the i2c protocol. + * No checking of parameters is done! + */ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) { - /* So we need to generate a series of msgs. In the case of writing, we - need to use only one message; when reading, we need two. We initialize - most things with sane defaults, to keep the code below somewhat - simpler. */ + /* + * So we need to generate a series of msgs. In the case of writing, we + * need to use only one message; when reading, we need two. We + * initialize most things with sane defaults, to keep the code below + * somewhat simpler. + */ unsigned char msgbuf0[I2C_SMBUS_BLOCK_MAX+3]; unsigned char msgbuf1[I2C_SMBUS_BLOCK_MAX+2]; int num = read_write == I2C_SMBUS_READ ? 2 : 1;
Use Kernel coding style for better readability. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> --- drivers/i2c/i2c-core-smbus.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)