lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <8edda9e0b7357f5177d9f3bb536a71025379f9cb.1471824129.git.joe@perches.com>
Date:   Sun, 21 Aug 2016 17:02:41 -0700
From:   Joe Perches <joe@...ches.com>
To:     Tony Luck <tony.luck@...el.com>,
        Doug Thompson <dougthompson@...ssion.com>,
        Borislav Petkov <bp@...en8.de>,
        Mauro Carvalho Chehab <mchehab@...nel.org>
Cc:     linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] skx_edac: Move a few hundred bytes to text from data using const

Marking arrays as const makes for smaller data.

Signed-off-by: Joe Perches <joe@...ches.com>
---
 drivers/edac/skx_edac.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/edac/skx_edac.c b/drivers/edac/skx_edac.c
index 0ff4878..875e74f 100644
--- a/drivers/edac/skx_edac.c
+++ b/drivers/edac/skx_edac.c
@@ -762,23 +762,23 @@ rir_found:
 	return true;
 }
 
-static u8 skx_close_row[] = {
+static const u8 skx_close_row[] = {
 	15, 16, 17, 18, 20, 21, 22, 28, 10, 11, 12, 13, 29, 30, 31, 32, 33
 };
-static u8 skx_close_column[] = {
+static const u8 skx_close_column[] = {
 	3, 4, 5, 14, 19, 23, 24, 25, 26, 27
 };
-static u8 skx_open_row[] = {
+static const u8 skx_open_row[] = {
 	14, 15, 16, 20, 28, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33
 };
-static u8 skx_open_column[] = {
+static const u8 skx_open_column[] = {
 	3, 4, 5, 6, 7, 8, 9, 10, 11, 12
 };
-static u8 skx_open_fine_column[] = {
+static const u8 skx_open_fine_column[] = {
 	3, 4, 5, 7, 8, 9, 10, 11, 12, 13
 };
 
-static int skx_bits(u64 addr, int nbits, u8 *bits)
+static int skx_bits(u64 addr, int nbits, const u8 *bits)
 {
 	int i, res = 0;
 
@@ -884,7 +884,8 @@ static void skx_mce_output_error(struct mem_ctl_info *mci,
 				 struct decoded_addr *res)
 {
 	enum hw_event_mc_err_type tp_event;
-	char *type, *optype, msg[256];
+	const char *type, *optype;
+	char msg[256];
 	bool ripv = GET_BITFIELD(m->mcgstatus, 0, 0);
 	bool overflow = GET_BITFIELD(m->status, 62, 62);
 	bool uncorrected_error = GET_BITFIELD(m->status, 61, 61);
-- 
2.8.0.rc4.16.g56331f8

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ