diff mbox series

[12/20] media: au0828-i2c: drop a duplicated function

Message ID 1c5aeba00713d643e6f5600090b68e3d3689c5dd.1637781097.git.mchehab+huawei@kernel.org (mailing list archive)
State New, archived
Headers show
Series Solve the remaining issues with clang and W=1 on media | expand

Commit Message

Mauro Carvalho Chehab Nov. 24, 2021, 7:13 p.m. UTC
This function is not used and it is identical to
i2c_slave_did_read_ack(). So, just drop it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---

To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH 00/20] at: https://lore.kernel.org/all/cover.1637781097.git.mchehab+huawei@kernel.org/

 drivers/media/usb/au0828/au0828-i2c.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Nathan Chancellor Nov. 26, 2021, 8:22 p.m. UTC | #1
On Wed, Nov 24, 2021 at 08:13:15PM +0100, Mauro Carvalho Chehab wrote:
> This function is not used and it is identical to
> i2c_slave_did_read_ack(). So, just drop it.

Not quite, i2c_slave_did_write_ack() checks against
AU0828_I2C_STATUS_NO_WRITE_ACK, whereas i2c_slave_did_read_ack() checks
against AU0828_I2C_STATUS_NO_READ_ACK.

> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Regardless of that, it is unused and I do not see anywhere obvious where
it should be.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
> 
> To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
> See [PATCH 00/20] at: https://lore.kernel.org/all/cover.1637781097.git.mchehab+huawei@kernel.org/
> 
>  drivers/media/usb/au0828/au0828-i2c.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/media/usb/au0828/au0828-i2c.c b/drivers/media/usb/au0828/au0828-i2c.c
> index 708f01ab47fa..749f90d73b5b 100644
> --- a/drivers/media/usb/au0828/au0828-i2c.c
> +++ b/drivers/media/usb/au0828/au0828-i2c.c
> @@ -23,13 +23,6 @@ MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time");
>  #define I2C_WAIT_DELAY 25
>  #define I2C_WAIT_RETRY 1000
>  
> -static inline int i2c_slave_did_write_ack(struct i2c_adapter *i2c_adap)
> -{
> -	struct au0828_dev *dev = i2c_adap->algo_data;
> -	return au0828_read(dev, AU0828_I2C_STATUS_201) &
> -		AU0828_I2C_STATUS_NO_WRITE_ACK ? 0 : 1;
> -}
> -
>  static inline int i2c_slave_did_read_ack(struct i2c_adapter *i2c_adap)
>  {
>  	struct au0828_dev *dev = i2c_adap->algo_data;
> -- 
> 2.33.1
> 
>
diff mbox series

Patch

diff --git a/drivers/media/usb/au0828/au0828-i2c.c b/drivers/media/usb/au0828/au0828-i2c.c
index 708f01ab47fa..749f90d73b5b 100644
--- a/drivers/media/usb/au0828/au0828-i2c.c
+++ b/drivers/media/usb/au0828/au0828-i2c.c
@@ -23,13 +23,6 @@  MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time");
 #define I2C_WAIT_DELAY 25
 #define I2C_WAIT_RETRY 1000
 
-static inline int i2c_slave_did_write_ack(struct i2c_adapter *i2c_adap)
-{
-	struct au0828_dev *dev = i2c_adap->algo_data;
-	return au0828_read(dev, AU0828_I2C_STATUS_201) &
-		AU0828_I2C_STATUS_NO_WRITE_ACK ? 0 : 1;
-}
-
 static inline int i2c_slave_did_read_ack(struct i2c_adapter *i2c_adap)
 {
 	struct au0828_dev *dev = i2c_adap->algo_data;