From 4bf95d6fff7bc3727fa4d4b916b2c6e4fcf87a83 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 14 Jul 2013 14:15:09 +0200 Subject: geoip: Fix sign compare warnings array_size() returns size_t, thus make iterator variables comparing against it size_t too to avoid a warning regarding comparison of signed/unsigned. Also cast some ssize_t variables passed to min() for the same reason. Signed-off-by: Tobias Klauser --- geoip.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/geoip.c b/geoip.c index d027e14..d79236c 100644 --- a/geoip.c +++ b/geoip.c @@ -198,15 +198,15 @@ again: raw[sizeof(raw) - 1] = 0; for (i = 0; i < ret; i++) { - if (!strncmp(raw + i, "Content-Length: ", min(ret - i, lenl))) { + if (!strncmp(raw + i, "Content-Length: ", min((size_t)(ret - i), lenl))) { ptr = raw + i + lenl; rtotlen = strtoul(ptr, NULL, 10); } - if (!strncmp(raw + i, "HTTP/1.1 200 OK", min(ret - i, lent))) + if (!strncmp(raw + i, "HTTP/1.1 200 OK", min((size_t)(ret - i), lent))) good = 1; - if (!strncmp(raw + i, "\r\n\r\n", min(ret - i, lenc))) { + if (!strncmp(raw + i, "\r\n\r\n", min((size_t)(ret - i), lenc))) { ptr = raw + i + lenc; len = ret - i - lenc; found = 1; @@ -522,7 +522,7 @@ static void destroy_geoip_asname(void) static void init_mirrors(void) { - int i = 0; + size_t i = 0; FILE *fp; char buff[256]; @@ -550,7 +550,7 @@ static void init_mirrors(void) static void destroy_mirrors(void) { - int i; + size_t i; for (i = 0; i < array_size(servers); ++i) free(servers[i]); @@ -565,7 +565,8 @@ void init_geoip(int enforce) void update_geoip(void) { - int i, j, ret, good = 0; + size_t i, j; + int ret, good = 0; init_mirrors(); -- cgit v1.2.3-54-g00ecf inux/net-next.git/log/'>logtreecommitdiff
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-05-20 08:19:20 +0200
committerIngo Molnar <mingo@kernel.org>2016-05-20 08:20:14 +0200
commit21f77d231fabd33c5de61fbff31818d93203353e (patch)
tree74bd85f1184b26409605884bf65ae1c1ba5d724c
parentb0a434fb7412937d55f15b8897c5646c81497bbe (diff)
parenta29d5c9b8167dbc21a7ca8c0302e3799f9063b4e (diff)
Merge tag 'perf-core-for-mingo-20160516' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: User visible changes: - Honour the kernel.perf_event_max_stack knob more precisely by not counting PERF_CONTEXT_{KERNEL,USER} when deciding when to stop adding entries to the perf_sample->ip_callchain[] array (Arnaldo Carvalho de Melo) - Fix identation of 'stalled-backend-cycles' in 'perf stat' (Namhyung Kim) - Update runtime using 'cpu-clock' event in 'perf stat' (Namhyung Kim) - Use 'cpu-clock' for cpu targets in 'perf stat' (Namhyung Kim) - Avoid fractional digits for integer scales in 'perf stat' (Andi Kleen) - Store vdso buildid unconditionally, as it appears in callchains and we're not checking those when creating the build-id table, so we end up not being able to resolve VDSO symbols when doing analysis on a different machine than the one where recording was done, possibly of a different arch even (arm -> x86_64) (He Kuang) Infrastructure changes: - Generalize max_stack sysctl handler, will be used for configuring multiple kernel knobs related to callchains (Arnaldo Carvalho de Melo) Cleanups: - Introduce DSO__NAME_KALLSYMS and DSO__NAME_KCORE, to stop using open coded strings (Masami Hiramatsu) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>