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


Groups > linux.kernel > #1643210 > unrolled thread

[PATCH] Signed-off-by: Richa Jha <richa.jha2@gmail.com>

Started byRicha Jha <richa.jha2@gmail.com>
First post2017-05-17 12:20 +0200
Last post2017-05-17 14:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Signed-off-by: Richa Jha <richa.jha2@gmail.com> Richa Jha <richa.jha2@gmail.com> - 2017-05-17 12:20 +0200
    Re: [PATCH] Signed-off-by: Richa Jha <richa.jha2@gmail.com> Arnd Bergmann <arnd@arndb.de> - 2017-05-17 14:10 +0200

#1643210 — [PATCH] Signed-off-by: Richa Jha <richa.jha2@gmail.com>

FromRicha Jha <richa.jha2@gmail.com>
Date2017-05-17 12:20 +0200
Subject[PATCH] Signed-off-by: Richa Jha <richa.jha2@gmail.com>
Message-ID<tI4dI-1LO-21@gated-at.bofh.it>
 From short to string conversion
---
 drivers/char/efirtc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c
index dc62568..b8a4d02 100644
--- a/drivers/char/efirtc.c
+++ b/drivers/char/efirtc.c
@@ -302,6 +302,7 @@ static int efi_rtc_proc_show(struct seq_file *m, void *v)
 	efi_time_cap_t	cap;
 	efi_bool_t	enabled, pending;	
 	unsigned long	flags;
+	char str_timezone[128];	
 
 	memset(&eft, 0, sizeof(eft));
 	memset(&alm, 0, sizeof(alm));
@@ -326,7 +327,9 @@ static int efi_rtc_proc_show(struct seq_file *m, void *v)
 		seq_puts(m, "Timezone       : unspecified\n");
 	else
 		/* XXX fixme: convert to string? */
-		seq_printf(m, "Timezone       : %u\n", eft.timezone);
+		for(i= eft.timezone,c=0; i>0 ;c++,i=i/10)
+			str_timezone[c] = i%10 - 48
+		seq_puts(m, str_timezone);
 		
 
 	seq_printf(m,
-- 
2.1.4

[toc] | [next] | [standalone]


#1643302

FromArnd Bergmann <arnd@arndb.de>
Date2017-05-17 14:10 +0200
Message-ID<tI5Wa-2Uc-19@gated-at.bofh.it>
In reply to#1643210
On Wed, May 17, 2017 at 12:12 PM, Richa Jha <richa.jha2@gmail.com> wrote:
>  From short to string conversion
> ---

Hi Richa,

Sorry, but we can't take that patch:

- The patch description doesn't explain what the patch is good for,
  only what it does.

> @@ -326,7 +327,9 @@ static int efi_rtc_proc_show(struct seq_file *m, void *v)
>                 seq_puts(m, "Timezone       : unspecified\n");
>         else
>                 /* XXX fixme: convert to string? */
> -               seq_printf(m, "Timezone       : %u\n", eft.timezone);
> +               for(i= eft.timezone,c=0; i>0 ;c++,i=i/10)
> +                       str_timezone[c] = i%10 - 48
> +               seq_puts(m, str_timezone);

- It won't compile.

- It seems to change an established ABI in an incompatible way

- My guess is that you are trying to address the 'fixme' comment, but this
  doesn't seem to do what the comment is about, and you leave the
  fixme in place. 'fixme' comments tend to be for things that the original
  author could not figure out initially because they are hard, so they
  are not a good place to start.

- the coding style is wrong

- you appear to re-implement parts of what sprintf does in a less
  portable way.

- You are probably trying to just learn about kernel hacking. This
  is good, but drivers/char/efirtc.c is a particularly bad place to start.
  The driver is completely obsolete (replaced by drivers/rtc/rtc-efi.c)
  and there is no maintainer for it.

https://kernelnewbies.org/Outreachyfirstpatch has a good overview
of how to start.

     Arnd

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web