diff options
| author | Juergen Gross <jgross@suse.com> | 2016-10-31 09:58:40 -0400 |
|---|---|---|
| committer | Juergen Gross <jgross@suse.com> | 2016-11-07 07:55:02 -0500 |
| commit | 9c53a1792a5e6c708897d0cb17f2a4509e499a52 (patch) | |
| tree | 48de24da67c301fcd0eed7cf3af4c2af837e3ba7 /include/xen | |
| parent | bc33b0ca11e3df467777a4fa7639ba488c9d4911 (diff) | |
xen: introduce xenbus_read_unsigned()
There are multiple instances of code reading an optional unsigned
parameter from Xenstore via xenbus_scanf(). Instead of repeating the
same code over and over add a service function doing the job.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'include/xen')
| -rw-r--r-- | include/xen/xenbus.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index 32b944b7cebd..271ba62503c7 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h | |||
| @@ -151,6 +151,10 @@ __scanf(4, 5) | |||
| 151 | int xenbus_scanf(struct xenbus_transaction t, | 151 | int xenbus_scanf(struct xenbus_transaction t, |
| 152 | const char *dir, const char *node, const char *fmt, ...); | 152 | const char *dir, const char *node, const char *fmt, ...); |
| 153 | 153 | ||
| 154 | /* Read an (optional) unsigned value. */ | ||
| 155 | unsigned int xenbus_read_unsigned(const char *dir, const char *node, | ||
| 156 | unsigned int default_val); | ||
| 157 | |||
| 154 | /* Single printf and write: returns -errno or 0. */ | 158 | /* Single printf and write: returns -errno or 0. */ |
| 155 | __printf(4, 5) | 159 | __printf(4, 5) |
| 156 | int xenbus_printf(struct xenbus_transaction t, | 160 | int xenbus_printf(struct xenbus_transaction t, |
