struct device_attribute *attr,constchar*buf,size_tcount){structbme_client_data*data=dev_get_drvdata(dev);unsignedlongenable;intstatus =kstrtoul(buf,10, &enable);if(status ==0) { enable = enable ?1:0; mutex_lock(&data->lock);if(data->enable != enable) {if(enable) {if(regulator_en...
函数原型:static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res) 返回类型:int 参数: 类型参数名称 const char *s unsigned intbase unsigned long *res 350如果sizeof(unsignedlong)恒等于sizeof(unsignedlonglong)且__alignof__(unsignedlong)恒等于__alignof__(...
+++ b/arch/powerpc/platforms/powernv/subcore.c @@ -337,9 +337,9 @@ static ssize_t __used store_subcores_per_core(struct device *dev, /* We are serialised by the attribute lock */ - rc = sscanf(buf, "%lx", &val); - if (rc != 1) - return -EINVAL; + rc = kstrtoul(...
return -EINVAL; - if (val < 0 || val > 1) + if (val > 1) return -EINVAL; sc->spec_config.short_repeat = val; @@ -361,7 +361,7 @@ static ssize_t write_file_spectral_count(struct file *file, if (kstrtoul(buf, 0, &val)) return -EINVAL; - if (val < 0 || val > ...
* kstrtoul - convert a string to an unsigned long * @s: The start of the string. The string must be null-terminated, and may also * include a single newline before its terminating null. The first character * may also be a plus sign, but not a minus sign. * @base: The number ...
> simple_strtoul() is marked for obsoletion; use the newer and more > pleasant kstrtoul() in its place. Thank you for fixing, I will add it to my for-linus branch and push later today. > Cc: Alexey Dobriyan > Cc: Haavard Skinnemoen...