git: f31e6b198faa - main - speaker(4): move static data to text
Date: Fri, 24 Apr 2026 22:07:24 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=f31e6b198faa98c4f8a7b681b4e01218f8468411
commit f31e6b198faa98c4f8a7b681b4e01218f8468411
Author: Raphael 'kena' Poss <knz@thaumogen.net>
AuthorDate: 2026-01-11 21:07:35 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2026-04-24 22:04:43 +0000
speaker(4): move static data to text
Make this data const (it doesn't change) which will also move it to
a text section.
Signed-off-by: Raphael Poss <knz@thaumogen.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
---
sys/dev/speaker/spkr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index 1280def98e79..d6ae47fdae99 100644
--- a/sys/dev/speaker/spkr.c
+++ b/sys/dev/speaker/spkr.c
@@ -158,7 +158,7 @@ struct spkr_state {
#define DENOM_MULT 2 /* denominator of dot multiplier */
/* letter to half-tone: A B C D E F G */
-static int notetab[8] = {9, 11, 0, 2, 4, 5, 7};
+static const int notetab[8] = {9, 11, 0, 2, 4, 5, 7};
/*
* This is the American Standard A440 Equal-Tempered scale with frequencies
@@ -166,7 +166,7 @@ static int notetab[8] = {9, 11, 0, 2, 4, 5, 7};
* our octave 0 is standard octave 2.
*/
#define OCTAVE_NOTES 12 /* semitones per octave */
-static int pitchtab[] =
+static const int pitchtab[] =
{
/* C C# D D# E F F# G G# A A# B*/
/* 0 */ 65, 69, 73, 78, 82, 87, 93, 98, 103, 110, 117, 123,