aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers/mtd
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-01-22 17:55:38 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-01-22 17:55:38 +0000
commit5a804a07102e8f60be635e43774d96aae400f608 (patch)
treeaaea838dffcc019b5f833e9a0083f761d41ac552 /target/linux/ar71xx/files/drivers/mtd
parent77681dfda2d8961fd47e6926b9acf3006b766413 (diff)
downloadupstream-5a804a07102e8f60be635e43774d96aae400f608.tar.gz
upstream-5a804a07102e8f60be635e43774d96aae400f608.tar.bz2
upstream-5a804a07102e8f60be635e43774d96aae400f608.zip
ar71xx: wrt160nl_part: include module.h and fix compiler warnings
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29856 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/drivers/mtd')
-rw-r--r--target/linux/ar71xx/files/drivers/mtd/wrt160nl_part.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/target/linux/ar71xx/files/drivers/mtd/wrt160nl_part.c b/target/linux/ar71xx/files/drivers/mtd/wrt160nl_part.c
index eabb47e029..d979365d66 100644
--- a/target/linux/ar71xx/files/drivers/mtd/wrt160nl_part.c
+++ b/target/linux/ar71xx/files/drivers/mtd/wrt160nl_part.c
@@ -22,6 +22,7 @@
*/
#include <linux/kernel.h>
+#include <linux/module.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
@@ -91,11 +92,15 @@ static int wrt160nl_parse_partitions(struct mtd_info *master,
struct uimage_header *uheader;
size_t retlen;
unsigned int kernel_len;
- unsigned int uboot_len = max(master->erasesize, WRT160NL_UBOOT_LEN);
- unsigned int nvram_len = max(master->erasesize, WRT160NL_NVRAM_LEN);
- unsigned int art_len = max(master->erasesize, WRT160NL_ART_LEN);
+ unsigned int uboot_len;
+ unsigned int nvram_len;
+ unsigned int art_len;
int ret;
+ uboot_len = max_t(unsigned int, master->erasesize, WRT160NL_UBOOT_LEN);
+ nvram_len = max_t(unsigned int, master->erasesize, WRT160NL_NVRAM_LEN);
+ art_len = max_t(unsigned int, master->erasesize, WRT160NL_ART_LEN);
+
header = vmalloc(sizeof(*header));
if (!header) {
return -ENOMEM;