From e165cac938b05211a6cba493f95905bf8eacf546 Mon Sep 17 00:00:00 2001 From: bluhm Date: Fri, 14 Apr 2017 15:11:31 +0000 Subject: [PATCH] Avoid some false positives with cppcheck. No binary change. OK jsg@ --- sys/dev/softraid.c | 5 +++-- sys/kern/kern_sig.c | 6 +++--- sys/net/if.c | 5 +++-- sys/net/if_spppsubr.c | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index a8365243b18..4135294d909 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.379 2017/03/27 17:42:19 deraadt Exp $ */ +/* $OpenBSD: softraid.c,v 1.380 2017/04/14 15:11:31 bluhm Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom * Copyright (c) 2008 Chris Kuethe @@ -5058,7 +5058,8 @@ sr_hibernate_io(dev_t dev, daddr_t blkno, vaddr_t addr, size_t size, int op, voi my->srd = sc->sc_targets[sd->sc_link->target]; DNPRINTF(SR_D_MISC, "sr_hibernate_io: discipline is %s\n", my->srd->sd_name); - if (strncmp(my->srd->sd_name, "CRYPTO", 10)) + if (strncmp(my->srd->sd_name, "CRYPTO", + sizeof(my->srd->sd_name))) return (ENOTSUP); /* Find the underlying device */ diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index fd64f0d4ae8..de0e1cb5a0f 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.209 2017/04/13 03:52:25 guenther Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.210 2017/04/14 15:11:31 bluhm Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -646,7 +646,7 @@ killpg1(struct proc *cp, int signum, int pgid, int all) struct pgrp *pgrp; int nfound = 0; - if (all) + if (all) { /* * broadcast */ @@ -659,7 +659,7 @@ killpg1(struct proc *cp, int signum, int pgid, int all) if (signum) prsignal(pr, signum); } - else { + } else { if (pgid == 0) /* * zero pgid means send to my process group. diff --git a/sys/net/if.c b/sys/net/if.c index 3004adcae68..3e95ef495dc 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.492 2017/03/22 12:45:22 mikeb Exp $ */ +/* $OpenBSD: if.c,v 1.493 2017/04/14 15:11:31 bluhm Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1368,7 +1368,7 @@ ifa_ifwithdstaddr(struct sockaddr *addr, u_int rdomain) TAILQ_FOREACH(ifp, &ifnet, if_list) { if (ifp->if_rdomain != rdomain) continue; - if (ifp->if_flags & IFF_POINTOPOINT) + if (ifp->if_flags & IFF_POINTOPOINT) { TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { if (ifa->ifa_addr->sa_family != addr->sa_family || ifa->ifa_dstaddr == NULL) @@ -1376,6 +1376,7 @@ ifa_ifwithdstaddr(struct sockaddr *addr, u_int rdomain) if (equal(addr, ifa->ifa_dstaddr)) return (ifa); } + } } return (NULL); } diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index c71eaf81fdd..bc9e30fbd41 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.162 2017/01/24 10:08:30 krw Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.163 2017/04/14 15:11:31 bluhm Exp $ */ /* * Synchronous PPP link level subroutines. * @@ -3100,7 +3100,7 @@ sppp_ipv6cp_scr(struct sppp *sp) if (sp->ipv6cp.opts & (1 << IPV6CP_OPT_COMPRESSION)) { opt[i++] = IPV6CP_OPT_COMPRESSION; opt[i++] = 4; -p opt[i++] = 0; /* TBD */ + opt[i++] = 0; /* TBD */ opt[i++] = 0; /* TBD */ /* variable length data may follow */ } -- 2.20.1