diff mbox series

[LINUX,3/4] dmaengine: xilinx_dma: Fix compilation warning

Message ID 1513851098-15787-4-git-send-email-appanad@xilinx.com
State New
Headers show
Series dmaengine: xilinx_dma: Bug fixes | expand

Commit Message

Appana Durga Kedareswara rao Dec. 21, 2017, 10:11 a.m. UTC
This patch fixes the below sparse warning in the driver
drivers/dma/xilinx/xilinx_dma.c: In function ‘xilinx_vdma_dma_prep_interleaved’:
drivers/dma/xilinx/xilinx_dma.c:1614:43: warning: variable ‘prev’ set but not used [-Wunused-but-set-variable]
  struct xilinx_vdma_tx_segment *segment, *prev = NULL;

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
 drivers/dma/xilinx/xilinx_dma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Vinod Koul Jan. 3, 2018, 3:59 a.m. UTC | #1
On Thu, Dec 21, 2017 at 03:41:37PM +0530, Kedareswara rao Appana wrote:

Fix title here too

BTW whats with LINUX tag in patches, pls drop them

> This patch fixes the below sparse warning in the driver
> drivers/dma/xilinx/xilinx_dma.c: In function ‘xilinx_vdma_dma_prep_interleaved’:
> drivers/dma/xilinx/xilinx_dma.c:1614:43: warning: variable ‘prev’ set but not used [-Wunused-but-set-variable]
>   struct xilinx_vdma_tx_segment *segment, *prev = NULL;
> 
> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
> ---
>  drivers/dma/xilinx/xilinx_dma.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index 8467671..845e638 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -1611,7 +1611,7 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan,
>  {
>  	struct xilinx_dma_chan *chan = to_xilinx_chan(dchan);
>  	struct xilinx_dma_tx_descriptor *desc;
> -	struct xilinx_vdma_tx_segment *segment, *prev = NULL;
> +	struct xilinx_vdma_tx_segment *segment;
>  	struct xilinx_vdma_desc_hw *hw;
>  
>  	if (!is_slave_direction(xt->dir))
> @@ -1665,8 +1665,6 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan,
>  	/* Insert the segment into the descriptor segments list. */
>  	list_add_tail(&segment->node, &desc->segments);
>  
> -	prev = segment;
> -
>  	/* Link the last hardware descriptor with the first. */
>  	segment = list_first_entry(&desc->segments,
>  				   struct xilinx_vdma_tx_segment, node);
> -- 
> 2.7.4
>
Appana Durga Kedareswara Rao Jan. 3, 2018, 5:13 a.m. UTC | #2
Hi Vinod,

	Thanks for the review... 

>

>On Thu, Dec 21, 2017 at 03:41:37PM +0530, Kedareswara rao Appana wrote:

>

>Fix title here too


Sure will fix in v2... 

>

>BTW whats with LINUX tag in patches, pls drop them


Ok will mention the Linux tag info in the cover letter patch from the next patch series on wards...

Regards,
Kedar.

>

>> This patch fixes the below sparse warning in the driver

>> drivers/dma/xilinx/xilinx_dma.c: In function

>‘xilinx_vdma_dma_prep_interleaved’:

>> drivers/dma/xilinx/xilinx_dma.c:1614:43: warning: variable ‘prev’ set but not

>used [-Wunused-but-set-variable]

>>   struct xilinx_vdma_tx_segment *segment, *prev = NULL;

>>

>> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>

>> ---

>>  drivers/dma/xilinx/xilinx_dma.c | 4 +---

>>  1 file changed, 1 insertion(+), 3 deletions(-)

>>

>> diff --git a/drivers/dma/xilinx/xilinx_dma.c

>> b/drivers/dma/xilinx/xilinx_dma.c index 8467671..845e638 100644

>> --- a/drivers/dma/xilinx/xilinx_dma.c

>> +++ b/drivers/dma/xilinx/xilinx_dma.c

>> @@ -1611,7 +1611,7 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan

>> *dchan,  {

>>  	struct xilinx_dma_chan *chan = to_xilinx_chan(dchan);

>>  	struct xilinx_dma_tx_descriptor *desc;

>> -	struct xilinx_vdma_tx_segment *segment, *prev = NULL;

>> +	struct xilinx_vdma_tx_segment *segment;

>>  	struct xilinx_vdma_desc_hw *hw;

>>

>>  	if (!is_slave_direction(xt->dir))

>> @@ -1665,8 +1665,6 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan

>*dchan,

>>  	/* Insert the segment into the descriptor segments list. */

>>  	list_add_tail(&segment->node, &desc->segments);

>>

>> -	prev = segment;

>> -

>>  	/* Link the last hardware descriptor with the first. */

>>  	segment = list_first_entry(&desc->segments,

>>  				   struct xilinx_vdma_tx_segment, node);

>> --

>> 2.7.4

>>

>

>--

>~Vinod
Vinod Koul Jan. 3, 2018, 5:27 a.m. UTC | #3
On Wed, Jan 03, 2018 at 05:13:29AM +0000, Appana Durga Kedareswara Rao wrote:
> Hi Vinod,
> 
> 	Thanks for the review... 
> 
> >
> >On Thu, Dec 21, 2017 at 03:41:37PM +0530, Kedareswara rao Appana wrote:
> >
> >Fix title here too
> 
> Sure will fix in v2... 
> 
> >
> >BTW whats with LINUX tag in patches, pls drop them
> 
> Ok will mention the Linux tag info in the cover letter patch from the next
> patch series on wards...

Please wrap your replies within 80chars. It is very hard to read! I have
reflown for readability

Can you explain what you mean by that info, what are you trying to convey?
Appana Durga Kedareswara Rao Jan. 3, 2018, 6:10 a.m. UTC | #4
Hi Vinod,


>On Wed, Jan 03, 2018 at 05:13:29AM +0000, Appana Durga Kedareswara Rao
>wrote:
>> Hi Vinod,
>>
>> 	Thanks for the review...
>>
>> >
>> >On Thu, Dec 21, 2017 at 03:41:37PM +0530, Kedareswara rao Appana wrote:
>> >
>> >Fix title here too
>>
>> Sure will fix in v2...
>>
>> >
>> >BTW whats with LINUX tag in patches, pls drop them
>>
>> Ok will mention the Linux tag info in the cover letter patch from the
>> next patch series on wards...
>
>Please wrap your replies within 80chars. It is very hard to read! I have reflown for
>readability

Sure will take care of it next time onwards... 

>
>Can you explain what you mean by that info, what are you trying to convey?

What I mean here is will mention the Linux kernel tag
Information in the cover letter patch...

Regards,
Kedar.

>
>--
>~Vinod
Appana Durga Kedareswara Rao Jan. 3, 2018, 9:09 a.m. UTC | #5
Hi,

<Snip>
>>> >BTW whats with LINUX tag in patches, pls drop them
>>>
>>> Ok will mention the Linux tag info in the cover letter patch from the
>>> next patch series on wards...
>>
>>Please wrap your replies within 80chars. It is very hard to read! I have reflown
>for
>>readability
>
>Sure will take care of it next time onwards...
>
>>
>>Can you explain what you mean by that info, what are you trying to convey?
>
>What I mean here is will mention the Linux kernel tag
>Information in the cover letter patch...

Oops sorry I misunderstood your comment... 
In my company we have internally different projects
To differentiate b/w them we usually use LINUX prefix
By mistake I have added the LINUX prefix in this patch series
I have removed it in the v2 series... 

Regards,
Kedar.

>
>Regards,
>Kedar.
>
>>
>>--
>>~Vinod
diff mbox series

Patch

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 8467671..845e638 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -1611,7 +1611,7 @@  xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan,
 {
 	struct xilinx_dma_chan *chan = to_xilinx_chan(dchan);
 	struct xilinx_dma_tx_descriptor *desc;
-	struct xilinx_vdma_tx_segment *segment, *prev = NULL;
+	struct xilinx_vdma_tx_segment *segment;
 	struct xilinx_vdma_desc_hw *hw;
 
 	if (!is_slave_direction(xt->dir))
@@ -1665,8 +1665,6 @@  xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan,
 	/* Insert the segment into the descriptor segments list. */
 	list_add_tail(&segment->node, &desc->segments);
 
-	prev = segment;
-
 	/* Link the last hardware descriptor with the first. */
 	segment = list_first_entry(&desc->segments,
 				   struct xilinx_vdma_tx_segment, node);