All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] alpha: Add some spaces to ensure format specification
@ 2022-06-21  8:15 Zhang Jiaming
  2023-02-26  2:06 ` Matt Turner
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Jiaming @ 2022-06-21  8:15 UTC (permalink / raw)
  To: rth, ink, mattst88
  Cc: linux-alpha, linux-kernel, liqiong, renyu, Zhang Jiaming

Add a space after ','.
Add spaces around the '=', '>' and '=='.

Signed-off-by: Zhang Jiaming <jiaming@nfschina.com>
---
 arch/alpha/boot/stdio.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/alpha/boot/stdio.c b/arch/alpha/boot/stdio.c
index 60f73ccd2e89..e6d1ebff4209 100644
--- a/arch/alpha/boot/stdio.c
+++ b/arch/alpha/boot/stdio.c
@@ -42,8 +42,8 @@ static int skip_atoi(const char **s)
 
 static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)
 {
-	char c,sign,tmp[66];
-	const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
+	char c, sign, tmp[66];
+	const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz";
 	int i;
 
 	if (type & LARGE)
@@ -83,14 +83,14 @@ static char * number(char * str, unsigned long long num, int base, int size, int
 		precision = i;
 	size -= precision;
 	if (!(type&(ZEROPAD+LEFT)))
-		while(size-->0)
+		while (size-- > 0)
 			*str++ = ' ';
 	if (sign)
 		*str++ = sign;
 	if (type & SPECIAL) {
 		if (base==8)
 			*str++ = '0';
-		else if (base==16) {
+		else if (base == 16) {
 			*str++ = '0';
 			*str++ = digits[33];
 		}
@@ -125,7 +125,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
 				/* 'z' changed to 'Z' --davidm 1/25/99 */
 
 
-	for (str=buf ; *fmt ; ++fmt) {
+	for (str = buf ; *fmt ; ++fmt) {
 		if (*fmt != '%') {
 			*str++ = *fmt;
 			continue;
@@ -296,7 +296,7 @@ int sprintf(char * buf, const char *fmt, ...)
 	int i;
 
 	va_start(args, fmt);
-	i=vsprintf(buf,fmt,args);
+	i = vsprintf(buf, fmt, args);
 	va_end(args);
 	return i;
 }
-- 
2.25.1


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

* Re: [PATCH] alpha: Add some spaces to ensure format specification
  2022-06-21  8:15 [PATCH] alpha: Add some spaces to ensure format specification Zhang Jiaming
@ 2023-02-26  2:06 ` Matt Turner
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Turner @ 2023-02-26  2:06 UTC (permalink / raw)
  To: Zhang Jiaming; +Cc: rth, ink, linux-alpha, linux-kernel, liqiong, renyu

On Tue, Jun 21, 2022 at 4:15 AM Zhang Jiaming <jiaming@nfschina.com> wrote:
>
> Add a space after ','.
> Add spaces around the '=', '>' and '=='.
>
> Signed-off-by: Zhang Jiaming <jiaming@nfschina.com>
> ---
>  arch/alpha/boot/stdio.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/alpha/boot/stdio.c b/arch/alpha/boot/stdio.c
> index 60f73ccd2e89..e6d1ebff4209 100644
> --- a/arch/alpha/boot/stdio.c
> +++ b/arch/alpha/boot/stdio.c
> @@ -42,8 +42,8 @@ static int skip_atoi(const char **s)
>
>  static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)
>  {
> -       char c,sign,tmp[66];
> -       const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
> +       char c, sign, tmp[66];
> +       const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz";
>         int i;
>
>         if (type & LARGE)
> @@ -83,14 +83,14 @@ static char * number(char * str, unsigned long long num, int base, int size, int
>                 precision = i;
>         size -= precision;
>         if (!(type&(ZEROPAD+LEFT)))
> -               while(size-->0)
> +               while (size-- > 0)
>                         *str++ = ' ';
>         if (sign)
>                 *str++ = sign;
>         if (type & SPECIAL) {
>                 if (base==8)
>                         *str++ = '0';
> -               else if (base==16) {
> +               else if (base == 16) {
>                         *str++ = '0';
>                         *str++ = digits[33];
>                 }
> @@ -125,7 +125,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
>                                 /* 'z' changed to 'Z' --davidm 1/25/99 */
>
>
> -       for (str=buf ; *fmt ; ++fmt) {
> +       for (str = buf ; *fmt ; ++fmt) {
>                 if (*fmt != '%') {
>                         *str++ = *fmt;
>                         continue;
> @@ -296,7 +296,7 @@ int sprintf(char * buf, const char *fmt, ...)
>         int i;
>
>         va_start(args, fmt);
> -       i=vsprintf(buf,fmt,args);
> +       i = vsprintf(buf, fmt, args);
>         va_end(args);
>         return i;
>  }
> --
> 2.25.1
>

Thanks for the patch! This was included in my pull request today and
is now upstream in Linus' tree.

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

end of thread, other threads:[~2023-02-26  2:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21  8:15 [PATCH] alpha: Add some spaces to ensure format specification Zhang Jiaming
2023-02-26  2:06 ` Matt Turner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.