aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_int.h
diff options
context:
space:
mode:
authorJan Höppner <hoeppner@linux.vnet.ibm.com>2016-11-22 18:11:46 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2017-01-31 10:46:32 +0100
commit3b1bea012710c1a299573c7a6a0584d623e6cbcf (patch)
tree7f866e3aae0e7b112a03b0f5182bae4e6dda1046 /drivers/s390/block/dasd_int.h
parent09762dcb623b5cff08c624250130cdcd389d5044 (diff)
downloadlinux-3b1bea012710c1a299573c7a6a0584d623e6cbcf.tar.gz
s390/dasd: Improve parameter list parsing
The function dasd_busid() still uses simple_strtoul() to convert a string to an integer value. This function is obsolete for quite some time already and should be replaced. The whole parameter parsing semantic still relies somewhat on the fact, that simple_strtoul() parses a string containing literals without complains and just returns the parsed integer value plus the residual string. kstrtoint(), however, would return -EINVAL in such a case. Since we want to get rid of simple_strtoul() and now have a nice dasd[] containing only single elements, we can clean up and simplify a few things. Replace simple_strtoul() with kstrtouint(), improve and simplify the overall parameter parsing by the following: - instead of residual strings return proper error codes - remove dasd_parse_next_element() and decide directly what sort of element is being parsed - if we parse a device or a range of devices, split that element into separate bits with a new function - remove warning about invalid ending as it doesn't apply anymore - annotate all parsing functions and data that can be freed after initialisation with __init and __initdata respectively - clean up bits and pieces while at it Reviewed-by: Stefan Haberland <sth@linux.vnet.ibm.com> Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/block/dasd_int.h')
-rw-r--r--drivers/s390/block/dasd_int.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 24be210c10e5fa..518dba2732d5b7 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -805,7 +805,7 @@ struct dasd_device *dasd_device_from_devindex(int);
void dasd_add_link_to_gendisk(struct gendisk *, struct dasd_device *);
struct dasd_device *dasd_device_from_gendisk(struct gendisk *);
-int dasd_parse(void);
+int dasd_parse(void) __init;
int dasd_busid_known(const char *);
/* externals in dasd_gendisk.c */