diff mbox

spi: spi-fsl-spi: Return an error code in fsl_spi_do_one_msg()

Message ID 1417698947-4273-1-git-send-email-fabio.estevam@freescale.com (mailing list archive)
State Accepted
Commit 75c410884aff0c502dcb34cc58997e67e9b61e5f
Headers show

Commit Message

Fabio Estevam Dec. 4, 2014, 1:15 p.m. UTC
Since commit c592becbe704127 ("spi: fsl-(e)spi: migrate to generic master
queueing") the function fsl_spi_do_one_msg() is not void anymore, so return
an error code to avoid the following buid warning:

   drivers/spi/spi-fsl-spi.c: In function 'fsl_spi_do_one_msg':
>> drivers/spi/spi-fsl-spi.c:374:4: warning: 'return' with no value, in function returning non-void [-Wreturn-type]
       return;
       ^

Reported-by: kbuild test robot <fengguang.wu@intel.com> 
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/spi/spi-fsl-spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heiner Kallweit Dec. 4, 2014, 6:18 p.m. UTC | #1
Am 04.12.2014 um 15:12 schrieb Fabio Estevam:
> On Thu, Dec 4, 2014 at 11:25 AM, Heiner Kallweit <hkallweit1@gmail.com> wrote:
>> Right, missed that. However the code was bogus before, the status = -EINVAL
>> didn't make sense as the value of variable status isn't used before the
>> return.
>> Therefore we can remove the "status = -EINVAL".
> 
> Yes, I noticed that as well.
> 
>> Shall I submit a patch or what would be your preferred approach?
> 
> Yes, may be it would be better if you could submit a fix for this as
> separate patch, after Mark applies this one, so that we avoid
> conflicts.
> 
OK, just submitted the fix as a separate patch.

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Fabio Estevam Dec. 4, 2014, 6:52 p.m. UTC | #2
On Thu, Dec 4, 2014 at 4:18 PM, Heiner Kallweit <hkallweit1@gmail.com> wrote:

> OK, just submitted the fix as a separate patch.

You mixed the two fixes in one patch. That was not really what I suggested.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Heiner Kallweit Dec. 4, 2014, 7:29 p.m. UTC | #3
Am 04.12.2014 um 19:52 schrieb Fabio Estevam:
> On Thu, Dec 4, 2014 at 4:18 PM, Heiner Kallweit <hkallweit1@gmail.com> wrote:
> 
>> OK, just submitted the fix as a separate patch.
> 
> You mixed the two fixes in one patch. That was not really what I suggested.
> 
Sorry, was a misunderstanding. I re-sent the fix with only removing the
unused variable assignment.

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Dec. 4, 2014, 10:44 p.m. UTC | #4
On Thu, Dec 04, 2014 at 11:15:47AM -0200, Fabio Estevam wrote:
> Since commit c592becbe704127 ("spi: fsl-(e)spi: migrate to generic master
> queueing") the function fsl_spi_do_one_msg() is not void anymore, so return
> an error code to avoid the following buid warning:

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index e24a9bf..83f8081 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -371,7 +371,7 @@  static int fsl_spi_do_one_msg(struct spi_master *master,
 			status = -EINVAL;
 			dev_err(&spi->dev,
 				"bits_per_word/speed_hz should be same for the same SPI transfer\n");
-			return;
+			return -EINVAL;
 		}
 	}