/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Subject to the GPL, version 2. */ #include #include #include #include "str.h" size_t strlcpy(char *dest, const char *src, size_t size) { size_t ret = strlen(src); if (size) { size_t len = (ret >= size) ? size - 1 : ret; memcpy(dest, src, len); dest[len] = '\0'; } return ret; } static inline int vslprintf(char *dst, size_t size, const char *fmt, va_list ap) { int ret; ret = vsnprintf(dst, size, fmt, ap); dst[size - 1] = '\0'; return ret; } int slprintf(char *dst, size_t size, const char *fmt, ...) { int ret; va_list ap; va_start(ap, fmt); ret = vslprintf(dst, size, fmt, ap); va_end(ap); return ret; } int slprintf_nocheck(char *dst, size_t size, const char *fmt, ...) { int ret; va_list ap; va_start(ap, fmt); ret = vslprintf(dst, size, fmt, ap); va_end(ap); return ret; } noinline void *xmemset(void *s, int c, size_t n) { size_t i; uint8_t *ptr = s; for (i = 0; i < n; ++i) ptr[i] = (uint8_t) c; return ptr; } char *strtrim_right(char *p, char c) { char *end; size_t len; len = strlen(p); while (*p && len) { end = p + len - 1; if (c == *end) *end = 0; else break; len = strlen(p); } return p; } t-loop-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2016-09-08 12:54:24 -0700
committerStephen Boyd <sboyd@codeaurora.org>2016-09-08 12:54:24 -0700
commite4abe2b9ab3ac79537d99dfceff7302739a586bc (patch)
treeed6034e05fff8f19c24b4fc4828bb8d87e0d5235
parentdc7066c54107255f5f9a11bf3f82417c9b1aef51 (diff)
parent6654674cb7b5953ac04fc9d7f5f511676ae97e29 (diff)
Merge tag 'sunxi-clk-fixes-for-4.8' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux into clk-fixes
Clock Fixes for the Allwinner SoCs, 4.8 Edition The usual bunch of fixes to the our clock drivers, mostly targetted to the brand new sunxi-ng drivers. * tag 'sunxi-clk-fixes-for-4.8' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux: clk: sunxi-ng: Fix wrong reset register offsets clk: sunxi-ng: nk: Make ccu_nk_find_best static clk: sunxi-ng: Fix inverted test condition in ccu_helper_wait_for_lock clk: sunxi: Fix return value check in sun8i_a23_mbus_setup() clk: sunxi: pll2: Fix return value check in sun4i_pll2_setup()