/* * Copyright (C) 2014-2015 Tobias Klauser * Copyright (C) 2009-2012 Daniel Borkmann * * This file is part of llmnrd. * * llmnrd is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2 of the License. * * llmnrd is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with llmnrd. If not, see . */ #include #include #include "util.h" void *xmalloc(size_t size) { void *ptr; if (size == 0) panic("malloc: size 0\n"); ptr = malloc(size); if (!ptr) panic("malloc: out of memory\n"); return ptr; } void *xzalloc(size_t size) { void *ptr = xmalloc(size); memset(ptr, 0, size); return ptr; } void *xrealloc(void *ptr, size_t size) { void *newptr; if (size == 0) panic("realloc: size 0\n"); newptr = realloc(ptr, size); if (!newptr) { free(ptr); panic("realloc: out of memory\n"); } return newptr; } char *xstrdup(const char *s) { size_t len = strlen(s) + 1; char *ret = xmalloc(len); memcpy(ret, s, len); return ret; } ass='sub'>net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2016-04-20 08:41:36 +0200
committerWolfram Sang <wsa@the-dreams.de>2016-04-22 15:00:16 +0200
commit58d7b541dd96535b03cc9dd13fe9efff2a5402e0 (patch)
treef15c16b25829ca3b87524ed6243a2fe0b2eb97d6
parentcddcc40b1b1553010acb89add84c64b5d123ec94 (diff)
[media] si2168: convert to use an explicit i2c mux core
Allocate an explicit i2c mux core to handle parent and child adapters etc. Update the select/deselect ops to be in terms of the i2c mux core instead of the child adapter. Tested-by: Antti Palosaari <crope@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>