diff for duplicates of <4FFF23DD.8050100@kernel.org> diff --git a/a/1.txt b/N1/1.txt index 19bc12f..10717a1 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -2,25 +2,21 @@ On 07/11/2012 09:01 AM, Lars-Peter Clausen wrote: > Move the SPI and I2C specific write callbacks to the respective > "#if IS_ENABLED(CONFIG_SPI_MASTER)" and "#if IS_ENABLED(CONFIG_I2C)" > protected sections of the code. ->=20 +> > This fixes the following warning which occurs if CONFIG_I2C is not set: -> drivers/iio/dac/ad5064.c: In function =E2=80=98ad5064_i2c_write=E2=80=99= -: -> drivers/iio/dac/ad5064.c:132: error: implicit declaration of function = -=E2=80=98i2c_master_send=E2=80=99 ->=20 -> And the follwing warning which occurs when CONFIG_SPI_MASTER is not set= -: -> drivers/iio/dac/ad5064.c:137: warning: =E2=80=98ad5064_spi_write=E2=80= -=99 defined but not used ->=20 +> drivers/iio/dac/ad5064.c: In function ‘ad5064_i2c_write’: +> drivers/iio/dac/ad5064.c:132: error: implicit declaration of function ‘i2c_master_send’ +> +> And the follwing warning which occurs when CONFIG_SPI_MASTER is not set: +> drivers/iio/dac/ad5064.c:137: warning: ‘ad5064_spi_write’ defined but not used +> > Reported-by: Randy Dunlap <rdunlap@xenotime.net> > Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> merged to fixes-togreg and pull request sent. > --- > drivers/iio/dac/ad5064.c | 38 +++++++++++++++++++------------------- > 1 file changed, 19 insertions(+), 19 deletions(-) ->=20 +> > diff --git a/drivers/iio/dac/ad5064.c b/drivers/iio/dac/ad5064.c > index aa739c4..de2c368 100644 > --- a/drivers/iio/dac/ad5064.c @@ -28,13 +24,13 @@ merged to fixes-togreg and pull request sent. > @@ -122,25 +122,6 @@ enum ad5064_type { > ID_AD5668_2, > }; -> =20 +> > -static int ad5064_i2c_write(struct ad5064_state *st, unsigned int cmd, > - unsigned int addr, unsigned int val) > -{ -> - struct i2c_client *i2c =3D to_i2c_client(st->dev); +> - struct i2c_client *i2c = to_i2c_client(st->dev); > - -> - st->data.i2c[0] =3D (cmd << 4) | addr; +> - st->data.i2c[0] = (cmd << 4) | addr; > - put_unaligned_be16(val, &st->data.i2c[1]); > - return i2c_master_send(i2c, st->data.i2c, 3); > -} @@ -42,45 +38,41 @@ merged to fixes-togreg and pull request sent. > -static int ad5064_spi_write(struct ad5064_state *st, unsigned int cmd, > - unsigned int addr, unsigned int val) > -{ -> - struct spi_device *spi =3D to_spi_device(st->dev); +> - struct spi_device *spi = to_spi_device(st->dev); > - -> - st->data.spi =3D cpu_to_be32(AD5064_CMD(cmd) | AD5064_ADDR(addr) | va= -l); +> - st->data.spi = cpu_to_be32(AD5064_CMD(cmd) | AD5064_ADDR(addr) | val); > - return spi_write(spi, &st->data.spi, sizeof(st->data.spi)); > -} > - > static int ad5064_write(struct ad5064_state *st, unsigned int cmd, > unsigned int addr, unsigned int val, unsigned int shift) > { -> @@ -533,6 +514,15 @@ static int __devexit ad5064_remove(struct device *= -dev) -> =20 +> @@ -533,6 +514,15 @@ static int __devexit ad5064_remove(struct device *dev) +> > #if IS_ENABLED(CONFIG_SPI_MASTER) -> =20 +> > +static int ad5064_spi_write(struct ad5064_state *st, unsigned int cmd, > + unsigned int addr, unsigned int val) > +{ -> + struct spi_device *spi =3D to_spi_device(st->dev); +> + struct spi_device *spi = to_spi_device(st->dev); > + -> + st->data.spi =3D cpu_to_be32(AD5064_CMD(cmd) | AD5064_ADDR(addr) | va= -l); +> + st->data.spi = cpu_to_be32(AD5064_CMD(cmd) | AD5064_ADDR(addr) | val); > + return spi_write(spi, &st->data.spi, sizeof(st->data.spi)); > +} > + > static int __devinit ad5064_spi_probe(struct spi_device *spi) > { -> const struct spi_device_id *id =3D spi_get_device_id(spi); -> @@ -596,6 +586,16 @@ static inline void ad5064_spi_unregister_driver(vo= -id) { } -> =20 +> const struct spi_device_id *id = spi_get_device_id(spi); +> @@ -596,6 +586,16 @@ static inline void ad5064_spi_unregister_driver(void) { } +> > #if IS_ENABLED(CONFIG_I2C) -> =20 +> > +static int ad5064_i2c_write(struct ad5064_state *st, unsigned int cmd, > + unsigned int addr, unsigned int val) > +{ -> + struct i2c_client *i2c =3D to_i2c_client(st->dev); +> + struct i2c_client *i2c = to_i2c_client(st->dev); > + -> + st->data.i2c[0] =3D (cmd << 4) | addr; +> + st->data.i2c[0] = (cmd << 4) | addr; > + put_unaligned_be16(val, &st->data.i2c[1]); > + return i2c_master_send(i2c, st->data.i2c, 3); > +} @@ -88,4 +80,4 @@ id) { } > static int __devinit ad5064_i2c_probe(struct i2c_client *i2c, > const struct i2c_device_id *id) > { ->=20 +> diff --git a/a/content_digest b/N1/content_digest index f1f151f..6ea0ef9 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -14,25 +14,21 @@ "> Move the SPI and I2C specific write callbacks to the respective\n" "> \"#if IS_ENABLED(CONFIG_SPI_MASTER)\" and \"#if IS_ENABLED(CONFIG_I2C)\"\n" "> protected sections of the code.\n" - ">=20\n" + "> \n" "> This fixes the following warning which occurs if CONFIG_I2C is not set:\n" - "> \tdrivers/iio/dac/ad5064.c: In function =E2=80=98ad5064_i2c_write=E2=80=99=\n" - ":\n" - "> \tdrivers/iio/dac/ad5064.c:132: error: implicit declaration of function =\n" - "=E2=80=98i2c_master_send=E2=80=99\n" - ">=20\n" - "> And the follwing warning which occurs when CONFIG_SPI_MASTER is not set=\n" - ":\n" - "> \tdrivers/iio/dac/ad5064.c:137: warning: =E2=80=98ad5064_spi_write=E2=80=\n" - "=99 defined but not used\n" - ">=20\n" + "> \tdrivers/iio/dac/ad5064.c: In function \342\200\230ad5064_i2c_write\342\200\231:\n" + "> \tdrivers/iio/dac/ad5064.c:132: error: implicit declaration of function \342\200\230i2c_master_send\342\200\231\n" + "> \n" + "> And the follwing warning which occurs when CONFIG_SPI_MASTER is not set:\n" + "> \tdrivers/iio/dac/ad5064.c:137: warning: \342\200\230ad5064_spi_write\342\200\231 defined but not used\n" + "> \n" "> Reported-by: Randy Dunlap <rdunlap@xenotime.net>\n" "> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>\n" "merged to fixes-togreg and pull request sent.\n" "> ---\n" "> drivers/iio/dac/ad5064.c | 38 +++++++++++++++++++-------------------\n" "> 1 file changed, 19 insertions(+), 19 deletions(-)\n" - ">=20\n" + "> \n" "> diff --git a/drivers/iio/dac/ad5064.c b/drivers/iio/dac/ad5064.c\n" "> index aa739c4..de2c368 100644\n" "> --- a/drivers/iio/dac/ad5064.c\n" @@ -40,13 +36,13 @@ "> @@ -122,25 +122,6 @@ enum ad5064_type {\n" "> \tID_AD5668_2,\n" "> };\n" - "> =20\n" + "> \n" "> -static int ad5064_i2c_write(struct ad5064_state *st, unsigned int cmd,\n" "> -\tunsigned int addr, unsigned int val)\n" "> -{\n" - "> -\tstruct i2c_client *i2c =3D to_i2c_client(st->dev);\n" + "> -\tstruct i2c_client *i2c = to_i2c_client(st->dev);\n" "> -\n" - "> -\tst->data.i2c[0] =3D (cmd << 4) | addr;\n" + "> -\tst->data.i2c[0] = (cmd << 4) | addr;\n" "> -\tput_unaligned_be16(val, &st->data.i2c[1]);\n" "> -\treturn i2c_master_send(i2c, st->data.i2c, 3);\n" "> -}\n" @@ -54,45 +50,41 @@ "> -static int ad5064_spi_write(struct ad5064_state *st, unsigned int cmd,\n" "> -\tunsigned int addr, unsigned int val)\n" "> -{\n" - "> -\tstruct spi_device *spi =3D to_spi_device(st->dev);\n" + "> -\tstruct spi_device *spi = to_spi_device(st->dev);\n" "> -\n" - "> -\tst->data.spi =3D cpu_to_be32(AD5064_CMD(cmd) | AD5064_ADDR(addr) | va=\n" - "l);\n" + "> -\tst->data.spi = cpu_to_be32(AD5064_CMD(cmd) | AD5064_ADDR(addr) | val);\n" "> -\treturn spi_write(spi, &st->data.spi, sizeof(st->data.spi));\n" "> -}\n" "> -\n" "> static int ad5064_write(struct ad5064_state *st, unsigned int cmd,\n" "> \tunsigned int addr, unsigned int val, unsigned int shift)\n" "> {\n" - "> @@ -533,6 +514,15 @@ static int __devexit ad5064_remove(struct device *=\n" - "dev)\n" - "> =20\n" + "> @@ -533,6 +514,15 @@ static int __devexit ad5064_remove(struct device *dev)\n" + "> \n" "> #if IS_ENABLED(CONFIG_SPI_MASTER)\n" - "> =20\n" + "> \n" "> +static int ad5064_spi_write(struct ad5064_state *st, unsigned int cmd,\n" "> +\tunsigned int addr, unsigned int val)\n" "> +{\n" - "> +\tstruct spi_device *spi =3D to_spi_device(st->dev);\n" + "> +\tstruct spi_device *spi = to_spi_device(st->dev);\n" "> +\n" - "> +\tst->data.spi =3D cpu_to_be32(AD5064_CMD(cmd) | AD5064_ADDR(addr) | va=\n" - "l);\n" + "> +\tst->data.spi = cpu_to_be32(AD5064_CMD(cmd) | AD5064_ADDR(addr) | val);\n" "> +\treturn spi_write(spi, &st->data.spi, sizeof(st->data.spi));\n" "> +}\n" "> +\n" "> static int __devinit ad5064_spi_probe(struct spi_device *spi)\n" "> {\n" - "> \tconst struct spi_device_id *id =3D spi_get_device_id(spi);\n" - "> @@ -596,6 +586,16 @@ static inline void ad5064_spi_unregister_driver(vo=\n" - "id) { }\n" - "> =20\n" + "> \tconst struct spi_device_id *id = spi_get_device_id(spi);\n" + "> @@ -596,6 +586,16 @@ static inline void ad5064_spi_unregister_driver(void) { }\n" + "> \n" "> #if IS_ENABLED(CONFIG_I2C)\n" - "> =20\n" + "> \n" "> +static int ad5064_i2c_write(struct ad5064_state *st, unsigned int cmd,\n" "> +\tunsigned int addr, unsigned int val)\n" "> +{\n" - "> +\tstruct i2c_client *i2c =3D to_i2c_client(st->dev);\n" + "> +\tstruct i2c_client *i2c = to_i2c_client(st->dev);\n" "> +\n" - "> +\tst->data.i2c[0] =3D (cmd << 4) | addr;\n" + "> +\tst->data.i2c[0] = (cmd << 4) | addr;\n" "> +\tput_unaligned_be16(val, &st->data.i2c[1]);\n" "> +\treturn i2c_master_send(i2c, st->data.i2c, 3);\n" "> +}\n" @@ -100,6 +92,6 @@ "> static int __devinit ad5064_i2c_probe(struct i2c_client *i2c,\n" "> \tconst struct i2c_device_id *id)\n" "> {\n" - >=20 + > -e3ea78d866f0b334ffd9c5e2a5f4e952dd034b19b03219700157c7d029c46aa4 +2537951cb7ef0ddb15d56c78c317575ab3ed246a1deece8439e842fe73373128
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.