S3C64XX DMA: dbg_showbuffs cleanup
Subsystems (3)
PATCH 6/7 S3C64XX DMA: dbg_showbuffs cleanup
Removed unused variable and cleaned up.
--- arch/arm/plat-s3c64xx/dma.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-)
arch/arm/plat-s3c64xx/dma.c +4 -10
@@ -71,20 +71,14 @@ static void show_lli(struct pl080s_lli *lli)static void dbg_showbuffs (struct s3c2410_dma_chan *chan) {struct s3c64xx_dma_buff *ptr; -struct s3c64xx_dma_buff *end;pr_debug ("DMA%d: buffs next %p, curr %p, end %p\n" , chan->number, chan->next, chan->curr, chan->end); - ptr = chan->next; - end = chan->end; - -if (debug_show_buffs) { -for (; ptr !=NULL ; ptr = ptr->next) { -pr_debug ("DMA%d: %08x " , - chan->number, ptr->lli_dma); -show_lli (ptr->lli); - } +for (ptr = chan->curr; debug_show_buffs && ptr !=NULL ; ptr = ptr->next) { +pr_debug ("DMA%d: %08x \n" , + chan->number, ptr->lli_dma); +show_lli (ptr->lli); } }
Signature · 1 line
1.6.2.5
PATCH 6/7 S3C64XX DMA: dbg_showbuffs cleanup
Quoted 12 lines · Jassi
Removed unused variable and cleaned up.
Signed-off-by Jassi <[email protected]>--- arch/arm/plat-s3c64xx/dma.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-)arch/arm/plat-s3c64xx/dma.c +0
-0
arch/arm/plat-s3c64xx/dma.c static void show_lli(struct pl080s_lli *lli) · line 74
Quoted 4 lines
arch/arm/plat-s3c64xx/dma.c +0
-1@@ -71,20 +71,14 @@ static void show_lli(struct pl080s_lli *lli)static void dbg_showbuffs (struct s3c2410_dma_chan *chan) {struct s3c64xx_dma_buff *ptr; -struct s3c64xx_dma_buff *end;
you are right that the end is not used.
arch/arm/plat-s3c64xx/dma.c static void show_lli(struct pl080s_lli *lli) · line 78
Quoted 13 lines
arch/arm/plat-s3c64xx/dma.c +1
-9pr_debug ("DMA%d: buffs next %p, curr %p, end %p\n" , chan->number, chan->next, chan->curr, chan->end); - ptr = chan->next; - end = chan->end; - -if (debug_show_buffs) { -for (; ptr !=NULL ; ptr = ptr->next) { -pr_debug ("DMA%d: %08x " , - chan->number, ptr->lli_dma); -show_lli (ptr->lli); - } +for (ptr = chan->curr; debug_show_buffs && ptr !=NULL ; ptr = ptr->next) {
this isn't a very nice change, for a start this means debug_show_buffs is going to end up being evaluated each loop and secondly these sort of changes do not help the code readability and can introduce bugs of their own.
Quoted 8 lines
arch/arm/plat-s3c64xx/dma.c +3
-0+pr_debug ("DMA%d: %08x \n" , + chan->number, ptr->lli_dma); +show_lli (ptr->lli); } }Signature · 1 line
1.6.2.5
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 6/7 S3C64XX DMA: dbg_showbuffs cleanup
Quoted 34 lines · Ben Dooks
Quoted 12 lines · Jassi
Removed unused variable and cleaned up.
Signed-off-by Jassi <[email protected]>---
?arch/arm/plat-s3c64xx/dma.c | ? 14 ++++---------- ?1 files changed, 4 insertions(+), 10 deletions(-)arch/arm/plat-s3c64xx/dma.c +0
-0arch/arm/plat-s3c64xx/dma.c static void show_lli(struct pl080s_lli *lli) · line 74
Quoted 4 lines
arch/arm/plat-s3c64xx/dma.c +0
-1@@ -71,20 +71,14 @@ static void show_lli(struct pl080s_lli *lli) ?static void dbg_showbuffs(struct s3c2410_dma_chan *chan) ?{ ? ? ? struct s3c64xx_dma_buff *ptr; - ? ? struct s3c64xx_dma_buff *end;you are right that the end is not used.
arch/arm/plat-s3c64xx/dma.c static void show_lli(struct pl080s_lli *lli) · line 77
Quoted 13 lines
arch/arm/plat-s3c64xx/dma.c +1
-9? ? ? pr_debug("DMA%d: buffs next %p, curr %p, end %p\n", ? ? ? ? ? ? ? ?chan->number, chan->next, chan->curr, chan->end); - ? ? ptr = chan->next; - ? ? end = chan->end; - - ? ? if (debug_show_buffs) { - ? ? ? ? ? ? for (; ptr != NULL; ptr = ptr->next) { - ? ? ? ? ? ? ? ? ? ? pr_debug("DMA%d: %08x ", - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?chan->number, ptr->lli_dma); - ? ? ? ? ? ? ? ? ? ? show_lli(ptr->lli); - ? ? ? ? ? ? } + ? ? for (ptr = chan->curr; debug_show_buffs && ptr != NULL; ptr = ptr->next) {
Quoted 4 lines
this isn't a very nice change, for a start this means
debug_show_buffsis going to end up being evaluated each loop and secondly these sort of changes do not help the code readability and can introduce bugs of their own.
yes and i knew the counter will be evaluated for every loop. i wanted to keep the counter and not change much the code.