unsigned int timeout;
int nr_drex = ARRAY_SIZE(exynos_drex) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %d %x\n", &drex_ip, &scen, &qos, &timeout);
if (ret != 4) {
int ip, scen, rw, mo, ret;
int nr_ip = ARRAY_SIZE(exynos_bts) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %d %d\n", &ip, &scen, &rw, &mo);
if (ret != 4) {
int ip, scen, rw, mo, ret;
int nr_ip = ARRAY_SIZE(exynos_bts) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %d %d\n", &ip, &scen, &rw, &mo);
if (ret != 4) {
int ip, scen, rw, mo, ret;
int nr_ip = ARRAY_SIZE(exynos_bts) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %d %d\n", &ip, &scen, &rw, &mo);
if (ret != 4) {
int ip, scen, prio, ret;
int nr_ip = ARRAY_SIZE(exynos_bts) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %d\n", &ip, &scen, &prio);
if (ret != 3) {
char *buf;
int ret;
u32 scen, on;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%u %u", &scen, &on);
if (ret != 2) {
char *buf;
unsigned int r0, r1, w0, w1;
int i, ret;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%u %u %u %u\n", &r0, &r1, &w0, &w1);
if (ret != 4) {
int ip, scen, rw, timeout, ret;
int nr_ip = ARRAY_SIZE(exynos_bts) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %d %d\n", &ip, &scen, &rw, &timeout);
if (ret != 4) {
int ip, scen, timeout_en, ret;
int nr_ip = ARRAY_SIZE(exynos_bts) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %d\n", &ip, &scen, &timeout_en);
if (ret != 3) {
unsigned int config;
int nr_drex = ARRAY_SIZE(exynos_drex) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %d %x\n", &drex_ip, &scen, &set, &config);
if (ret != 4) {
unsigned int threshold;
int nr_drex = ARRAY_SIZE(exynos_drex) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %d %x\n", &drex_ip, &scen, &qos, &threshold);
if (ret != 4) {
unsigned int control;
int nr_drex = ARRAY_SIZE(exynos_drex) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %x\n", &drex_ip, &scen, &control);
if (ret != 3) {
unsigned int config;
int nr_drex = ARRAY_SIZE(exynos_drex) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %x\n", &drex_ip, &scen, &config);
if (ret != 3) {
unsigned int config;
int nr_drex = ARRAY_SIZE(exynos_drex) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %x\n", &drex_ip, &scen, &config);
if (ret != 3) {
unsigned int control;
int nr_drex_pf = ARRAY_SIZE(exynos_drex_pf) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %x\n", &drex_pf_ip, &scen, &control);
if (ret != 3) {
unsigned int config;
int nr_drex_pf = ARRAY_SIZE(exynos_drex_pf) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %x\n", &drex_pf_ip, &scen, &config);
if (ret != 3) {
unsigned int timeout;
int nr_drex_pf = ARRAY_SIZE(exynos_drex_pf) - 1;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d %d %x\n", &drex_pf_ip, &scen, &qos, &timeout);
if (ret != 4) {
char *buf;
int scen, control, ret;
int nr_scen = ARRAY_SIZE(bts_scen) - 1;
+ ssize_t len;
buf = kmalloc(count, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
- ret = copy_from_user(buf, user_buf, count);
- if (ret < 0)
- goto out;
+ len = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
+ if (len < 0)
+ return len;
- buf[count] = '\0';
+ buf[len] = '\0';
ret = sscanf(buf, "%d %d\n", &scen, &control);
if (ret != 2) {