Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1431590 > unrolled thread

[PATCH v2] m32r: fix build warning about putc

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2016-06-26 23:40 +0200
Last post2016-07-03 22:10 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] m32r: fix build warning about putc Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-06-26 23:40 +0200
    Re: [PATCH v2] m32r: fix build warning about putc Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-07-03 22:10 +0200

#1431590 — [PATCH v2] m32r: fix build warning about putc

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2016-06-26 23:40 +0200
Subject[PATCH v2] m32r: fix build warning about putc
Message-ID<rOpWy-86d-5@gated-at.bofh.it>
We were getting build warning:
arch/m32r/boot/compressed/m32r_sio.c:11:13:
        warning: conflicting types for built-in function 'putc'

Here putc is used as a static function so lets just rename it to avoid
the conflict with the builtin putc.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---

v1: was having checkpatch warning. My mistake. I removed the braces in
the while loop.

build log is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/139958498

 arch/m32r/boot/compressed/m32r_sio.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/m32r/boot/compressed/m32r_sio.c b/arch/m32r/boot/compressed/m32r_sio.c
index 01d877c..e5c0c60 100644
--- a/arch/m32r/boot/compressed/m32r_sio.c
+++ b/arch/m32r/boot/compressed/m32r_sio.c
@@ -8,12 +8,13 @@
 
 #include <asm/processor.h>
 
-static void putc(char c);
+static void m32r_putc(char c);
 
 static int puts(const char *s)
 {
 	char c;
-	while ((c = *s++)) putc(c);
+	while ((c = *s++))
+		m32r_putc(c);
 	return 0;
 }
 
@@ -41,7 +42,7 @@ static int puts(const char *s)
 #define BOOT_SIO0TXB	PLD_ESIO0TXB
 #endif
 
-static void putc(char c)
+static void m32r_putc(char c)
 {
 	while ((*BOOT_SIO0STS & 0x3) != 0x3)
 		cpu_relax();
@@ -61,7 +62,7 @@ static void putc(char c)
 #define SIO0TXB	(volatile unsigned short *)(0x00efd000 + 30)
 #endif
 
-static void putc(char c)
+static void m32r_putc(char c)
 {
 	while ((*SIO0STS & 0x1) == 0)
 		cpu_relax();
-- 
1.9.1

[toc] | [next] | [standalone]


#1436034

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2016-07-03 22:10 +0200
Message-ID<rQVSh-4CC-3@gated-at.bofh.it>
In reply to#1431590
On Sunday 26 June 2016 10:37 PM, Sudip Mukherjee wrote:
> We were getting build warning:
> arch/m32r/boot/compressed/m32r_sio.c:11:13:
>          warning: conflicting types for built-in function 'putc'
>
> Here putc is used as a static function so lets just rename it to avoid
> the conflict with the builtin putc.
>
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> ---
>
> v1: was having checkpatch warning. My mistake. I removed the braces in
> the while loop.

Hi Andrew,

A gentle ping.
I know its too early for ping but you usually pick up all valid patches 
in a day or two.
Infact, in this patch there is an assignment in the loop condition which 
is not good, so if you want I can send a v3 by changing the loop to a 
do-while loop and thus removing the assignment in the condition.

Regards
Sudip


>
> build log is at:
> https://travis-ci.org/sudipm-mukherjee/parport/jobs/139958498
>
>   arch/m32r/boot/compressed/m32r_sio.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/arch/m32r/boot/compressed/m32r_sio.c b/arch/m32r/boot/compressed/m32r_sio.c
> index 01d877c..e5c0c60 100644
> --- a/arch/m32r/boot/compressed/m32r_sio.c
> +++ b/arch/m32r/boot/compressed/m32r_sio.c
> @@ -8,12 +8,13 @@
>
>   #include <asm/processor.h>
>
> -static void putc(char c);
> +static void m32r_putc(char c);
>
>   static int puts(const char *s)
>   {
>   	char c;
> -	while ((c = *s++)) putc(c);
> +	while ((c = *s++))
> +		m32r_putc(c);
>   	return 0;
>   }
>
> @@ -41,7 +42,7 @@ static int puts(const char *s)
>   #define BOOT_SIO0TXB	PLD_ESIO0TXB
>   #endif
>
> -static void putc(char c)
> +static void m32r_putc(char c)
>   {
>   	while ((*BOOT_SIO0STS & 0x3) != 0x3)
>   		cpu_relax();
> @@ -61,7 +62,7 @@ static void putc(char c)
>   #define SIO0TXB	(volatile unsigned short *)(0x00efd000 + 30)
>   #endif
>
> -static void putc(char c)
> +static void m32r_putc(char c)
>   {
>   	while ((*SIO0STS & 0x1) == 0)
>   		cpu_relax();
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web