From dec049d92427a4bf8bf4083f4ebaedbc5dc83e7b Mon Sep 17 00:00:00 2001 From: Eric Nelson Date: Sat, 3 Mar 2012 12:02:20 +0000 Subject: part_dos: align disk buffers on cache line to enable DMA and cache Signed-off-by: Eric Nelson Acked-by: Mike Frysinger --- disk/part_dos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/disk/part_dos.c b/disk/part_dos.c index b5bcb3735c..c028aaf1b1 100644 --- a/disk/part_dos.c +++ b/disk/part_dos.c @@ -87,7 +87,7 @@ static int test_block_type(unsigned char *buffer) int test_part_dos (block_dev_desc_t *dev_desc) { - unsigned char buffer[dev_desc->blksz]; + ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz); if ((dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *) buffer) != 1) || (buffer[DOS_PART_MAGIC_OFFSET + 0] != 0x55) || @@ -102,7 +102,7 @@ int test_part_dos (block_dev_desc_t *dev_desc) static void print_partition_extended (block_dev_desc_t *dev_desc, int ext_part_sector, int relative, int part_num) { - unsigned char buffer[dev_desc->blksz]; + ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz); dos_partition_t *pt; int i; @@ -166,7 +166,7 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part int relative, int part_num, int which_part, disk_partition_t *info) { - unsigned char buffer[dev_desc->blksz]; + ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz); dos_partition_t *pt; int i; -- cgit From 9a800ac718abcac0aff6f98b922ceb236f411ffd Mon Sep 17 00:00:00 2001 From: Eric Nelson Date: Wed, 11 Apr 2012 04:08:53 +0000 Subject: fs/fat: align disk buffers on cache line to enable DMA and cache Signed-off-by: Eric Nelson Acked-by: Mike Frysinger --- fs/fat/fat.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 1f95eb4caf..a3085b51d9 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -31,6 +31,8 @@ #include #include #include +#include +#include /* * Convert a string to lowercase. @@ -62,7 +64,7 @@ static int disk_read(__u32 block, __u32 nr_blocks, void *buf) int fat_register_device (block_dev_desc_t * dev_desc, int part_no) { - unsigned char buffer[dev_desc->blksz]; + ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz); /* First close any currently found FAT filesystem */ cur_dev = NULL; @@ -293,7 +295,7 @@ get_cluster (fsdata *mydata, __u32 clustnum, __u8 *buffer, return -1; } if (size % mydata->sect_size) { - __u8 tmpbuf[mydata->sect_size]; + ALLOC_CACHE_ALIGN_BUFFER(__u8, tmpbuf, mydata->sect_size); idx = size / mydata->sect_size; ret = disk_read(startsect + idx, 1, tmpbuf); @@ -428,8 +430,8 @@ static int slot2str (dir_slot *slotptr, char *l_name, int *idx) * into 'retdent' * Return 0 on success, -1 otherwise. */ -__attribute__ ((__aligned__ (__alignof__ (dir_entry)))) -__u8 get_vfatname_block[MAX_CLUSTSIZE]; +__u8 get_vfatname_block[MAX_CLUSTSIZE] + __aligned(ARCH_DMA_MINALIGN); static int get_vfatname (fsdata *mydata, int curclust, __u8 *cluster, @@ -533,8 +535,8 @@ static __u8 mkcksum (const char *str) * Get the directory entry associated with 'filename' from the directory * starting at 'startsect' */ -__attribute__ ((__aligned__ (__alignof__ (dir_entry)))) -__u8 get_dentfromdir_block[MAX_CLUSTSIZE]; +__u8 get_dentfromdir_block[MAX_CLUSTSIZE] + __aligned(ARCH_DMA_MINALIGN); static dir_entry *get_dentfromdir (fsdata *mydata, int startsect, char *filename, dir_entry *retdent, @@ -709,7 +711,7 @@ read_bootsectandvi (boot_sector *bs, volume_info *volinfo, int *fatsize) return -1; } - block = malloc(cur_dev->blksz); + block = memalign(ARCH_DMA_MINALIGN, cur_dev->blksz); if (block == NULL) { debug("Error: allocating block\n"); return -1; @@ -765,8 +767,8 @@ exit: return ret; } -__attribute__ ((__aligned__ (__alignof__ (dir_entry)))) -__u8 do_fat_read_block[MAX_CLUSTSIZE]; +__u8 do_fat_read_block[MAX_CLUSTSIZE] + __aligned(ARCH_DMA_MINALIGN); long do_fat_read (const char *filename, void *buffer, unsigned long maxsize, @@ -828,7 +830,7 @@ do_fat_read (const char *filename, void *buffer, unsigned long maxsize, } mydata->fatbufnum = -1; - mydata->fatbuf = malloc(FATBUFSIZE); + mydata->fatbuf = memalign(ARCH_DMA_MINALIGN, FATBUFSIZE); if (mydata->fatbuf == NULL) { debug("Error: allocating memory\n"); return -1; -- cgit From e3ed0575a7ce68c1c533978fc171c7611598dc4e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 9 Apr 2012 13:39:53 +0000 Subject: gunzip: rename z{alloc, free} to gz{alloc, free} This allows us to add a proper zalloc() func (one that does a zeroing alloc), and removes duplicate prototypes. Signed-off-by: Mike Frysinger --- 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 228fe68c11..f431cc46c1 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 fb2708186d..fbb08a3287 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 8b16b2495f..99a8ab0287 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) { -- cgit From 4e2c05873a7c51b13a8ddf1eeda4dc96c37013c4 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 9 Apr 2012 13:39:54 +0000 Subject: lin_gadget: use common mdelay No need to provide our own mdelay() macro when we have a func for it. Signed-off-by: Mike Frysinger --- include/usb/lin_gadget_compat.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/usb/lin_gadget_compat.h b/include/usb/lin_gadget_compat.h index fce3be7e80..1b937e43a2 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 -- cgit From 7b15e2bb9b1026925f0f98243cd6cf80bd3fb47d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 9 Apr 2012 13:39:55 +0000 Subject: linux/compat.h: rename from linux/mtd/compat.h This lets us use it in more places than just mtd code. Signed-off-by: Mike Frysinger --- 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/compat.h | 52 +++++++++++++++++++++++++++++++++++++ include/linux/err.h | 2 +- include/linux/mtd/compat.h | 52 ------------------------------------- include/linux/mtd/mtd-abi.h | 2 +- include/linux/mtd/nand.h | 2 +- include/linux/mtd/onenand.h | 2 +- include/nand.h | 2 +- 21 files changed, 71 insertions(+), 71 deletions(-) create mode 100644 include/linux/compat.h delete mode 100644 include/linux/mtd/compat.h diff --git a/board/samsung/smdkc100/onenand.c b/board/samsung/smdkc100/onenand.c index 501855edd3..e34cd31f24 100644 --- a/board/samsung/smdkc100/onenand.c +++ b/board/samsung/smdkc100/onenand.c @@ -22,7 +22,7 @@ */ #include -#include +#include #include #include #include diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c index 0f2e208717..a0d25e5521 100644 --- a/common/cmd_onenand.c +++ b/common/cmd_onenand.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/common/env_onenand.c b/common/env_onenand.c index 652665a189..7197ab6585 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index fc2270127a..e6d938417d 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c @@ -9,7 +9,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index a195ddab35..3a81adaf60 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -8,7 +8,7 @@ */ #include -#include +#include #include struct mtd_info *mtd_table[MAX_MTD_DEVICES]; diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index f647e43668..96dcda2b2b 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include /* 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 7fd8a35479..e6b7a70661 100644 --- a/drivers/mtd/nand/mpc5121_nfc.c +++ b/drivers/mtd/nand/mpc5121_nfc.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 44f7b91457..bef79bed0f 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 2b730e09c9..dc6c6480e5 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c @@ -61,7 +61,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 1d0f196c12..1a7b40eaa3 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c @@ -20,7 +20,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c index 1354877729..9d5da54708 100644 --- a/drivers/mtd/onenand/onenand_bbt.c +++ b/drivers/mtd/onenand/onenand_bbt.c @@ -15,7 +15,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/mtd/onenand/onenand_uboot.c b/drivers/mtd/onenand/onenand_uboot.c index c642016c2d..ae60c3bb71 100644 --- a/drivers/mtd/onenand/onenand_uboot.c +++ b/drivers/mtd/onenand/onenand_uboot.c @@ -14,7 +14,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c index c9d33ec825..0d94ea5b1f 100644 --- a/drivers/mtd/onenand/samsung.c +++ b/drivers/mtd/onenand/samsung.c @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c index a0b02e4dda..c856983ef4 100644 --- a/fs/jffs2/jffs2_1pass.c +++ b/fs/jffs2/jffs2_1pass.c @@ -119,7 +119,7 @@ #include #include #include -#include +#include #include #include "jffs2_private.h" diff --git a/include/linux/compat.h b/include/linux/compat.h new file mode 100644 index 0000000000..39c693f7a8 --- /dev/null +++ b/include/linux/compat.h @@ -0,0 +1,52 @@ +#ifndef _LINUX_COMPAT_H_ +#define _LINUX_COMPAT_H_ + +#define __user +#define __iomem + +#define ndelay(x) udelay(1) + +#define printk printf + +#define KERN_EMERG +#define KERN_ALERT +#define KERN_CRIT +#define KERN_ERR +#define KERN_WARNING +#define KERN_NOTICE +#define KERN_INFO +#define KERN_DEBUG + +#define kmalloc(size, flags) malloc(size) +#define kzalloc(size, flags) calloc(size, 1) +#define vmalloc(size) malloc(size) +#define kfree(ptr) free(ptr) +#define vfree(ptr) free(ptr) + +#define DECLARE_WAITQUEUE(...) do { } while (0) +#define add_wait_queue(...) do { } while (0) +#define remove_wait_queue(...) do { } while (0) + +#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) + +/* + * ..and if you can't take the strict + * types, you can specify one yourself. + * + * Or not use min/max at all, of course. + */ +#define min_t(type,x,y) \ + ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) +#define max_t(type,x,y) \ + ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; }) + +#ifndef BUG +#define BUG() do { \ + printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \ +} while (0) + +#define BUG_ON(condition) do { if (condition) BUG(); } while(0) +#endif /* BUG */ + +#define PAGE_SIZE 4096 +#endif diff --git a/include/linux/err.h b/include/linux/err.h index 4e08c4fe68..96c0c72baa 100644 --- a/include/linux/err.h +++ b/include/linux/err.h @@ -5,7 +5,7 @@ #if 0 #include #else -#include +#include #endif #include diff --git a/include/linux/mtd/compat.h b/include/linux/mtd/compat.h deleted file mode 100644 index 39c693f7a8..0000000000 --- a/include/linux/mtd/compat.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _LINUX_COMPAT_H_ -#define _LINUX_COMPAT_H_ - -#define __user -#define __iomem - -#define ndelay(x) udelay(1) - -#define printk printf - -#define KERN_EMERG -#define KERN_ALERT -#define KERN_CRIT -#define KERN_ERR -#define KERN_WARNING -#define KERN_NOTICE -#define KERN_INFO -#define KERN_DEBUG - -#define kmalloc(size, flags) malloc(size) -#define kzalloc(size, flags) calloc(size, 1) -#define vmalloc(size) malloc(size) -#define kfree(ptr) free(ptr) -#define vfree(ptr) free(ptr) - -#define DECLARE_WAITQUEUE(...) do { } while (0) -#define add_wait_queue(...) do { } while (0) -#define remove_wait_queue(...) do { } while (0) - -#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) - -/* - * ..and if you can't take the strict - * types, you can specify one yourself. - * - * Or not use min/max at all, of course. - */ -#define min_t(type,x,y) \ - ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) -#define max_t(type,x,y) \ - ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; }) - -#ifndef BUG -#define BUG() do { \ - printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \ -} while (0) - -#define BUG_ON(condition) do { if (condition) BUG(); } while(0) -#endif /* BUG */ - -#define PAGE_SIZE 4096 -#endif diff --git a/include/linux/mtd/mtd-abi.h b/include/linux/mtd/mtd-abi.h index 8d5f60c75e..5991157065 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 +#include #endif struct erase_info_user { diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index da6fa184c3..82704de083 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 bb4a4a6b28..e7b63ddd10 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h @@ -17,7 +17,7 @@ /* Note: The header order is impoertant */ #include -#include +#include #include #define MAX_DIES 2 diff --git a/include/nand.h b/include/nand.h index 8b3a1a77a3..a48b1b8ed1 100644 --- a/include/nand.h +++ b/include/nand.h @@ -37,7 +37,7 @@ extern void nand_init(void); -#include +#include #include #include -- cgit From 6777a3cf73f621892afe938983918d2aea7730b5 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 26 Apr 2012 02:34:44 +0000 Subject: lin_gadget: use common linux/compat.h 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 Signed-off-by: Anatolij Gustschin Cc: Lukasz Majewski --- 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 1050a98b6c..9d11aea8e4 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 afd4931fa0..56e6e53de6 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 39c693f7a8..593b07f4b5 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 1b937e43a2..8287b9de9f 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 + /* 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); -- cgit