Lines Matching defs:buf
55 static inline size_t my_memlen(const char *buf, size_t count)
57 if (count > 0 && buf[count-1] == '\n')
143 struct device_attribute *attr, char *buf) \
148 return sprintf(buf, "%u\n", mydev->name); \
152 struct device_attribute *attr, const char *buf, size_t count) \
157 mydev->name = simple_strtoul(buf, NULL, 10); \
165 struct device_attribute *attr, char *buf)
170 return sysfs_emit(buf, "%s\n", mydev->text);
174 struct device_attribute *attr, const char *buf, size_t count)
178 size_t end = my_memlen(buf, count);
187 memcpy(mydev->text, buf, end);
196 struct device_attribute *attr, char *buf)
206 buf[pos] = '0';
208 buf[pos] = '1';
210 buf[pos] = 'x';
213 buf[sizeof(mydev->decimals)] = '\n';
218 struct device_attribute *attr, const char *buf, size_t count)
222 size_t end = my_memlen(buf, count);
229 if (buf[i] != '0' && buf[i] != '1')
234 if (buf[i] == '1')
245 struct device_attribute *attr, char *buf)
251 buf[0] = 0;
255 strcat(buf, " [");
256 strcat(buf, display_textmodes[i]);
257 strcat(buf, "] ");
259 strcat(buf, " ");
260 strcat(buf, display_textmodes[i]);
261 strcat(buf, " ");
264 strcat(buf, "\n");
267 return strlen(buf);
271 struct device_attribute *attr, const char *buf, size_t count)
277 i = sysfs_match_string(display_textmodes, buf);