* [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free}
@ 2012-04-09 23:39 Mike Frysinger
2012-04-09 23:39 ` [U-Boot] [PATCH 2/4] lin_gadget: use common mdelay Mike Frysinger
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Mike Frysinger @ 2012-04-09 23:39 UTC (permalink / raw)
To: u-boot
This allows us to add a proper zalloc() func (one that does a zeroing
alloc), and removes duplicate prototypes.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
fs/cramfs/uncompress.c | 7 ++-----
include/u-boot/zlib.h | 3 +++
lib/gunzip.c | 11 ++++-------
3 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/fs/cramfs/uncompress.c b/fs/cramfs/uncompress.c
index 228fe68..f431cc4 100644
--- a/fs/cramfs/uncompress.c
+++ b/fs/cramfs/uncompress.c
@@ -27,9 +27,6 @@
static z_stream stream;
-void *zalloc(void *, unsigned, unsigned);
-void zfree(void *, void *, unsigned);
-
/* Returns length of decompressed data. */
int cramfs_uncompress_block (void *dst, void *src, int srclen)
{
@@ -59,8 +56,8 @@ int cramfs_uncompress_init (void)
{
int err;
- stream.zalloc = zalloc;
- stream.zfree = zfree;
+ stream.zalloc = gzalloc;
+ stream.zfree = gzfree;
stream.next_in = 0;
stream.avail_in = 0;
diff --git a/include/u-boot/zlib.h b/include/u-boot/zlib.h
index fb27081..fbb08a3 100644
--- a/include/u-boot/zlib.h
+++ b/include/u-boot/zlib.h
@@ -691,6 +691,9 @@ ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif
+extern void *gzalloc(void *, unsigned, unsigned);
+extern void gzfree(void *, void *, unsigned);
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/gunzip.c b/lib/gunzip.c
index 8b16b24..99a8ab0 100644
--- a/lib/gunzip.c
+++ b/lib/gunzip.c
@@ -36,10 +36,7 @@
#define RESERVED 0xe0
#define DEFLATED 8
-void *zalloc(void *, unsigned, unsigned);
-void zfree(void *, void *, unsigned);
-
-void *zalloc(void *x, unsigned items, unsigned size)
+void *gzalloc(void *x, unsigned items, unsigned size)
{
void *p;
@@ -51,7 +48,7 @@ void *zalloc(void *x, unsigned items, unsigned size)
return (p);
}
-void zfree(void *x, void *addr, unsigned nb)
+void gzfree(void *x, void *addr, unsigned nb)
{
free (addr);
}
@@ -94,8 +91,8 @@ int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
z_stream s;
int r;
- s.zalloc = zalloc;
- s.zfree = zfree;
+ s.zalloc = gzalloc;
+ s.zfree = gzfree;
r = inflateInit2(&s, -MAX_WBITS);
if (r != Z_OK) {
--
1.7.8.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 2/4] lin_gadget: use common mdelay
2012-04-09 23:39 [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free} Mike Frysinger
@ 2012-04-09 23:39 ` Mike Frysinger
2012-04-26 12:48 ` Anatolij Gustschin
2012-04-09 23:39 ` [U-Boot] [PATCH 3/4] linux/compat.h: rename from linux/mtd/compat.h Mike Frysinger
` (2 subsequent siblings)
3 siblings, 1 reply; 15+ messages in thread
From: Mike Frysinger @ 2012-04-09 23:39 UTC (permalink / raw)
To: u-boot
No need to provide our own mdelay() macro when we have a func for it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
include/usb/lin_gadget_compat.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/include/usb/lin_gadget_compat.h b/include/usb/lin_gadget_compat.h
index fce3be7..1b937e4 100644
--- a/include/usb/lin_gadget_compat.h
+++ b/include/usb/lin_gadget_compat.h
@@ -52,7 +52,6 @@
#define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
#define kfree(addr) free(addr)
-#define mdelay(n) ({unsigned long msec = (n); while (msec--) udelay(1000); })
#define __iomem
#define min_t min
--
1.7.8.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 3/4] linux/compat.h: rename from linux/mtd/compat.h
2012-04-09 23:39 [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free} Mike Frysinger
2012-04-09 23:39 ` [U-Boot] [PATCH 2/4] lin_gadget: use common mdelay Mike Frysinger
@ 2012-04-09 23:39 ` Mike Frysinger
2012-04-26 13:03 ` Anatolij Gustschin
2012-04-09 23:39 ` [U-Boot] [PATCH 4/4] lin_gadget: use common linux/compat.h Mike Frysinger
2012-04-26 12:47 ` [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free} Anatolij Gustschin
3 siblings, 1 reply; 15+ messages in thread
From: Mike Frysinger @ 2012-04-09 23:39 UTC (permalink / raw)
To: u-boot
This lets us use it in more places than just mtd code.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
board/samsung/smdkc100/onenand.c | 2 +-
common/cmd_onenand.c | 2 +-
common/env_onenand.c | 2 +-
drivers/mtd/mtdconcat.c | 2 +-
drivers/mtd/mtdcore.c | 2 +-
drivers/mtd/mtdpart.c | 2 +-
drivers/mtd/nand/mpc5121_nfc.c | 2 +-
drivers/mtd/nand/nand_base.c | 2 +-
drivers/mtd/nand/nand_bbt.c | 2 +-
drivers/mtd/onenand/onenand_base.c | 2 +-
drivers/mtd/onenand/onenand_bbt.c | 2 +-
drivers/mtd/onenand/onenand_uboot.c | 2 +-
drivers/mtd/onenand/samsung.c | 2 +-
fs/jffs2/jffs2_1pass.c | 2 +-
include/linux/{mtd => }/compat.h | 0
include/linux/err.h | 2 +-
include/linux/mtd/mtd-abi.h | 2 +-
include/linux/mtd/nand.h | 2 +-
include/linux/mtd/onenand.h | 2 +-
include/nand.h | 2 +-
20 files changed, 19 insertions(+), 19 deletions(-)
rename include/linux/{mtd => }/compat.h (100%)
diff --git a/board/samsung/smdkc100/onenand.c b/board/samsung/smdkc100/onenand.c
index 501855e..e34cd31 100644
--- a/board/samsung/smdkc100/onenand.c
+++ b/board/samsung/smdkc100/onenand.c
@@ -22,7 +22,7 @@
*/
#include <common.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
#include <linux/mtd/samsung_onenand.h>
diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
index 0f2e208..a0d25e5 100644
--- a/common/cmd_onenand.c
+++ b/common/cmd_onenand.c
@@ -13,7 +13,7 @@
#include <command.h>
#include <malloc.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
diff --git a/common/env_onenand.c b/common/env_onenand.c
index 652665a..7197ab6 100644
--- a/common/env_onenand.c
+++ b/common/env_onenand.c
@@ -33,7 +33,7 @@
#include <errno.h>
#include <onenand_uboot.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index fc22701..e6d9384 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -9,7 +9,7 @@
*/
#include <linux/mtd/mtd.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/concat.h>
#include <ubi_uboot.h>
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index a195dda..3a81ada 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -8,7 +8,7 @@
*/
#include <linux/mtd/mtd.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <ubi_uboot.h>
struct mtd_info *mtd_table[MAX_MTD_DEVICES];
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index f647e43..96dcda2 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -17,7 +17,7 @@
#include <linux/list.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
/* Our partition linked list */
struct list_head mtd_partitions;
diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index 7fd8a35..e6b7a70 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -29,7 +29,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/nand_ecc.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <asm/errno.h>
#include <asm/io.h>
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 44f7b91..bef79be 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -39,7 +39,7 @@
#include <malloc.h>
#include <watchdog.h>
#include <linux/err.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/nand_ecc.h>
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 2b730e0..dc6c648 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -61,7 +61,7 @@
#include <common.h>
#include <malloc.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/nand_ecc.h>
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 480ae7a..96a5b08 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -20,7 +20,7 @@
*/
#include <common.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c
index 1354877..9d5da54 100644
--- a/drivers/mtd/onenand/onenand_bbt.c
+++ b/drivers/mtd/onenand/onenand_bbt.c
@@ -15,7 +15,7 @@
*/
#include <common.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
#include <malloc.h>
diff --git a/drivers/mtd/onenand/onenand_uboot.c b/drivers/mtd/onenand/onenand_uboot.c
index c642016..ae60c3b 100644
--- a/drivers/mtd/onenand/onenand_uboot.c
+++ b/drivers/mtd/onenand/onenand_uboot.c
@@ -14,7 +14,7 @@
*/
#include <common.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c
index c9d33ec..0d94ea5 100644
--- a/drivers/mtd/onenand/samsung.c
+++ b/drivers/mtd/onenand/samsung.c
@@ -28,7 +28,7 @@
#include <common.h>
#include <malloc.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
#include <linux/mtd/samsung_onenand.h>
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index a0b02e4..c856983 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -119,7 +119,7 @@
#include <watchdog.h>
#include <jffs2/jffs2.h>
#include <jffs2/jffs2_1pass.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <asm/errno.h>
#include "jffs2_private.h"
diff --git a/include/linux/mtd/compat.h b/include/linux/compat.h
similarity index 100%
rename from include/linux/mtd/compat.h
rename to include/linux/compat.h
diff --git a/include/linux/err.h b/include/linux/err.h
index 4e08c4f..96c0c72 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -5,7 +5,7 @@
#if 0
#include <linux/compiler.h>
#else
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#endif
#include <asm/errno.h>
diff --git a/include/linux/mtd/mtd-abi.h b/include/linux/mtd/mtd-abi.h
index 8d5f60c..5991157 100644
--- a/include/linux/mtd/mtd-abi.h
+++ b/include/linux/mtd/mtd-abi.h
@@ -8,7 +8,7 @@
#define __MTD_ABI_H__
#if 1
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#endif
struct erase_info_user {
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index da6fa18..82704de 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -20,7 +20,7 @@
#include "config.h"
-#include "linux/mtd/compat.h"
+#include "linux/compat.h"
#include "linux/mtd/mtd.h"
#include "linux/mtd/bbm.h"
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index bb4a4a6..e7b63dd 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -17,7 +17,7 @@
/* Note: The header order is impoertant */
#include <onenand_uboot.h>
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/bbm.h>
#define MAX_DIES 2
diff --git a/include/nand.h b/include/nand.h
index 8b3a1a7..a48b1b8 100644
--- a/include/nand.h
+++ b/include/nand.h
@@ -37,7 +37,7 @@
extern void nand_init(void);
-#include <linux/mtd/compat.h>
+#include <linux/compat.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
--
1.7.8.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 4/4] lin_gadget: use common linux/compat.h
2012-04-09 23:39 [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free} Mike Frysinger
2012-04-09 23:39 ` [U-Boot] [PATCH 2/4] lin_gadget: use common mdelay Mike Frysinger
2012-04-09 23:39 ` [U-Boot] [PATCH 3/4] linux/compat.h: rename from linux/mtd/compat.h Mike Frysinger
@ 2012-04-09 23:39 ` Mike Frysinger
2012-04-25 8:11 ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2012-04-26 12:47 ` [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free} Anatolij Gustschin
3 siblings, 1 reply; 15+ messages in thread
From: Mike Frysinger @ 2012-04-09 23:39 UTC (permalink / raw)
To: u-boot
Merge our duplicate definitions with the common header.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
include/linux/compat.h | 3 +++
include/usb/lin_gadget_compat.h | 15 ++-------------
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 39c693f..593b07f 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -48,5 +48,8 @@
#define BUG_ON(condition) do { if (condition) BUG(); } while(0)
#endif /* BUG */
+#define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
+ , __FILE__, __LINE__); }
+
#define PAGE_SIZE 4096
#endif
diff --git a/include/usb/lin_gadget_compat.h b/include/usb/lin_gadget_compat.h
index 1b937e4..8287b9d 100644
--- a/include/usb/lin_gadget_compat.h
+++ b/include/usb/lin_gadget_compat.h
@@ -23,6 +23,8 @@
#ifndef __LIN_COMPAT_H__
#define __LIN_COMPAT_H__
+#include <linux/compat.h>
+
/* common */
#define spin_lock_init(...)
#define spin_lock(...)
@@ -36,25 +38,12 @@
#define mutex_lock(...)
#define mutex_unlock(...)
-#define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
- , __FILE__, __LINE__); }
-
-#define KERN_WARNING
-#define KERN_ERR
-#define KERN_NOTICE
-#define KERN_DEBUG
-
#define GFP_KERNEL 0
#define IRQ_HANDLED 1
#define ENOTSUPP 524 /* Operation is not supported */
-#define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
-#define kfree(addr) free(addr)
-
-#define __iomem
-#define min_t min
#define dma_cache_maint(addr, size, mode) cache_flush()
void cache_flush(void);
--
1.7.8.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2 4/4] lin_gadget: use common linux/compat.h
2012-04-09 23:39 ` [U-Boot] [PATCH 4/4] lin_gadget: use common linux/compat.h Mike Frysinger
@ 2012-04-25 8:11 ` Anatolij Gustschin
2012-04-25 15:14 ` Mike Frysinger
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Anatolij Gustschin @ 2012-04-25 8:11 UTC (permalink / raw)
To: u-boot
From: Mike Frysinger <vapier@gentoo.org>
Merge our duplicate definitions with the common header.
Also fix drivers/usb/gadget/s3c_udc_otg_xfer_dma.c to
use min() instead of min_t() since we remove the latter
from compat.h.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
v2:
- fix build breakage:
In file included from s3c_udc_otg.c:212:0:
s3c_udc_otg_xfer_dma.c: In function 'setdma_tx':
s3c_udc_otg_xfer_dma.c:171:47: error: macro "min_t" requires 3 arguments, but only 2 given
s3c_udc_otg_xfer_dma.c:171:12: error: 'min_t' undeclared (first use in this function)
drivers/usb/gadget/s3c_udc_otg_xfer_dma.c | 2 +-
include/linux/compat.h | 3 +++
include/usb/lin_gadget_compat.h | 15 ++-------------
3 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
index afd4931..56e6e53 100644
--- a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
+++ b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
@@ -168,7 +168,7 @@ int setdma_tx(struct s3c_ep *ep, struct s3c_request *req)
length = req->req.length - req->req.actual;
if (ep_num == EP0_CON)
- length = min_t(length, (u32)ep_maxpacket(ep));
+ length = min(length, (u32)ep_maxpacket(ep));
ep->len = length;
ep->dma_buf = buf;
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 39c693f..593b07f 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -48,5 +48,8 @@
#define BUG_ON(condition) do { if (condition) BUG(); } while(0)
#endif /* BUG */
+#define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
+ , __FILE__, __LINE__); }
+
#define PAGE_SIZE 4096
#endif
diff --git a/include/usb/lin_gadget_compat.h b/include/usb/lin_gadget_compat.h
index 1b937e4..8287b9d 100644
--- a/include/usb/lin_gadget_compat.h
+++ b/include/usb/lin_gadget_compat.h
@@ -23,6 +23,8 @@
#ifndef __LIN_COMPAT_H__
#define __LIN_COMPAT_H__
+#include <linux/compat.h>
+
/* common */
#define spin_lock_init(...)
#define spin_lock(...)
@@ -36,25 +38,12 @@
#define mutex_lock(...)
#define mutex_unlock(...)
-#define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
- , __FILE__, __LINE__); }
-
-#define KERN_WARNING
-#define KERN_ERR
-#define KERN_NOTICE
-#define KERN_DEBUG
-
#define GFP_KERNEL 0
#define IRQ_HANDLED 1
#define ENOTSUPP 524 /* Operation is not supported */
-#define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
-#define kfree(addr) free(addr)
-
-#define __iomem
-#define min_t min
#define dma_cache_maint(addr, size, mode) cache_flush()
void cache_flush(void);
--
1.7.7.6
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2 4/4] lin_gadget: use common linux/compat.h
2012-04-25 8:11 ` [U-Boot] [PATCH v2 " Anatolij Gustschin
@ 2012-04-25 15:14 ` Mike Frysinger
2012-04-25 15:58 ` Lukasz Majewski
2012-04-26 12:34 ` [U-Boot] [PATCH v3 " Anatolij Gustschin
2 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2012-04-25 15:14 UTC (permalink / raw)
To: u-boot
On Wednesday 25 April 2012 04:11:41 Anatolij Gustschin wrote:
> From: Mike Frysinger <vapier@gentoo.org>
>
> Merge our duplicate definitions with the common header.
> Also fix drivers/usb/gadget/s3c_udc_otg_xfer_dma.c to
> use min() instead of min_t() since we remove the latter
> from compat.h.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
> v2:
> - fix build breakage:
> In file included from s3c_udc_otg.c:212:0:
> s3c_udc_otg_xfer_dma.c: In function 'setdma_tx':
> s3c_udc_otg_xfer_dma.c:171:47: error: macro "min_t" requires 3
> arguments, but only 2 given s3c_udc_otg_xfer_dma.c:171:12: error: 'min_t'
> undeclared (first use in this function)
we'll prob want to merge the mtd/compat.h stuff in to linux/compat.h, like the
min_t() macro
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120425/899f6046/attachment.pgp>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2 4/4] lin_gadget: use common linux/compat.h
2012-04-25 8:11 ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2012-04-25 15:14 ` Mike Frysinger
@ 2012-04-25 15:58 ` Lukasz Majewski
2012-04-26 9:03 ` Anatolij Gustschin
2012-04-26 12:34 ` [U-Boot] [PATCH v3 " Anatolij Gustschin
2 siblings, 1 reply; 15+ messages in thread
From: Lukasz Majewski @ 2012-04-25 15:58 UTC (permalink / raw)
To: u-boot
Hi Anatolij,
> From: Mike Frysinger <vapier@gentoo.org>
>
> Merge our duplicate definitions with the common header.
> Also fix drivers/usb/gadget/s3c_udc_otg_xfer_dma.c to
> use min() instead of min_t() since we remove the latter
> from compat.h.
Yes. the include/usb/lin_gadget_compat.h layer.
Good idea to provide one compat file (as fair as I remember similar
problem is with mtd/compat.h).
I'll look into the include/linux.h file.
--
Best regards,
Lukasz Majewski
Samsung Poland R&D Center | Linux Platform Group
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2 4/4] lin_gadget: use common linux/compat.h
2012-04-25 15:58 ` Lukasz Majewski
@ 2012-04-26 9:03 ` Anatolij Gustschin
2012-04-26 10:32 ` Lukasz Majewski
0 siblings, 1 reply; 15+ messages in thread
From: Anatolij Gustschin @ 2012-04-26 9:03 UTC (permalink / raw)
To: u-boot
Hi Lukasz,
On Wed, 25 Apr 2012 17:58:51 +0200
Lukasz Majewski <l.majewski@samsung.com> wrote:
> Hi Anatolij,
>
> > From: Mike Frysinger <vapier@gentoo.org>
> >
> > Merge our duplicate definitions with the common header.
> > Also fix drivers/usb/gadget/s3c_udc_otg_xfer_dma.c to
> > use min() instead of min_t() since we remove the latter
> > from compat.h.
>
> Yes. the include/usb/lin_gadget_compat.h layer.
> Good idea to provide one compat file (as fair as I remember similar
> problem is with mtd/compat.h).
>
> I'll look into the include/linux.h file.
Mike already moved mtd/compat.h to linux/compat.h, please see this
patch http://patchwork.ozlabs.org/patch/151500/
Now I see another issue. In this 4/4 patch we are removing kmalloc:
-#define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
linux/compat.h defines kmalloc() to be malloc(), so the gadget driver
should probably use memalign() directly where it is needed?
Thanks,
Anatolij
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2 4/4] lin_gadget: use common linux/compat.h
2012-04-26 9:03 ` Anatolij Gustschin
@ 2012-04-26 10:32 ` Lukasz Majewski
2012-04-26 10:55 ` Anatolij Gustschin
0 siblings, 1 reply; 15+ messages in thread
From: Lukasz Majewski @ 2012-04-26 10:32 UTC (permalink / raw)
To: u-boot
Hi Anatolij,
> > Hi Anatolij,
> >
> > > From: Mike Frysinger <vapier@gentoo.org>
> > >
> > > Merge our duplicate definitions with the common header.
> > > Also fix drivers/usb/gadget/s3c_udc_otg_xfer_dma.c to
> > > use min() instead of min_t() since we remove the latter
> > > from compat.h.
> >
> > Yes. the include/usb/lin_gadget_compat.h layer.
> > Good idea to provide one compat file (as fair as I remember similar
> > problem is with mtd/compat.h).
> >
> > I'll look into the include/linux.h file.
>
> Mike already moved mtd/compat.h to linux/compat.h, please see this
> patch http://patchwork.ozlabs.org/patch/151500/
>
> Now I see another issue. In this 4/4 patch we are removing kmalloc:
>
> -#define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
>
> linux/compat.h defines kmalloc() to be malloc(), so the gadget driver
> should probably use memalign() directly where it is needed?
In the include/usb/lin_gadget_compat.h the
#define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
line is defined.
I think that memalign can be used directly, no problem.
--
Best regards,
Lukasz Majewski
Samsung Poland R&D Center | Linux Platform Group
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v2 4/4] lin_gadget: use common linux/compat.h
2012-04-26 10:32 ` Lukasz Majewski
@ 2012-04-26 10:55 ` Anatolij Gustschin
0 siblings, 0 replies; 15+ messages in thread
From: Anatolij Gustschin @ 2012-04-26 10:55 UTC (permalink / raw)
To: u-boot
Hi Lukasz,
On Thu, 26 Apr 2012 12:32:40 +0200
Lukasz Majewski <l.majewski@samsung.com> wrote:
...
> > Now I see another issue. In this 4/4 patch we are removing kmalloc:
> >
> > -#define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
> >
> > linux/compat.h defines kmalloc() to be malloc(), so the gadget driver
> > should probably use memalign() directly where it is needed?
>
> In the include/usb/lin_gadget_compat.h the
>
> #define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
> line is defined.
>
> I think that memalign can be used directly, no problem.
Okay, I'll change this patch accordingly and will resubmit v3 then.
Thanks,
Anatolij
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v3 4/4] lin_gadget: use common linux/compat.h
2012-04-25 8:11 ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2012-04-25 15:14 ` Mike Frysinger
2012-04-25 15:58 ` Lukasz Majewski
@ 2012-04-26 12:34 ` Anatolij Gustschin
2012-04-30 14:51 ` Anatolij Gustschin
2 siblings, 1 reply; 15+ messages in thread
From: Anatolij Gustschin @ 2012-04-26 12:34 UTC (permalink / raw)
To: u-boot
From: Mike Frysinger <vapier@gentoo.org>
Merge our duplicate definitions with the common header.
Also fix drivers/usb/gadget/s3c_udc_otg_xfer_dma.c to
use min() instead of min_t() since we remove the latter
from compat.h.
Additionally use memalign() directly as the lin_gadget
specific kmalloc() macro is removed from lin_gadget_compat.h
by this patch.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
---
v3:
- use memalign() in the s3c_udc_otg driver directly
v2:
- fix build breakage:
In file included from s3c_udc_otg.c:212:0:
s3c_udc_otg_xfer_dma.c: In function 'setdma_tx':
s3c_udc_otg_xfer_dma.c:171:47: error: macro "min_t" requires 3 arguments, but only 2 given
s3c_udc_otg_xfer_dma.c:171:12: error: 'min_t' undeclared (first use in this function)
drivers/usb/gadget/s3c_udc_otg.c | 5 +++--
drivers/usb/gadget/s3c_udc_otg_xfer_dma.c | 2 +-
include/linux/compat.h | 3 +++
include/usb/lin_gadget_compat.h | 15 ++-------------
4 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index 1050a98..9d11aea 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -671,7 +671,7 @@ static struct usb_request *s3c_alloc_request(struct usb_ep *ep,
debug("%s: %s %p\n", __func__, ep->name, ep);
- req = kmalloc(sizeof *req, gfp_flags);
+ req = memalign(CONFIG_SYS_CACHELINE_SIZE, sizeof(*req));
if (!req)
return 0;
@@ -865,7 +865,8 @@ int s3c_udc_probe(struct s3c_plat_otg_data *pdata)
the_controller = dev;
for (i = 0; i < S3C_MAX_ENDPOINTS+1; i++) {
- dev->dma_buf[i] = kmalloc(DMA_BUFFER_SIZE, GFP_KERNEL);
+ dev->dma_buf[i] = memalign(CONFIG_SYS_CACHELINE_SIZE,
+ DMA_BUFFER_SIZE);
dev->dma_addr[i] = (dma_addr_t) dev->dma_buf[i];
invalidate_dcache_range((unsigned long) dev->dma_buf[i],
(unsigned long) (dev->dma_buf[i]
diff --git a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
index afd4931..56e6e53 100644
--- a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
+++ b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
@@ -168,7 +168,7 @@ int setdma_tx(struct s3c_ep *ep, struct s3c_request *req)
length = req->req.length - req->req.actual;
if (ep_num == EP0_CON)
- length = min_t(length, (u32)ep_maxpacket(ep));
+ length = min(length, (u32)ep_maxpacket(ep));
ep->len = length;
ep->dma_buf = buf;
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 39c693f..593b07f 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -48,5 +48,8 @@
#define BUG_ON(condition) do { if (condition) BUG(); } while(0)
#endif /* BUG */
+#define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
+ , __FILE__, __LINE__); }
+
#define PAGE_SIZE 4096
#endif
diff --git a/include/usb/lin_gadget_compat.h b/include/usb/lin_gadget_compat.h
index 1b937e4..8287b9d 100644
--- a/include/usb/lin_gadget_compat.h
+++ b/include/usb/lin_gadget_compat.h
@@ -23,6 +23,8 @@
#ifndef __LIN_COMPAT_H__
#define __LIN_COMPAT_H__
+#include <linux/compat.h>
+
/* common */
#define spin_lock_init(...)
#define spin_lock(...)
@@ -36,25 +38,12 @@
#define mutex_lock(...)
#define mutex_unlock(...)
-#define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \
- , __FILE__, __LINE__); }
-
-#define KERN_WARNING
-#define KERN_ERR
-#define KERN_NOTICE
-#define KERN_DEBUG
-
#define GFP_KERNEL 0
#define IRQ_HANDLED 1
#define ENOTSUPP 524 /* Operation is not supported */
-#define kmalloc(size, type) memalign(CONFIG_SYS_CACHELINE_SIZE, size)
-#define kfree(addr) free(addr)
-
-#define __iomem
-#define min_t min
#define dma_cache_maint(addr, size, mode) cache_flush()
void cache_flush(void);
--
1.7.7.6
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free}
2012-04-09 23:39 [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free} Mike Frysinger
` (2 preceding siblings ...)
2012-04-09 23:39 ` [U-Boot] [PATCH 4/4] lin_gadget: use common linux/compat.h Mike Frysinger
@ 2012-04-26 12:47 ` Anatolij Gustschin
3 siblings, 0 replies; 15+ messages in thread
From: Anatolij Gustschin @ 2012-04-26 12:47 UTC (permalink / raw)
To: u-boot
On Mon, 9 Apr 2012 19:39:53 -0400
Mike Frysinger <vapier@gentoo.org> wrote:
> This allows us to add a proper zalloc() func (one that does a zeroing
> alloc), and removes duplicate prototypes.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> fs/cramfs/uncompress.c | 7 ++-----
> include/u-boot/zlib.h | 3 +++
> lib/gunzip.c | 11 ++++-------
> 3 files changed, 9 insertions(+), 12 deletions(-)
Applied to u-boot-staging/agust at denx.de, thanks.
Anatolij
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 2/4] lin_gadget: use common mdelay
2012-04-09 23:39 ` [U-Boot] [PATCH 2/4] lin_gadget: use common mdelay Mike Frysinger
@ 2012-04-26 12:48 ` Anatolij Gustschin
0 siblings, 0 replies; 15+ messages in thread
From: Anatolij Gustschin @ 2012-04-26 12:48 UTC (permalink / raw)
To: u-boot
On Mon, 9 Apr 2012 19:39:54 -0400
Mike Frysinger <vapier@gentoo.org> wrote:
> No need to provide our own mdelay() macro when we have a func for it.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> include/usb/lin_gadget_compat.h | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
Applied to u-boot-staging/agust at denx.de, thanks.
Anatolij
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 3/4] linux/compat.h: rename from linux/mtd/compat.h
2012-04-09 23:39 ` [U-Boot] [PATCH 3/4] linux/compat.h: rename from linux/mtd/compat.h Mike Frysinger
@ 2012-04-26 13:03 ` Anatolij Gustschin
0 siblings, 0 replies; 15+ messages in thread
From: Anatolij Gustschin @ 2012-04-26 13:03 UTC (permalink / raw)
To: u-boot
On Mon, 9 Apr 2012 19:39:55 -0400
Mike Frysinger <vapier@gentoo.org> wrote:
> This lets us use it in more places than just mtd code.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> board/samsung/smdkc100/onenand.c | 2 +-
> common/cmd_onenand.c | 2 +-
> common/env_onenand.c | 2 +-
> drivers/mtd/mtdconcat.c | 2 +-
> drivers/mtd/mtdcore.c | 2 +-
> drivers/mtd/mtdpart.c | 2 +-
> drivers/mtd/nand/mpc5121_nfc.c | 2 +-
> drivers/mtd/nand/nand_base.c | 2 +-
> drivers/mtd/nand/nand_bbt.c | 2 +-
> drivers/mtd/onenand/onenand_base.c | 2 +-
> drivers/mtd/onenand/onenand_bbt.c | 2 +-
> drivers/mtd/onenand/onenand_uboot.c | 2 +-
> drivers/mtd/onenand/samsung.c | 2 +-
> fs/jffs2/jffs2_1pass.c | 2 +-
> include/linux/{mtd => }/compat.h | 0
> include/linux/err.h | 2 +-
> include/linux/mtd/mtd-abi.h | 2 +-
> include/linux/mtd/nand.h | 2 +-
> include/linux/mtd/onenand.h | 2 +-
> include/nand.h | 2 +-
> 20 files changed, 19 insertions(+), 19 deletions(-)
> rename include/linux/{mtd => }/compat.h (100%)
Applied to u-boot-staging/agust at denx.de, thanks.
Anatolij
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH v3 4/4] lin_gadget: use common linux/compat.h
2012-04-26 12:34 ` [U-Boot] [PATCH v3 " Anatolij Gustschin
@ 2012-04-30 14:51 ` Anatolij Gustschin
0 siblings, 0 replies; 15+ messages in thread
From: Anatolij Gustschin @ 2012-04-30 14:51 UTC (permalink / raw)
To: u-boot
On Thu, 26 Apr 2012 14:34:44 +0200
Anatolij Gustschin <agust@denx.de> wrote:
> From: Mike Frysinger <vapier@gentoo.org>
>
> Merge our duplicate definitions with the common header.
>
> Also fix drivers/usb/gadget/s3c_udc_otg_xfer_dma.c to
> use min() instead of min_t() since we remove the latter
> from compat.h.
>
> Additionally use memalign() directly as the lin_gadget
> specific kmalloc() macro is removed from lin_gadget_compat.h
> by this patch.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> ---
> v3:
> - use memalign() in the s3c_udc_otg driver directly
>
> v2:
> - fix build breakage:
> In file included from s3c_udc_otg.c:212:0:
> s3c_udc_otg_xfer_dma.c: In function 'setdma_tx':
> s3c_udc_otg_xfer_dma.c:171:47: error: macro "min_t" requires 3 arguments, but only 2 given
> s3c_udc_otg_xfer_dma.c:171:12: error: 'min_t' undeclared (first use in this function)
>
> drivers/usb/gadget/s3c_udc_otg.c | 5 +++--
> drivers/usb/gadget/s3c_udc_otg_xfer_dma.c | 2 +-
> include/linux/compat.h | 3 +++
> include/usb/lin_gadget_compat.h | 15 ++-------------
> 4 files changed, 9 insertions(+), 16 deletions(-)
Applied to u-boot-staging/agust at denx.de. Thanks!
Anatolij
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2012-04-30 14:51 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-09 23:39 [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free} Mike Frysinger
2012-04-09 23:39 ` [U-Boot] [PATCH 2/4] lin_gadget: use common mdelay Mike Frysinger
2012-04-26 12:48 ` Anatolij Gustschin
2012-04-09 23:39 ` [U-Boot] [PATCH 3/4] linux/compat.h: rename from linux/mtd/compat.h Mike Frysinger
2012-04-26 13:03 ` Anatolij Gustschin
2012-04-09 23:39 ` [U-Boot] [PATCH 4/4] lin_gadget: use common linux/compat.h Mike Frysinger
2012-04-25 8:11 ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2012-04-25 15:14 ` Mike Frysinger
2012-04-25 15:58 ` Lukasz Majewski
2012-04-26 9:03 ` Anatolij Gustschin
2012-04-26 10:32 ` Lukasz Majewski
2012-04-26 10:55 ` Anatolij Gustschin
2012-04-26 12:34 ` [U-Boot] [PATCH v3 " Anatolij Gustschin
2012-04-30 14:51 ` Anatolij Gustschin
2012-04-26 12:47 ` [U-Boot] [PATCH 1/4] gunzip: rename z{alloc, free} to gz{alloc, free} Anatolij Gustschin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.