gunzip: rename z{alloc, free} to gz{alloc, free}
Subsystems (7)
PATCH 1/4 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.
--- fs/cramfs/uncompress.c | 7 ++----- include/u-boot/zlib.h | 3 +++ lib/gunzip.c | 11 ++++------- 3 files changed, 9 insertions(+), 12 deletions(-)
fs/cramfs/uncompress.c +2 -5
@@ -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 ;
include/u-boot/zlib.h +3 -0
@@ -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
lib/gunzip.c +4 -7
@@ -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 ) {
Signature · 1 line
1.7.8.5
PATCH 2/4 lin_gadget: use common mdelay
No need to provide our own mdelay() macro when we have a func for it.
--- include/usb/lin_gadget_compat.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
include/usb/lin_gadget_compat.h +0 -1
@@ -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
Signature · 1 line
1.7.8.5
PATCH 2/4 lin_gadget: use common mdelay
Quoted 6 lines · On Mon, 9 Apr 2012 19:39:54 -0400 Mike Frysinger <[email protected]> wrote:
No need to provide our own
mdelay()macro when we have a func for it.Signed-off-by Mike Frysinger <[email protected]>--- 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
PATCH 3/4 linux/compat.h: rename from linux/mtd/compat.h
In reply to Mike FrysingerThis lets us use it in more places than just mtd code.
---
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%)board/samsung/smdkc100/onenand.c +1 -1
@@ -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>
common/cmd_onenand.c +1 -1
@@ -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>
common/env_onenand.c +1 -1
@@ -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>
drivers/mtd/mtdconcat.c +1 -1
@@ -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>
drivers/mtd/mtdcore.c +1 -1
@@ -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 ];
drivers/mtd/mtdpart.c +1 -1
@@ -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;
drivers/mtd/nand/mpc5121_nfc.c +1 -1
@@ -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>
drivers/mtd/nand/nand_base.c +1 -1
@@ -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>
drivers/mtd/nand/nand_bbt.c +1 -1
@@ -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>
drivers/mtd/onenand/onenand_base.c +1 -1
@@ -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>
drivers/mtd/onenand/onenand_bbt.c +1 -1
@@ -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>
drivers/mtd/onenand/onenand_uboot.c +1 -1
@@ -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>
drivers/mtd/onenand/samsung.c +1 -1
@@ -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>
fs/jffs2/jffs2_1pass.c +1 -1
@@ -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"
include/linux/compat.h renamed from include/linux/mtd/compat.h +0 -0
include/linux/err.h +1 -1
@@ -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>
include/linux/mtd/mtd-abi.h +1 -1
@@ -8,7 +8,7 @@#define __MTD_ABI_H__#if 1 -#include <linux/mtd/compat.h> +#include <linux/compat.h> #endif struct erase_info_user {
include/linux/mtd/nand.h +1 -1
@@ -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"
include/linux/mtd/onenand.h +1 -1
@@ -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
include/nand.h +1 -1
@@ -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>
Signature · 1 line
1.7.8.5
PATCH 3/4 linux/compat.h: rename from linux/mtd/compat.h
Quoted 18 lines · On Mon, 9 Apr 2012 19:39:55 -0400 Mike Frysinger <[email protected]> wrote:
This lets us use it in more places than just mtd code.
Signed-off-by Mike Frysinger <[email protected]>--- 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 +-
Quoted 8 lines
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
PATCH 4/4 lin_gadget: use common linux/compat.h
In reply to Mike FrysingerMerge our duplicate definitions with the common header.
--- include/linux/compat.h | 3 +++ include/usb/lin_gadget_compat.h | 15 ++------------- 2 files changed, 5 insertions(+), 13 deletions(-)
include/linux/compat.h +3 -0
@@ -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
include/usb/lin_gadget_compat.h +2 -13
@@ -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 );
Signature · 1 line
1.7.8.5
PATCH v2 4/4 lin_gadget: use common linux/compat.h
From: Mike Frysinger <[email protected]>
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.
---
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(-)
drivers/usb/gadget/s3c_udc_otg_xfer_dma.c +1 -1
@@ -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;
include/linux/compat.h +3 -0
@@ -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
include/usb/lin_gadget_compat.h +2 -13
@@ -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 );
Signature · 1 line
1.7.7.6
PATCH v2 4/4 lin_gadget: use common linux/compat.h
Quoted 9 lines · On Wednesday 25 April 2012 04:11:41 Anatolij Gustschin wrote:
From: Mike Frysinger <[email protected]>
Merge our duplicate definitions with the common header. Also fix
drivers/usb/gadget/s3c_udc_otg_xfer_dma.cto usemin()instead ofmin_t()since we remove the latter fromcompat.h.Signed-off-by Mike Frysinger <[email protected]>Signed-off-by Anatolij Gustschin <[email protected]>
Quoted 8 lines
---
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 3arguments, 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>
PATCH v2 4/4 lin_gadget: use common linux/compat.h
In reply to Anatolij GustschinHi Anatolij,
Quoted 6 lines
From: Mike Frysinger <[email protected]>
Merge our duplicate definitions with the common header. Also fix
drivers/usb/gadget/s3c_udc_otg_xfer_dma.cto usemin()instead ofmin_t()since we remove the latter fromcompat.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.
Signature · 5 lines
Best regards, Lukasz Majewski Samsung Poland R&D Center | Linux Platform Group
PATCH v2 4/4 lin_gadget: use common linux/compat.h
Hi Lukasz,
Quoted 9 lines · On Wed, 25 Apr 2012 17:58:51 +0200 Lukasz Majewski <[email protected]>…
Hi Anatolij,
Quoted 6 lines
From: Mike Frysinger <[email protected]>
Merge our duplicate definitions with the common header. Also fix
drivers/usb/gadget/s3c_udc_otg_xfer_dma.cto usemin()instead ofmin_t()since we remove the latter fromcompat.h.
Quoted 5 lines
Yes. the
include/usb/lin_gadget_compat.hlayer.
Good idea to provide one compat file (as fair as I remember similar problem is withmtd/compat.h).I'll look into the
include/linux.hfile.
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
PATCH v2 4/4 lin_gadget: use common linux/compat.h
Hi Anatolij,
Quoted 18 lines
Quoted 9 lines
Hi Anatolij,
Quoted 6 lines
From: Mike Frysinger <[email protected]>
Merge our duplicate definitions with the common header. Also fix
drivers/usb/gadget/s3c_udc_otg_xfer_dma.cto usemin()instead ofmin_t()since we remove the latter fromcompat.h.Quoted 5 lines
Yes. the
include/usb/lin_gadget_compat.hlayer.
Good idea to provide one compat file (as fair as I remember similar problem is withmtd/compat.h).I'll look into the
include/linux.hfile.Mike already moved
mtd/compat.htolinux/compat.h, please see this patch http://patchwork.ozlabs.org/patch/151500/
Quoted 6 lines
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.hdefineskmalloc()to bemalloc(), so the gadget driver should probably usememalign()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.
Signature · 5 lines
Best regards, Lukasz Majewski Samsung Poland R&D Center | Linux Platform Group
PATCH v2 4/4 lin_gadget: use common linux/compat.h
Hi Lukasz,
On Thu, 26 Apr 2012 12:32:40 +0200
Lukasz Majewski <[email protected]> wrote:
...
Quoted 7 lines
Quoted 6 lines
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.hdefineskmalloc()to bemalloc(), so the gadget driver should probably usememalign()directly where it is needed?
Quoted 6 lines
In the
include/usb/lin_gadget_compat.hthe#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
PATCH v3 4/4 lin_gadget: use common linux/compat.h
In reply to Anatolij GustschinFrom: Mike Frysinger <[email protected]>
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.
---
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(-)
drivers/usb/gadget/s3c_udc_otg.c +3 -2
@@ -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]
drivers/usb/gadget/s3c_udc_otg_xfer_dma.c +1 -1
@@ -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;
include/linux/compat.h +3 -0
@@ -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
include/usb/lin_gadget_compat.h +2 -13
@@ -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 );
Signature · 1 line
1.7.7.6
PATCH v3 4/4 lin_gadget: use common linux/compat.h
Quoted 26 lines · On Thu, 26 Apr 2012 14:34:44 +0200 Anatolij Gustschin <[email protected]> wrote:
From: Mike Frysinger <[email protected]>
Merge our duplicate definitions with the common header.
Also fix
drivers/usb/gadget/s3c_udc_otg_xfer_dma.cto usemin()instead ofmin_t()since we remove the latter fromcompat.h.Additionally use
memalign()directly as thelin_gadgetspecifickmalloc()macro is removed fromlin_gadget_compat.hby this patch.Signed-off-by Mike Frysinger <[email protected]>Signed-off-by Anatolij Gustschin <[email protected]>Cc Lukasz Majewski <[email protected]>---
v3:
- usememalign()in thes3c_udc_otgdriver directlyv2:
- 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)
Quoted 5 lines
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
PATCH 1/4 gunzip: rename z{alloc, free} to gz{alloc, free}
In reply to Mike FrysingerQuoted 9 lines · On Mon, 9 Apr 2012 19:39:53 -0400 Mike Frysinger <[email protected]> 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 <[email protected]>--- 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