Wed Jul 18 21:55:05 2012 UTC ()
Remove unused variable.


(joerg)
diff -r1.5 -r1.6 src/sys/arch/x86/x86/powernow.c

cvs diff -r1.5 -r1.6 src/sys/arch/x86/x86/powernow.c (expand / switch to unified diff)

--- src/sys/arch/x86/x86/powernow.c 2012/06/02 21:36:42 1.5
+++ src/sys/arch/x86/x86/powernow.c 2012/07/18 21:55:05 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: powernow.c,v 1.5 2012/06/02 21:36:42 dsl Exp $ */ 1/* $NetBSD: powernow.c,v 1.6 2012/07/18 21:55:05 joerg Exp $ */
2/* $OpenBSD: powernow-k8.c,v 1.8 2006/06/16 05:58:50 gwk Exp $ */ 2/* $OpenBSD: powernow-k8.c,v 1.8 2006/06/16 05:58:50 gwk Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2004, 2006, 2008 The NetBSD Foundation, Inc. 5 * Copyright (c) 2004, 2006, 2008 The NetBSD Foundation, Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to The NetBSD Foundation 8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Juan Romero Pardines and Martin Vegiard. 9 * by Juan Romero Pardines and Martin Vegiard.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -47,27 +47,27 @@ @@ -47,27 +47,27 @@
47 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 47 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
48 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 48 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 49 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
50 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 50 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
51 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 51 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
52 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 52 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
53 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 53 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
54 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 54 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
55 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 55 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
56 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 */ 57 */
58 58
59#include <sys/cdefs.h> 59#include <sys/cdefs.h>
60__KERNEL_RCSID(0, "$NetBSD: powernow.c,v 1.5 2012/06/02 21:36:42 dsl Exp $"); 60__KERNEL_RCSID(0, "$NetBSD: powernow.c,v 1.6 2012/07/18 21:55:05 joerg Exp $");
61 61
62#include <sys/param.h> 62#include <sys/param.h>
63#include <sys/device.h> 63#include <sys/device.h>
64#include <sys/kmem.h> 64#include <sys/kmem.h>
65#include <sys/module.h> 65#include <sys/module.h>
66#include <sys/sysctl.h> 66#include <sys/sysctl.h>
67#include <sys/xcall.h> 67#include <sys/xcall.h>
68 68
69#include <dev/isa/isareg.h> 69#include <dev/isa/isareg.h>
70 70
71#include <x86/cpuvar.h> 71#include <x86/cpuvar.h>
72#include <x86/cputypes.h> 72#include <x86/cputypes.h>
73#include <x86/cpu_msr.h> 73#include <x86/cpu_msr.h>
@@ -657,27 +657,27 @@ powernow_k7_decode_pst(struct powernow_s @@ -657,27 +657,27 @@ powernow_k7_decode_pst(struct powernow_s
657 cstate->n_states = n; 657 cstate->n_states = n;
658 658
659 return 1; 659 return 1;
660} 660}
661 661
662#endif /* __i386__ */ 662#endif /* __i386__ */
663 663
664static int 664static int
665powernow_k8_init(device_t self) 665powernow_k8_init(device_t self)
666{ 666{
667 struct powernow_softc *sc = device_private(self); 667 struct powernow_softc *sc = device_private(self);
668 uint32_t i, maxfid, maxvid; 668 uint32_t i, maxfid, maxvid;
669 uint64_t status; 669 uint64_t status;
670 int len, rv; 670 int rv;
671 char tmp[6]; 671 char tmp[6];
672 672
673 sc->sc_state = kmem_alloc(sizeof(*sc->sc_state), KM_SLEEP); 673 sc->sc_state = kmem_alloc(sizeof(*sc->sc_state), KM_SLEEP);
674 674
675 if (sc->sc_state == NULL) 675 if (sc->sc_state == NULL)
676 return ENOMEM; 676 return ENOMEM;
677 677
678 status = rdmsr(MSR_AMDK7_FIDVID_STATUS); 678 status = rdmsr(MSR_AMDK7_FIDVID_STATUS);
679 maxfid = PN8_STA_MFID(status); 679 maxfid = PN8_STA_MFID(status);
680 maxvid = PN8_STA_MVID(status); 680 maxvid = PN8_STA_MVID(status);
681 681
682 if (powernow_k8_states(self, maxfid, maxvid) == 0) { 682 if (powernow_k8_states(self, maxfid, maxvid) == 0) {
683 rv = ENXIO; 683 rv = ENXIO;
@@ -696,27 +696,27 @@ powernow_k8_init(device_t self) @@ -696,27 +696,27 @@ powernow_k8_init(device_t self)
696 rv = ENOMEM; 696 rv = ENOMEM;
697 goto fail; 697 goto fail;
698 } 698 }
699 699
700 for (i = 0; i < sc->sc_state->n_states; i++) { 700 for (i = 0; i < sc->sc_state->n_states; i++) {
701 701
702 DPRINTF(("%s: cstate->state_table.freq=%d\n", 702 DPRINTF(("%s: cstate->state_table.freq=%d\n",
703 __func__, sc->sc_state->state_table[i].freq)); 703 __func__, sc->sc_state->state_table[i].freq));
704 704
705 DPRINTF(("%s: fid=%d vid=%d\n", __func__, 705 DPRINTF(("%s: fid=%d vid=%d\n", __func__,
706 sc->sc_state->state_table[i].fid, 706 sc->sc_state->state_table[i].fid,
707 sc->sc_state->state_table[i].vid)); 707 sc->sc_state->state_table[i].vid));
708 708
709 len += snprintf(tmp, sizeof(tmp), "%d%s", 709 snprintf(tmp, sizeof(tmp), "%d%s",
710 sc->sc_state->state_table[i].freq, 710 sc->sc_state->state_table[i].freq,
711 i < sc->sc_state->n_states - 1 ? " " : ""); 711 i < sc->sc_state->n_states - 1 ? " " : "");
712 712
713 DPRINTF(("%s: tmp=%s\n", __func__, tmp)); 713 DPRINTF(("%s: tmp=%s\n", __func__, tmp));
714 714
715 (void)strlcat(sc->sc_freqs, tmp, sc->sc_freqs_len); 715 (void)strlcat(sc->sc_freqs, tmp, sc->sc_freqs_len);
716 } 716 }
717 717
718 /* 718 /*
719 * If start FID is different to max FID, then it is a mobile 719 * If start FID is different to max FID, then it is a mobile
720 * processor. If not, it is a low powered desktop processor. 720 * processor. If not, it is a low powered desktop processor.
721 */ 721 */
722 sc->sc_tech = (PN8_STA_SFID(status) != PN8_STA_MFID(status)) ? 722 sc->sc_tech = (PN8_STA_SFID(status) != PN8_STA_MFID(status)) ?