#define _GNU_SOURCE #include #include #include #include "cookie.h" static char const *priov[] = { [LOG_EMERG] = "EMERG:", [LOG_ALERT] = "ALERT:", [LOG_CRIT] = "CRIT:", [LOG_ERR] = "ERR:", [LOG_WARNING] = "WARNING:", [LOG_NOTICE] = "NOTICE:", [LOG_INFO] = "INFO:", [LOG_DEBUG] = "DEBUG:", }; static ssize_t cookie_writer(void *cookie, char const *data, size_t leng) { int prio = LOG_DEBUG, len; do { len = strlen(priov[prio]); } while (memcmp(data, priov[prio], len) && --prio >= 0); if (prio < 0) { prio = LOG_INFO; } else { data += len; leng -= len; } while (*data == ' ') { ++data; --leng; } syslog(prio, "%.*s", (int) leng, data); return leng; } static cookie_io_functions_t cookie_log = { .write = cookie_writer, }; void to_std_log(FILE **fp) { setvbuf(*fp = fopencookie(NULL, "w", cookie_log), NULL, _IOLBF, 0); } hod='get'> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Richardson <jonathar@broadcom.com>2016-10-31 14:45:18 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-10 15:34:55 +0100
commitdff20aa1a076ae5aab2170dd541fe52d729fb3f4 (patch)
tree3ee559d79fc5129be7890cad4776383a28a0102c /Documentation
parentb16ebc017ebf52a81e5e88743ccd68fc25e99ba9 (diff)
dt-bindings: Document Broadcom OTP controller driver
Reviewed-by: Ray Jui <ray.jui@broadcom.com> Tested-by: Jonathan Richardson <jonathan.richardson@broadcom.com> Signed-off-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Oza Pawandeep <oza@broadcom.com> Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation')