From ac70364f9c3148c8006cd01b7e152df220bb5ba6 Mon Sep 17 00:00:00 2001 From: "Christiano F. Haesbaert" Date: Fri, 5 Oct 2012 10:51:29 +0000 Subject: Avoid uninitiliazed use of ctl and corresponding warnings. Part of the work to remove -Wno-uninitialized. ok kettenis@ --- sys/dev/pci/alipm.c | 4 +++- sys/dev/pci/amdiic.c | 4 +++- sys/dev/pci/amdpm.c | 4 +++- sys/dev/pci/ichiic.c | 4 +++- sys/dev/pci/piixpm.c | 4 +++- sys/dev/pci/viapm.c | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/dev/pci/alipm.c b/sys/dev/pci/alipm.c index 8c71bd497e5..da1c657dedf 100644 --- a/sys/dev/pci/alipm.c +++ b/sys/dev/pci/alipm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alipm.c,v 1.15 2010/04/08 00:23:53 tedu Exp $ */ +/* $OpenBSD: alipm.c,v 1.16 2012/10/05 10:51:28 haesbaert Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -327,6 +327,8 @@ alipm_smb_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, ctl = ALIPM_SMB_HC_CMD_BDATA; else if (len == 2) ctl = ALIPM_SMB_HC_CMD_WDATA; + else + panic("%s: unexpected len %zd", __func__, len); bus_space_write_1(sc->sc_iot, sc->sc_ioh, ALIPM_SMB_HC, ctl); /* Start transaction */ diff --git a/sys/dev/pci/amdiic.c b/sys/dev/pci/amdiic.c index 51a64ce8fe8..f8203e893a6 100644 --- a/sys/dev/pci/amdiic.c +++ b/sys/dev/pci/amdiic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amdiic.c,v 1.9 2011/04/09 04:33:40 deraadt Exp $ */ +/* $OpenBSD: amdiic.c,v 1.10 2012/10/05 10:51:28 haesbaert Exp $ */ /* * Copyright (c) 2005 Alexander Yurchenko @@ -320,6 +320,8 @@ amdiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, proto = AMD8111_SMB_PROTO_BDATA; else if (len == 2) proto = AMD8111_SMB_PROTO_WDATA; + else + panic("%s: unexpected len %zd", __func__, len); /* Set direction */ if (I2C_OP_READ_P(op)) diff --git a/sys/dev/pci/amdpm.c b/sys/dev/pci/amdpm.c index ae7baae9e43..81063f43fc0 100644 --- a/sys/dev/pci/amdpm.c +++ b/sys/dev/pci/amdpm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amdpm.c,v 1.27 2012/08/16 18:41:17 tedu Exp $ */ +/* $OpenBSD: amdpm.c,v 1.28 2012/10/05 10:51:28 haesbaert Exp $ */ /* * Copyright (c) 2006 Alexander Yurchenko @@ -455,6 +455,8 @@ amdpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, ctl = AMDPM_SMBCTL_CMD_BDATA; else if (len == 2) ctl = AMDPM_SMBCTL_CMD_WDATA; + else + panic("%s: unexpected len %zd", __func__, len); if ((flags & I2C_F_POLL) == 0) ctl |= AMDPM_SMBCTL_CYCEN; diff --git a/sys/dev/pci/ichiic.c b/sys/dev/pci/ichiic.c index dc8ab5c3f49..0cb5a493295 100644 --- a/sys/dev/pci/ichiic.c +++ b/sys/dev/pci/ichiic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ichiic.c,v 1.28 2012/06/29 15:17:32 jasper Exp $ */ +/* $OpenBSD: ichiic.c,v 1.29 2012/10/05 10:51:28 haesbaert Exp $ */ /* * Copyright (c) 2005, 2006 Alexander Yurchenko @@ -264,6 +264,8 @@ ichiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, ctl = ICH_SMB_HC_CMD_BDATA; else if (len == 2) ctl = ICH_SMB_HC_CMD_WDATA; + else + panic("%s: unexpected len %zd", __func__, len); if ((flags & I2C_F_POLL) == 0) ctl |= ICH_SMB_HC_INTREN; diff --git a/sys/dev/pci/piixpm.c b/sys/dev/pci/piixpm.c index aa9504d42c9..782c1acc818 100644 --- a/sys/dev/pci/piixpm.c +++ b/sys/dev/pci/piixpm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: piixpm.c,v 1.37 2012/03/07 21:41:53 brynet Exp $ */ +/* $OpenBSD: piixpm.c,v 1.38 2012/10/05 10:51:28 haesbaert Exp $ */ /* * Copyright (c) 2005, 2006 Alexander Yurchenko @@ -321,6 +321,8 @@ piixpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, ctl = PIIX_SMB_HC_CMD_BDATA; else if (len == 2) ctl = PIIX_SMB_HC_CMD_WDATA; + else + panic("%s: unexpected len %zd", __func__, len); if ((flags & I2C_F_POLL) == 0) ctl |= PIIX_SMB_HC_INTREN; diff --git a/sys/dev/pci/viapm.c b/sys/dev/pci/viapm.c index cbf20ffd588..4977a6e1591 100644 --- a/sys/dev/pci/viapm.c +++ b/sys/dev/pci/viapm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: viapm.c,v 1.15 2012/08/16 18:41:17 tedu Exp $ */ +/* $OpenBSD: viapm.c,v 1.16 2012/10/05 10:51:28 haesbaert Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -576,6 +576,8 @@ viapm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, ctl = VIAPM_SMB_HC_CMD_BDATA; else if (len == 2) ctl = VIAPM_SMB_HC_CMD_WDATA; + else + panic("%s: unexpected len %zd", __func__, len); if ((flags & I2C_F_POLL) == 0) ctl |= VIAPM_SMB_HC_INTREN; -- cgit v1.2.3