static ssize_t show_debug_level(struct device *dev, struct device_attribute *attr, char *buf) { ssize_t ret = 0; ret += snprintf(buf+ret, PAGE_SIZE-ret, "%d", gpu_get_debug_level()); if (ret < PAGE_SIZE - 1) { ret += snprintf(buf+ret, PAGE_SIZE-ret, "\n"); } else { buf[PAGE_SIZE-2] = '\n'; buf[PAGE_SIZE-1] = '\0'; ret = PAGE_SIZE-1; } return ret; }
static ssize_t show_debug_level(struct device *dev, struct device_attribute *attr, char *buf) { ssize_t ret = 0; ret += snprintf(buf+ret, PAGE_SIZE-ret, "[Current] %d (%d ~ %d)", gpu_get_debug_level(), DVFS_DEBUG_START+1, DVFS_DEBUG_END-1); if (ret < PAGE_SIZE - 1) { ret += snprintf(buf+ret, PAGE_SIZE-ret, "\n"); } else { buf[PAGE_SIZE-2] = '\n'; buf[PAGE_SIZE-1] = '\0'; ret = PAGE_SIZE-1; } return ret; }