diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2015-07-03 23:18:33 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2015-07-03 23:18:33 +0000 |
commit | 596345c98d86e0f7e98649356c57c4ea1a48299c (patch) | |
tree | 3c314bf2e603bf087f1ec9fc8d861320e63c6c31 /target/linux/brcm47xx/patches-4.1/031-01-MIPS-BCM47XX-Make-sure-NVRAM-buffer-ends-with-0.patch | |
parent | 3e77770be6b25f18588d361caa42d8a4b9c70390 (diff) | |
download | master-187ad058-596345c98d86e0f7e98649356c57c4ea1a48299c.tar.gz master-187ad058-596345c98d86e0f7e98649356c57c4ea1a48299c.tar.bz2 master-187ad058-596345c98d86e0f7e98649356c57c4ea1a48299c.zip |
brcm47xx: add support for kernel 4.1
This adds support for kernel 4.1 and removes kernel 4.0.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46166 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-4.1/031-01-MIPS-BCM47XX-Make-sure-NVRAM-buffer-ends-with-0.patch')
-rw-r--r-- | target/linux/brcm47xx/patches-4.1/031-01-MIPS-BCM47XX-Make-sure-NVRAM-buffer-ends-with-0.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-4.1/031-01-MIPS-BCM47XX-Make-sure-NVRAM-buffer-ends-with-0.patch b/target/linux/brcm47xx/patches-4.1/031-01-MIPS-BCM47XX-Make-sure-NVRAM-buffer-ends-with-0.patch new file mode 100644 index 0000000000..7577da10a8 --- /dev/null +++ b/target/linux/brcm47xx/patches-4.1/031-01-MIPS-BCM47XX-Make-sure-NVRAM-buffer-ends-with-0.patch @@ -0,0 +1,54 @@ +From 4ddb225376a2802a4e20e16f71c6d37b679e3169 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com> +Date: Tue, 12 May 2015 18:46:11 +0200 +Subject: [PATCH] MIPS: BCM47XX: Make sure NVRAM buffer ends with \0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This will simplify reading its contents. + +Signed-off-by: Rafał Miłecki <zajec5@gmail.com> +Cc: linux-mips@linux-mips.org +Cc: Hauke Mehrtens <hauke@hauke-m.de> +Cc: Hante Meuleman <meuleman@broadcom.com> +Cc: Ian Kent <raven@themaw.net> +Patchwork: https://patchwork.linux-mips.org/patch/10031/ +Signed-off-by: Ralf Baechle <ralf@linux-mips.org> +--- + arch/mips/bcm47xx/nvram.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/arch/mips/bcm47xx/nvram.c ++++ b/arch/mips/bcm47xx/nvram.c +@@ -98,7 +98,7 @@ found: + pr_err("The nvram size accoridng to the header seems to be bigger than the partition on flash\n"); + if (header->len > NVRAM_SPACE) + pr_err("nvram on flash (%i bytes) is bigger than the reserved space in memory, will just copy the first %i bytes\n", +- header->len, NVRAM_SPACE); ++ header->len, NVRAM_SPACE - 1); + + src = (u32 *)header; + dst = (u32 *)nvram_buf; +@@ -106,6 +106,7 @@ found: + *dst++ = __raw_readl(src++); + for (; i < header->len && i < NVRAM_SPACE && i < size; i += 4) + *dst++ = readl(src++); ++ nvram_buf[NVRAM_SPACE - 1] = '\0'; + + return 0; + } +@@ -150,10 +151,10 @@ static int nvram_init(void) + u8 *dst = (uint8_t *)nvram_buf; + size_t len = header.len; + +- if (header.len > NVRAM_SPACE) { ++ if (len >= NVRAM_SPACE) { ++ len = NVRAM_SPACE - 1; + pr_err("nvram on flash (%i bytes) is bigger than the reserved space in memory, will just copy the first %i bytes\n", +- header.len, NVRAM_SPACE); +- len = NVRAM_SPACE; ++ header.len, len); + } + + err = mtd_read(mtd, 0, len, &bytes_read, dst); |