if (!tz->ops->get_trip_type)
return -EPERM;
- if (!sscanf(attr->attr.name, "trip_point_%d_type", &trip))
+ if (sscanf(attr->attr.name, "trip_point_%d_type", &trip) != 1)
return -EINVAL;
result = tz->ops->get_trip_type(tz, trip, &type);
if (!tz->ops->set_trip_temp)
return -EPERM;
- if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip))
+ if (sscanf(attr->attr.name, "trip_point_%d_temp", &trip) != 1)
return -EINVAL;
if (kstrtoint(buf, 10, &temperature))
if (!tz->ops->get_trip_temp)
return -EPERM;
- if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip))
+ if (sscanf(attr->attr.name, "trip_point_%d_temp", &trip) != 1)
return -EINVAL;
ret = tz->ops->get_trip_temp(tz, trip, &temperature);
if (!tz->ops->set_trip_hyst)
return -EPERM;
- if (!sscanf(attr->attr.name, "trip_point_%d_hyst", &trip))
+ if (sscanf(attr->attr.name, "trip_point_%d_hyst", &trip) != 1)
return -EINVAL;
if (kstrtoint(buf, 10, &temperature))
if (!tz->ops->get_trip_hyst)
return -EPERM;
- if (!sscanf(attr->attr.name, "trip_point_%d_hyst", &trip))
+ if (sscanf(attr->attr.name, "trip_point_%d_hyst", &trip) != 1)
return -EINVAL;
ret = tz->ops->get_trip_hyst(tz, trip, &temperature);
struct thermal_zone_device *tz = to_thermal_zone(dev);
int state;
- if (!sscanf(buf, "%d\n", &state))
+ if (sscanf(buf, "%d\n", &state) != 1)
return -EINVAL;
/* sanity check: values below 1000 millicelcius don't make sense
unsigned long state;
int result;
- if (!sscanf(buf, "%ld\n", &state))
+ if (sscanf(buf, "%ld\n", &state) != 1)
return -EINVAL;
if ((long)state < 0)