mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] block: replace obsolete simple_strtol() with kstrtoul()
@ 2014-02-20  6:56 Daeseok Youn
  2014-02-20  7:29 ` Daeseok Youn
  0 siblings, 1 reply; 2+ messages in thread
From: Daeseok Youn @ 2014-02-20  6:56 UTC (permalink / raw)
  To: npiggin; +Cc: linux-kernel

>From cac24db7480b10b671d05320e0cb97a7bf5d0aea Mon Sep 17 00:00:00 2001
From: Daeseok Youn <daeseok.youn@gmail.com>
Date: Thu, 20 Feb 2014 15:35:14 +0900
Subject: [PATCH] block: replace obsolete simple_strtol() with kstrtoul()

- Makes rd_size value as static, because it is only
referenced in this file.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/block/brd.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index e73b85c..a33d8d3 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -429,12 +429,12 @@ static const struct block_device_operations brd_fops = {
  * And now the modules code and kernel interface.
  */
 static int rd_nr;
-int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
+static unsigned long rd_size = CONFIG_BLK_DEV_RAM_SIZE;
 static int max_part;
 static int part_shift;
 module_param(rd_nr, int, S_IRUGO);
 MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
-module_param(rd_size, int, S_IRUGO);
+module_param(rd_size, ulong, S_IRUGO);
 MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
 module_param(max_part, int, S_IRUGO);
 MODULE_PARM_DESC(max_part, "Maximum number of partitions per RAM disk");
@@ -446,7 +446,8 @@ MODULE_ALIAS("rd");
 /* Legacy boot options - nonmodular */
 static int __init ramdisk_size(char *str)
 {
-	rd_size = simple_strtol(str, NULL, 0);
+	if (kstrtoul(str, 0, &rd_size) < 0)
+		return 0;
 	return 1;
 }
 __setup("ramdisk_size=", ramdisk_size);
-- 
1.7.9.5

---

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

* [PATCH] block: replace obsolete simple_strtol() with kstrtoul()
  2014-02-20  6:56 [PATCH] block: replace obsolete simple_strtol() with kstrtoul() Daeseok Youn
@ 2014-02-20  7:29 ` Daeseok Youn
  0 siblings, 0 replies; 2+ messages in thread
From: Daeseok Youn @ 2014-02-20  7:29 UTC (permalink / raw)
  To: akpm, axboe; +Cc: linux-kernel

npiggin@kernel.dk account doesn't exist.

TO+ :
akpm@linux-foundation.org, axboe@kernel.dk

On Thursday, February 20, 2014 03:56:30 PM you wrote:
> From cac24db7480b10b671d05320e0cb97a7bf5d0aea Mon Sep 17 00:00:00 2001
> From: Daeseok Youn <daeseok.youn@gmail.com>
> Date: Thu, 20 Feb 2014 15:35:14 +0900
> Subject: [PATCH] block: replace obsolete simple_strtol() with kstrtoul()
> 
> - Makes rd_size value as static, because it is only
> referenced in this file.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  drivers/block/brd.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/block/brd.c b/drivers/block/brd.c
> index e73b85c..a33d8d3 100644
> --- a/drivers/block/brd.c
> +++ b/drivers/block/brd.c
> @@ -429,12 +429,12 @@ static const struct block_device_operations brd_fops =
> { * And now the modules code and kernel interface.
>   */
>  static int rd_nr;
> -int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
> +static unsigned long rd_size = CONFIG_BLK_DEV_RAM_SIZE;
>  static int max_part;
>  static int part_shift;
>  module_param(rd_nr, int, S_IRUGO);
>  MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
> -module_param(rd_size, int, S_IRUGO);
> +module_param(rd_size, ulong, S_IRUGO);
>  MODULE_PARM_DESC(rd_size, "Size of each RAM disk in kbytes.");
>  module_param(max_part, int, S_IRUGO);
>  MODULE_PARM_DESC(max_part, "Maximum number of partitions per RAM disk");
> @@ -446,7 +446,8 @@ MODULE_ALIAS("rd");
>  /* Legacy boot options - nonmodular */
>  static int __init ramdisk_size(char *str)
>  {
> -	rd_size = simple_strtol(str, NULL, 0);
> +	if (kstrtoul(str, 0, &rd_size) < 0)
> +		return 0;
>  	return 1;
>  }
>  __setup("ramdisk_size=", ramdisk_size);

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

end of thread, other threads:[~2014-02-20  7:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20  6:56 [PATCH] block: replace obsolete simple_strtol() with kstrtoul() Daeseok Youn
2014-02-20  7:29 ` Daeseok Youn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®