diff mbox

spi: signedness bug in qspi_trigger_transfer_out_int()

Message ID 20150403084527.GA27292@mwanda (mailing list archive)
State Accepted
Commit c9bc3e8bf04225968f1cee34b50216263ed58000
Headers show

Commit Message

Dan Carpenter April 3, 2015, 8:45 a.m. UTC
We need "ret" to be unsigned for the error handling to work.  The
signedness of "i" and "n" don't matter but qspi_set_send_trigger()
returns an int so I've changed them to int as well.

Fixes: 4b6fe3edcbba ('spi: Using Trigger number to transmit/receive data')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
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

Comments

Cao Minh Hiep April 3, 2015, 9:44 a.m. UTC | #1
Hi,
On 2015?04?03? 17:45, Dan Carpenter wrote:
> We need "ret" to be unsigned for the error handling to work.  The
> signedness of "i" and "n" don't matter but qspi_set_send_trigger()
> returns an int so I've changed them to int as well.
>
> Fixes: 4b6fe3edcbba ('spi: Using Trigger number to transmit/receive data')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
> index b3871d8..f6bac9e 100644
> --- a/drivers/spi/spi-rspi.c
> +++ b/drivers/spi/spi-rspi.c
> @@ -727,7 +727,7 @@ static int rspi_rz_transfer_one(struct spi_master *master,
>   static int qspi_trigger_transfer_out_int(struct rspi_data *rspi, const u8 *tx,
>   					u8 *rx, unsigned int len)
>   {
> -	unsigned int i, n, ret;
> +	int i, n, ret;
>   	int error;
>   
>   	while (len > 0) {
>
>
Thanks for your patch!

Best Regards,
Hiep.
--
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 April 6, 2015, 4:20 p.m. UTC | #2
On Fri, Apr 03, 2015 at 11:45:27AM +0300, Dan Carpenter wrote:
> We need "ret" to be unsigned for the error handling to work.  The
> signedness of "i" and "n" don't matter but qspi_set_send_trigger()
> returns an int so I've changed them to int as well.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index b3871d8..f6bac9e 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -727,7 +727,7 @@  static int rspi_rz_transfer_one(struct spi_master *master,
 static int qspi_trigger_transfer_out_int(struct rspi_data *rspi, const u8 *tx,
 					u8 *rx, unsigned int len)
 {
-	unsigned int i, n, ret;
+	int i, n, ret;
 	int error;
 
 	while (len > 0) {