linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ia64: agp: Replace empty define with do while
@ 2017-12-20 19:16 Corentin Labbe
  2019-04-20 17:07 ` Corentin Labbe
  0 siblings, 1 reply; 2+ messages in thread
From: Corentin Labbe @ 2017-12-20 19:16 UTC (permalink / raw)
  To: fenghua.yu, tony.luck; +Cc: linux-ia64, linux-kernel, Corentin Labbe

It's dangerous to use empty code define.
Furthermore it lead to the following warning:
drivers/char/agp/generic.c: In function « agp_generic_destroy_page »:
drivers/char/agp/generic.c:1266:28: attention : suggest braces around empty body in an « if » statement [-Wempty-body]

So let's replace emptyness by "do {} while(0)"

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 arch/ia64/include/asm/agp.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/ia64/include/asm/agp.h b/arch/ia64/include/asm/agp.h
index 2b451c4496da..0261507dc264 100644
--- a/arch/ia64/include/asm/agp.h
+++ b/arch/ia64/include/asm/agp.h
@@ -14,8 +14,8 @@
  * in coherent mode, which lets us map the AGP memory as normal (write-back) memory
  * (unlike x86, where it gets mapped "write-coalescing").
  */
-#define map_page_into_agp(page)		/* nothing */
-#define unmap_page_from_agp(page)	/* nothing */
+#define map_page_into_agp(page)		do { } while (0)
+#define unmap_page_from_agp(page)	do { } while (0)
 #define flush_agp_cache()		mb()
 
 /* GATT allocation. Returns/accepts GATT kernel virtual address. */
-- 
2.13.6

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

* Re: [PATCH] ia64: agp: Replace empty define with do while
  2017-12-20 19:16 [PATCH] ia64: agp: Replace empty define with do while Corentin Labbe
@ 2019-04-20 17:07 ` Corentin Labbe
  0 siblings, 0 replies; 2+ messages in thread
From: Corentin Labbe @ 2019-04-20 17:07 UTC (permalink / raw)
  To: fenghua.yu, tony.luck; +Cc: linux-ia64, linux-kernel

On Wed, Dec 20, 2017 at 08:16:13PM +0100, Corentin Labbe wrote:
> It's dangerous to use empty code define.
> Furthermore it lead to the following warning:
> drivers/char/agp/generic.c: In function « agp_generic_destroy_page »:
> drivers/char/agp/generic.c:1266:28: attention : suggest braces around empty body in an « if » statement [-Wempty-body]
> 
> So let's replace emptyness by "do {} while(0)"
> 
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>

Hello

Gentle ping

Regards

> ---
>  arch/ia64/include/asm/agp.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/ia64/include/asm/agp.h b/arch/ia64/include/asm/agp.h
> index 2b451c4496da..0261507dc264 100644
> --- a/arch/ia64/include/asm/agp.h
> +++ b/arch/ia64/include/asm/agp.h
> @@ -14,8 +14,8 @@
>   * in coherent mode, which lets us map the AGP memory as normal (write-back) memory
>   * (unlike x86, where it gets mapped "write-coalescing").
>   */
> -#define map_page_into_agp(page)		/* nothing */
> -#define unmap_page_from_agp(page)	/* nothing */
> +#define map_page_into_agp(page)		do { } while (0)
> +#define unmap_page_from_agp(page)	do { } while (0)
>  #define flush_agp_cache()		mb()
>  
>  /* GATT allocation. Returns/accepts GATT kernel virtual address. */
> -- 
> 2.13.6
> 

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

end of thread, other threads:[~2019-04-20 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-20 19:16 [PATCH] ia64: agp: Replace empty define with do while Corentin Labbe
2019-04-20 17:07 ` Corentin Labbe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).