Re: [RFC] [PATCH] Adding support for BMP085 pressure sensor.

From: Oliver Neukum
Date: Mon Jun 14 2010 - 06:30:41 EST


Am Montag, 14. Juni 2010 12:13:44 schrieb Datta, Shubhrajyoti:

> +/* sysfs callbacks */
> +static ssize_t set_oversampling(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf,
> + size_t count)
> +{
> + struct i2c_client *client = to_i2c_client(dev);
> + struct bmp085_data *data = i2c_get_clientdata(client);
> + data->oversampling_setting = simple_strtoul(buf, NULL, 10);
> + if (data->oversampling_setting > 3)
> + data->oversampling_setting = 3;
> + return count;
> +}

What happens if somebody writes a non-numerical value?

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/