Lines Matching refs:buf
59 static inline size_t my_memlen(const char *buf, size_t count)
61 if (count > 0 && buf[count-1] == '\n')
175 struct device_attribute *attr, char *buf) \
180 return sprintf(buf, "%u\n", mydev->name); \
184 struct device_attribute *attr, const char *buf, size_t count) \
189 mydev->name = simple_strtoul(buf, NULL, 10); \
197 struct device_attribute *attr, char *buf)
202 return snprintf(buf, mydev->textlength, "%s\n", mydev->text);
206 struct device_attribute *attr, const char *buf, size_t count)
210 size_t end = my_memlen(buf, count);
219 memcpy(mydev->text, buf, end);
228 struct device_attribute *attr, char *buf)
238 buf[pos] = '0';
240 buf[pos] = '1';
242 buf[pos] = 'x';
245 buf[sizeof(mydev->decimals)] = '\n';
250 struct device_attribute *attr, const char *buf, size_t count)
254 size_t end = my_memlen(buf, count);
261 if (buf[i] != '0' && buf[i] != '1')
266 if (buf[i] == '1')
277 struct device_attribute *attr, char *buf)
283 buf[0] = 0;
287 strcat(buf, " [");
288 strcat(buf, display_textmodes[i]);
289 strcat(buf, "] ");
291 strcat(buf, " ");
292 strcat(buf, display_textmodes[i]);
293 strcat(buf, " ");
296 strcat(buf, "\n");
299 return strlen(buf);
303 struct device_attribute *attr, const char *buf, size_t count)
310 if (sysfs_streq(display_textmodes[i], buf)) {