All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Staging: zram: print the disk size in KB
@ 2011-12-13  5:16 Ajeet Yadav
  2011-12-14  0:18 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ajeet Yadav @ 2011-12-13  5:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jerome Marchand, Nitin Gupta, linux-kernel

>From a5d5ba92b5af9134e617986884856334c377e1d0 Mon Sep 17 00:00:00 2001
From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
Date: Mon, 12 Dec 2011 18:42:30 +0530
Subject: [PATCH 1/1] Staging: zram: print the disk size in KB

Total memory size is in KB, but the zram disk size was not
printed in KB, correct the figure in KB units.

Signed-off-by: Ajeet Yadav <ajeet.yadav.77@gmail.com>
---
 drivers/staging/zram/zram_drv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 09de99f..ff591e3 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -126,7 +126,7 @@ static void zram_set_disksize(struct zram *zram,
size_t totalram_bytes)
 		"\tMemory Size: %zu kB\n"
 		"\tSize you selected: %llu kB\n"
 		"Continuing anyway ...\n",
-		totalram_bytes >> 10, zram->disksize
+		totalram_bytes >> 10, zram->disksize >> 10
 		);
 	}

--

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

* Re: [PATCH 1/1] Staging: zram: print the disk size in KB
  2011-12-13  5:16 [PATCH 1/1] Staging: zram: print the disk size in KB Ajeet Yadav
@ 2011-12-14  0:18 ` Greg KH
  2011-12-14  6:00   ` Ajeet Yadav
  2011-12-14  1:50 ` Nitin Gupta
  2011-12-14  7:52 ` Geert Uytterhoeven
  2 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2011-12-14  0:18 UTC (permalink / raw)
  To: Ajeet Yadav
  Cc: Greg Kroah-Hartman, Jerome Marchand, Nitin Gupta, linux-kernel

On Tue, Dec 13, 2011 at 10:46:53AM +0530, Ajeet Yadav wrote:
> >From a5d5ba92b5af9134e617986884856334c377e1d0 Mon Sep 17 00:00:00 2001
> From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
> Date: Mon, 12 Dec 2011 18:42:30 +0530
> Subject: [PATCH 1/1] Staging: zram: print the disk size in KB

Why did you include the patch in an email instead of using
git-send-email?  This would force me to edit the patch by hand, removing
this useless stuff.

> 
> Total memory size is in KB, but the zram disk size was not
> printed in KB, correct the figure in KB units.
> 
> Signed-off-by: Ajeet Yadav <ajeet.yadav.77@gmail.com>
> ---
>  drivers/staging/zram/zram_drv.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
> index 09de99f..ff591e3 100644
> --- a/drivers/staging/zram/zram_drv.c
> +++ b/drivers/staging/zram/zram_drv.c
> @@ -126,7 +126,7 @@ static void zram_set_disksize(struct zram *zram,
> size_t totalram_bytes)

And your patch is line-wrapped, making it so I would have to edit it
again.

Please fix up, and get the acks from the zram maintainer (as this does
change a kernel/user api) before I can accept this.

greg k-h

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

* Re: [PATCH 1/1] Staging: zram: print the disk size in KB
  2011-12-13  5:16 [PATCH 1/1] Staging: zram: print the disk size in KB Ajeet Yadav
  2011-12-14  0:18 ` Greg KH
@ 2011-12-14  1:50 ` Nitin Gupta
  2011-12-14  7:52 ` Geert Uytterhoeven
  2 siblings, 0 replies; 6+ messages in thread
From: Nitin Gupta @ 2011-12-14  1:50 UTC (permalink / raw)
  To: Ajeet Yadav; +Cc: Greg Kroah-Hartman, Jerome Marchand, linux-kernel

Hi Ajeet,

On 12/13/2011 12:16 AM, Ajeet Yadav wrote:

> From a5d5ba92b5af9134e617986884856334c377e1d0 Mon Sep 17 00:00:00 2001
> From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
> Date: Mon, 12 Dec 2011 18:42:30 +0530
> Subject: [PATCH 1/1] Staging: zram: print the disk size in KB
> 
> Total memory size is in KB, but the zram disk size was not
> printed in KB, correct the figure in KB units.
> 
> Signed-off-by: Ajeet Yadav <ajeet.yadav.77@gmail.com>
> ---
>  drivers/staging/zram/zram_drv.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
> index 09de99f..ff591e3 100644
> --- a/drivers/staging/zram/zram_drv.c
> +++ b/drivers/staging/zram/zram_drv.c
> @@ -126,7 +126,7 @@ static void zram_set_disksize(struct zram *zram,
> size_t totalram_bytes)
>  		"\tMemory Size: %zu kB\n"
>  		"\tSize you selected: %llu kB\n"
>  		"Continuing anyway ...\n",
> -		totalram_bytes >> 10, zram->disksize
> +		totalram_bytes >> 10, zram->disksize >> 10
>  		);
>  	}
> 


I'm planning to send some cleanup patches soon which, among other
things, removes this message. So, there seems to be no need to fix the same.

Thanks,
Nitin

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

* Re: [PATCH 1/1] Staging: zram: print the disk size in KB
  2011-12-14  0:18 ` Greg KH
@ 2011-12-14  6:00   ` Ajeet Yadav
  0 siblings, 0 replies; 6+ messages in thread
From: Ajeet Yadav @ 2011-12-14  6:00 UTC (permalink / raw)
  To: Greg KH; +Cc: Greg Kroah-Hartman, Jerome Marchand, Nitin Gupta, linux-kernel

On Wed, Dec 14, 2011 at 5:48 AM, Greg KH <greg@kroah.com> wrote:
> On Tue, Dec 13, 2011 at 10:46:53AM +0530, Ajeet Yadav wrote:
>> >From a5d5ba92b5af9134e617986884856334c377e1d0 Mon Sep 17 00:00:00 2001
>> From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
>> Date: Mon, 12 Dec 2011 18:42:30 +0530
>> Subject: [PATCH 1/1] Staging: zram: print the disk size in KB
>
> Why did you include the patch in an email instead of using
> git-send-email?  This would force me to edit the patch by hand, removing
> this useless stuff.
sorry for the discomfort, gmail SMTP port was not configured properly,
will take care of this next time.
>
>>
>> Total memory size is in KB, but the zram disk size was not
>> printed in KB, correct the figure in KB units.
>>
>> Signed-off-by: Ajeet Yadav <ajeet.yadav.77@gmail.com>
>> ---
>>  drivers/staging/zram/zram_drv.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
>> index 09de99f..ff591e3 100644
>> --- a/drivers/staging/zram/zram_drv.c
>> +++ b/drivers/staging/zram/zram_drv.c
>> @@ -126,7 +126,7 @@ static void zram_set_disksize(struct zram *zram,
>> size_t totalram_bytes)
>
> And your patch is line-wrapped, making it so I would have to edit it
> again.
>
> Please fix up, and get the acks from the zram maintainer (as this does
> change a kernel/user api) before I can accept this.
>
> greg k-h

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

* Re: [PATCH 1/1] Staging: zram: print the disk size in KB
  2011-12-13  5:16 [PATCH 1/1] Staging: zram: print the disk size in KB Ajeet Yadav
  2011-12-14  0:18 ` Greg KH
  2011-12-14  1:50 ` Nitin Gupta
@ 2011-12-14  7:52 ` Geert Uytterhoeven
  2011-12-14 10:16   ` Jerome Marchand
  2 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2011-12-14  7:52 UTC (permalink / raw)
  To: Ajeet Yadav
  Cc: Greg Kroah-Hartman, Jerome Marchand, Nitin Gupta, linux-kernel

On Tue, Dec 13, 2011 at 06:16, Ajeet Yadav <ajeet.yadav.77@gmail.com> wrote:
> From a5d5ba92b5af9134e617986884856334c377e1d0 Mon Sep 17 00:00:00 2001
> From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
> Date: Mon, 12 Dec 2011 18:42:30 +0530
> Subject: [PATCH 1/1] Staging: zram: print the disk size in KB
>
> Total memory size is in KB, but the zram disk size was not
> printed in KB, correct the figure in KB units.

Kelvin bytes?

> Signed-off-by: Ajeet Yadav <ajeet.yadav.77@gmail.com>
> ---
>  drivers/staging/zram/zram_drv.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
> index 09de99f..ff591e3 100644
> --- a/drivers/staging/zram/zram_drv.c
> +++ b/drivers/staging/zram/zram_drv.c
> @@ -126,7 +126,7 @@ static void zram_set_disksize(struct zram *zram,
> size_t totalram_bytes)
>                "\tMemory Size: %zu kB\n"

kilobytes? Either this ...

>                "\tSize you selected: %llu kB\n"

... and this should be KiB ...

>                "Continuing anyway ...\n",
> -               totalram_bytes >> 10, zram->disksize
> +               totalram_bytes >> 10, zram->disksize >> 10

... or these should be / 1000 instead of >> 10.

>                );
>        }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 1/1] Staging: zram: print the disk size in KB
  2011-12-14  7:52 ` Geert Uytterhoeven
@ 2011-12-14 10:16   ` Jerome Marchand
  0 siblings, 0 replies; 6+ messages in thread
From: Jerome Marchand @ 2011-12-14 10:16 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Ajeet Yadav, Greg Kroah-Hartman, Nitin Gupta, linux-kernel

On 12/14/2011 08:52 AM, Geert Uytterhoeven wrote:
> On Tue, Dec 13, 2011 at 06:16, Ajeet Yadav <ajeet.yadav.77@gmail.com> wrote:
>> From a5d5ba92b5af9134e617986884856334c377e1d0 Mon Sep 17 00:00:00 2001
>> From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
>> Date: Mon, 12 Dec 2011 18:42:30 +0530
>> Subject: [PATCH 1/1] Staging: zram: print the disk size in KB
>>
>> Total memory size is in KB, but the zram disk size was not
>> printed in KB, correct the figure in KB units.
> 
> Kelvin bytes?
> 
>> Signed-off-by: Ajeet Yadav <ajeet.yadav.77@gmail.com>
>> ---
>>  drivers/staging/zram/zram_drv.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
>> index 09de99f..ff591e3 100644
>> --- a/drivers/staging/zram/zram_drv.c
>> +++ b/drivers/staging/zram/zram_drv.c
>> @@ -126,7 +126,7 @@ static void zram_set_disksize(struct zram *zram,
>> size_t totalram_bytes)
>>                "\tMemory Size: %zu kB\n"
> 
> kilobytes? Either this ...
> 
>>                "\tSize you selected: %llu kB\n"
> 
> ... and this should be KiB ...

I'm personally all for the international system of units, but there
are *a lot* of places in the kernel where the inaccurate kilo = 2^10
notation is used. I haven't checked, but I would guess that in kernel
kB stands more often for 1024 bytes than 1000 bytes.

Is there any coding rule about its usage?

Jerome

> 
>>                "Continuing anyway ...\n",
>> -               totalram_bytes >> 10, zram->disksize
>> +               totalram_bytes >> 10, zram->disksize >> 10
> 
> ... or these should be / 1000 instead of >> 10.
> 
>>                );
>>        }
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds


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

end of thread, other threads:[~2011-12-14 10:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-13  5:16 [PATCH 1/1] Staging: zram: print the disk size in KB Ajeet Yadav
2011-12-14  0:18 ` Greg KH
2011-12-14  6:00   ` Ajeet Yadav
2011-12-14  1:50 ` Nitin Gupta
2011-12-14  7:52 ` Geert Uytterhoeven
2011-12-14 10:16   ` Jerome Marchand

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.