Signed-off-by: Akinobu Mita Cc: Doug Warzecha --- drivers/firmware/dcdbas.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) Index: 2.6-git/drivers/firmware/dcdbas.c =================================================================== --- 2.6-git.orig/drivers/firmware/dcdbas.c +++ 2.6-git/drivers/firmware/dcdbas.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "dcdbas.h" @@ -152,20 +153,11 @@ static ssize_t smi_data_read(struct kobj struct bin_attribute *bin_attr, char *buf, loff_t pos, size_t count) { - size_t max_read; ssize_t ret; mutex_lock(&smi_data_lock); - - if (pos >= smi_data_buf_size) { - ret = 0; - goto out; - } - - max_read = smi_data_buf_size - pos; - ret = min(max_read, count); - memcpy(buf, smi_data_buf + pos, ret); -out: + ret = memory_read_from_buffer(buf, count, &pos, smi_data_buf, + smi_data_buf_size); mutex_unlock(&smi_data_lock); return ret; } -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/