public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] i2c: s3c2410: change return type of 'i2c_s3c_irq_nextbyte' from 'int' to 'void'
@ 2022-05-06 12:26 Yihao Han
  2022-05-06 13:31 ` Krzysztof Kozlowski
  2022-05-07  3:31 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Yihao Han @ 2022-05-06 12:26 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, linux-i2c, linux-arm-kernel,
	linux-samsung-soc, linux-kernel
  Cc: kernel, Yihao Han

Since ret is a redundant variable, and none of the callers check
for return, so remove ret variable and change return type of
'i2c_s3c_irq_nextbyte' from 'int' to 'void'

Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
v2: add return in STATE_IDLE case
---
 drivers/i2c/busses/i2c-s3c2410.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index b49a1b170bb2..d2a1fd2aa7a0 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -381,17 +381,16 @@ static inline int is_msgend(struct s3c24xx_i2c *i2c)
 /*
  * process an interrupt and work out what to do
  */
-static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
+static void i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
 {
 	unsigned long tmp;
 	unsigned char byte;
-	int ret = 0;
 
 	switch (i2c->state) {
 
 	case STATE_IDLE:
 		dev_err(i2c->dev, "%s: called in STATE_IDLE\n", __func__);
-		goto out;
+		return;
 
 	case STATE_STOP:
 		dev_err(i2c->dev, "%s: called in STATE_STOP\n", __func__);
@@ -547,8 +546,6 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
 	tmp = readl(i2c->regs + S3C2410_IICCON);
 	tmp &= ~S3C2410_IICCON_IRQPEND;
 	writel(tmp, i2c->regs + S3C2410_IICCON);
- out:
-	return ret;
 }
 
 /*
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-07  3:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-06 12:26 [PATCH v2] i2c: s3c2410: change return type of 'i2c_s3c_irq_nextbyte' from 'int' to 'void' Yihao Han
2022-05-06 13:31 ` Krzysztof Kozlowski
2022-05-07  3:31 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox