public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: pl330: Mark unused functions as __maybe_unused
@ 2017-05-19 20:02 Matthias Kaehlcke
  2017-06-14  4:58 ` Vinod Koul
  0 siblings, 1 reply; 3+ messages in thread
From: Matthias Kaehlcke @ 2017-05-19 20:02 UTC (permalink / raw)
  To: Dan Williams, Vinod Koul; +Cc: dmaengine, linux-kernel, Matthias Kaehlcke

Several functions are not used and probably kept around for completeness
or debugging. Adding the attribute fixes a bunch of warnings like this
when building with clang:

drivers/dma/pl330.c:568:19: error: unused function '_emit_ADDH'
    [-Werror,-Wunused-function]

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 drivers/dma/pl330.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 8b0da7fa520d..cb0852f24f19 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -538,7 +538,7 @@ struct _xfer_spec {
 	struct dma_pl330_desc *desc;
 };
 
-static inline bool _queue_empty(struct pl330_thread *thrd)
+static inline bool __maybe_unused _queue_empty(struct pl330_thread *thrd)
 {
 	return thrd->req[0].desc == NULL && thrd->req[1].desc == NULL;
 }
@@ -564,7 +564,7 @@ static inline u32 get_revision(u32 periph_id)
 	return (periph_id >> PERIPH_REV_SHIFT) & PERIPH_REV_MASK;
 }
 
-static inline u32 _emit_ADDH(unsigned dry_run, u8 buf[],
+static inline u32 __maybe_unused _emit_ADDH(unsigned dry_run, u8 buf[],
 		enum pl330_dst da, u16 val)
 {
 	if (dry_run)
@@ -738,7 +738,7 @@ static inline u32 _emit_MOV(unsigned dry_run, u8 buf[],
 	return SZ_DMAMOV;
 }
 
-static inline u32 _emit_NOP(unsigned dry_run, u8 buf[])
+static inline u32 __maybe_unused _emit_NOP(unsigned dry_run, u8 buf[])
 {
 	if (dry_run)
 		return SZ_DMANOP;
@@ -778,7 +778,8 @@ static inline u32 _emit_SEV(unsigned dry_run, u8 buf[], u8 ev)
 	return SZ_DMASEV;
 }
 
-static inline u32 _emit_ST(unsigned dry_run, u8 buf[], enum pl330_cond cond)
+static inline u32 _emit_ST(unsigned dry_run, u8 buf[],
+					  enum pl330_cond cond)
 {
 	if (dry_run)
 		return SZ_DMAST;
@@ -817,7 +818,7 @@ static inline u32 _emit_STP(unsigned dry_run, u8 buf[],
 	return SZ_DMASTP;
 }
 
-static inline u32 _emit_STZ(unsigned dry_run, u8 buf[])
+static inline u32 __maybe_unused _emit_STZ(unsigned dry_run, u8 buf[])
 {
 	if (dry_run)
 		return SZ_DMASTZ;
@@ -829,7 +830,7 @@ static inline u32 _emit_STZ(unsigned dry_run, u8 buf[])
 	return SZ_DMASTZ;
 }
 
-static inline u32 _emit_WFE(unsigned dry_run, u8 buf[], u8 ev,
+static inline u32 __maybe_unused _emit_WFE(unsigned dry_run, u8 buf[], u8 ev,
 		unsigned invalidate)
 {
 	if (dry_run)
-- 
2.13.0.303.g4ebf302169-goog

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: pl330: Mark unused functions as __maybe_unused
  2017-05-19 20:02 [PATCH] dmaengine: pl330: Mark unused functions as __maybe_unused Matthias Kaehlcke
@ 2017-06-14  4:58 ` Vinod Koul
  2017-06-14 21:05   ` Matthias Kaehlcke
  0 siblings, 1 reply; 3+ messages in thread
From: Vinod Koul @ 2017-06-14  4:58 UTC (permalink / raw)
  To: Matthias Kaehlcke, Marek Szyprowski; +Cc: Dan Williams, dmaengine, linux-kernel

On Fri, May 19, 2017 at 01:02:26PM -0700, Matthias Kaehlcke wrote:
> Several functions are not used and probably kept around for completeness
> or debugging. Adding the attribute fixes a bunch of warnings like this
> when building with clang:
> 
> drivers/dma/pl330.c:568:19: error: unused function '_emit_ADDH'
>     [-Werror,-Wunused-function]

Well I dont see these being used, so why should we keep the dead code.
Can you please remove these


> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---
>  drivers/dma/pl330.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index 8b0da7fa520d..cb0852f24f19 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -538,7 +538,7 @@ struct _xfer_spec {
>  	struct dma_pl330_desc *desc;
>  };
>  
> -static inline bool _queue_empty(struct pl330_thread *thrd)
> +static inline bool __maybe_unused _queue_empty(struct pl330_thread *thrd)
>  {
>  	return thrd->req[0].desc == NULL && thrd->req[1].desc == NULL;
>  }
> @@ -564,7 +564,7 @@ static inline u32 get_revision(u32 periph_id)
>  	return (periph_id >> PERIPH_REV_SHIFT) & PERIPH_REV_MASK;
>  }
>  
> -static inline u32 _emit_ADDH(unsigned dry_run, u8 buf[],
> +static inline u32 __maybe_unused _emit_ADDH(unsigned dry_run, u8 buf[],
>  		enum pl330_dst da, u16 val)
>  {
>  	if (dry_run)
> @@ -738,7 +738,7 @@ static inline u32 _emit_MOV(unsigned dry_run, u8 buf[],
>  	return SZ_DMAMOV;
>  }
>  
> -static inline u32 _emit_NOP(unsigned dry_run, u8 buf[])
> +static inline u32 __maybe_unused _emit_NOP(unsigned dry_run, u8 buf[])
>  {
>  	if (dry_run)
>  		return SZ_DMANOP;
> @@ -778,7 +778,8 @@ static inline u32 _emit_SEV(unsigned dry_run, u8 buf[], u8 ev)
>  	return SZ_DMASEV;
>  }
>  
> -static inline u32 _emit_ST(unsigned dry_run, u8 buf[], enum pl330_cond cond)
> +static inline u32 _emit_ST(unsigned dry_run, u8 buf[],
> +					  enum pl330_cond cond)
>  {
>  	if (dry_run)
>  		return SZ_DMAST;
> @@ -817,7 +818,7 @@ static inline u32 _emit_STP(unsigned dry_run, u8 buf[],
>  	return SZ_DMASTP;
>  }
>  
> -static inline u32 _emit_STZ(unsigned dry_run, u8 buf[])
> +static inline u32 __maybe_unused _emit_STZ(unsigned dry_run, u8 buf[])
>  {
>  	if (dry_run)
>  		return SZ_DMASTZ;
> @@ -829,7 +830,7 @@ static inline u32 _emit_STZ(unsigned dry_run, u8 buf[])
>  	return SZ_DMASTZ;
>  }
>  
> -static inline u32 _emit_WFE(unsigned dry_run, u8 buf[], u8 ev,
> +static inline u32 __maybe_unused _emit_WFE(unsigned dry_run, u8 buf[], u8 ev,
>  		unsigned invalidate)
>  {
>  	if (dry_run)
> -- 
> 2.13.0.303.g4ebf302169-goog
> 
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: pl330: Mark unused functions as __maybe_unused
  2017-06-14  4:58 ` Vinod Koul
@ 2017-06-14 21:05   ` Matthias Kaehlcke
  0 siblings, 0 replies; 3+ messages in thread
From: Matthias Kaehlcke @ 2017-06-14 21:05 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Marek Szyprowski, Dan Williams, dmaengine, linux-kernel

El Wed, Jun 14, 2017 at 10:28:31AM +0530 Vinod Koul ha dit:

> On Fri, May 19, 2017 at 01:02:26PM -0700, Matthias Kaehlcke wrote:
> > Several functions are not used and probably kept around for completeness
> > or debugging. Adding the attribute fixes a bunch of warnings like this
> > when building with clang:
> > 
> > drivers/dma/pl330.c:568:19: error: unused function '_emit_ADDH'
> >     [-Werror,-Wunused-function]
> 
> Well I dont see these being used, so why should we keep the dead code.
> Can you please remove these

Ok, I'll send a patch with the removal shortly

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-14 21:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-19 20:02 [PATCH] dmaengine: pl330: Mark unused functions as __maybe_unused Matthias Kaehlcke
2017-06-14  4:58 ` Vinod Koul
2017-06-14 21:05   ` Matthias Kaehlcke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox