len = min_t(int, count, (i40e_dbg_dump_data_len - *ppos));
 
        bytes_not_copied = copy_to_user(buffer, &i40e_dbg_dump_buf[*ppos], len);
-       if (bytes_not_copied < 0)
-               return bytes_not_copied;
+       if (bytes_not_copied)
+               return -EFAULT;
 
        *ppos += len;
        return len;
        bytes_not_copied = copy_to_user(buffer, buf, len);
        kfree(buf);
 
-       if (bytes_not_copied < 0)
-               return bytes_not_copied;
+       if (bytes_not_copied)
+               return -EFAULT;
 
        *ppos = len;
        return len;
        if (!cmd_buf)
                return count;
        bytes_not_copied = copy_from_user(cmd_buf, buffer, count);
-       if (bytes_not_copied < 0) {
+       if (bytes_not_copied) {
                kfree(cmd_buf);
-               return bytes_not_copied;
+               return -EFAULT;
        }
-       if (bytes_not_copied > 0)
-               count -= bytes_not_copied;
        cmd_buf[count] = '\0';
 
        cmd_buf_tmp = strchr(cmd_buf, '\n');
        bytes_not_copied = copy_to_user(buffer, buf, len);
        kfree(buf);
 
-       if (bytes_not_copied < 0)
-               return bytes_not_copied;
+       if (bytes_not_copied)
+               return -EFAULT;
 
        *ppos = len;
        return len;
        memset(i40e_dbg_netdev_ops_buf, 0, sizeof(i40e_dbg_netdev_ops_buf));
        bytes_not_copied = copy_from_user(i40e_dbg_netdev_ops_buf,
                                          buffer, count);
-       if (bytes_not_copied < 0)
-               return bytes_not_copied;
-       else if (bytes_not_copied > 0)
-               count -= bytes_not_copied;
+       if (bytes_not_copied)
+               return -EFAULT;
        i40e_dbg_netdev_ops_buf[count] = '\0';
 
        buf_tmp = strchr(i40e_dbg_netdev_ops_buf, '\n');