提交 cc4a7ffe 编写于 作者: G Geert Uytterhoeven 提交者: Mark Brown

spi: fsl-lpspi: Pre-initialize ret in fsl_lpspi_transfer_one_msg()

With gcc 4.1.2:

    drivers/spi/spi-fsl-lpspi.c: In function ‘fsl_lpspi_transfer_one_msg’:
    drivers/spi/spi-fsl-lpspi.c:369: warning: ‘ret’ may be used uninitialized in this function

If the message contains no transfers, the function will set the
message's status to an uninitialized value, and will return that
uninitialized value.

While __spi_validate() should have been called in all paths leading to
this, and thus have rejected such messages, we better pre-initialize ret
to be safe for future modifications (spi_transfer_one_message() also
does this).
Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 fafd6794
...@@ -366,7 +366,7 @@ static int fsl_lpspi_transfer_one_msg(struct spi_master *master, ...@@ -366,7 +366,7 @@ static int fsl_lpspi_transfer_one_msg(struct spi_master *master,
struct spi_transfer *xfer; struct spi_transfer *xfer;
bool is_first_xfer = true; bool is_first_xfer = true;
u32 temp; u32 temp;
int ret; int ret = 0;
msg->status = 0; msg->status = 0;
msg->actual_length = 0; msg->actual_length = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册