Module Name: src Committed By: maxv Date: Sat Sep 21 07:08:27 UTC 2019
Modified Files: src/sys/dev/ic: mpt.c mpt_netbsd.h Log Message: Add __printflike, and fix two incorrect fmts. Reported by the lgtm bot. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/dev/ic/mpt.c cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ic/mpt_netbsd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/mpt.c diff -u src/sys/dev/ic/mpt.c:1.18 src/sys/dev/ic/mpt.c:1.19 --- src/sys/dev/ic/mpt.c:1.18 Tue Jan 30 20:15:41 2018 +++ src/sys/dev/ic/mpt.c Sat Sep 21 07:08:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mpt.c,v 1.18 2018/01/30 20:15:41 jakllsch Exp $ */ +/* $NetBSD: mpt.c,v 1.19 2019/09/21 07:08:27 maxv Exp $ */ /* * Copyright (c) 2000, 2001 by Greg Ansley @@ -110,7 +110,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mpt.c,v 1.18 2018/01/30 20:15:41 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mpt.c,v 1.19 2019/09/21 07:08:27 maxv Exp $"); #include <dev/ic/mpt.h> @@ -327,7 +327,7 @@ mpt_send_cmd(mpt_softc_t *mpt, request_t if (mpt->verbose > 1) { u_int32_t *pReq; pReq = req->req_vbuf; - mpt_prt(mpt, "Send Request %d (0x%x):", + mpt_prt(mpt, "Send Request %d (%#lx):", req->index, req->req_pbuf); mpt_prt(mpt, "%08x %08x %08x %08x", pReq[0], pReq[1], pReq[2], pReq[3]); @@ -460,7 +460,7 @@ mpt_recv_handshake_reply(mpt_softc_t *mp /* With the second word, we can now look at the length */ if (mpt->verbose > 1 && ((reply_len >> 1) != hdr->MsgLength)) { mpt_prt(mpt, "reply length does not match message length: " - "got 0x%02x, expected 0x%02x", + "got 0x%02x, expected %#02zx", hdr->MsgLength << 2, reply_len << 1); } Index: src/sys/dev/ic/mpt_netbsd.h diff -u src/sys/dev/ic/mpt_netbsd.h:1.12 src/sys/dev/ic/mpt_netbsd.h:1.13 --- src/sys/dev/ic/mpt_netbsd.h:1.12 Tue Jan 30 19:13:08 2018 +++ src/sys/dev/ic/mpt_netbsd.h Sat Sep 21 07:08:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mpt_netbsd.h,v 1.12 2018/01/30 19:13:08 jakllsch Exp $ */ +/* $NetBSD: mpt_netbsd.h,v 1.13 2019/09/21 07:08:27 maxv Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -253,7 +253,7 @@ typedef struct mpt_softc { void mpt_scsipi_attach(mpt_softc_t *); int mpt_dma_mem_alloc(mpt_softc_t *); int mpt_intr(void *); -void mpt_prt(mpt_softc_t *, const char *, ...); +void mpt_prt(mpt_softc_t *, const char *, ...) __printflike(2, 3); #define mpt_set_config_regs(mpt) \ do { \