get rid of STRLEN

The driver uses it's own STRLEN define which is just a wrapper for strlen().
In some cases, calling strlen is not necessary to begin with, so remove those calls.

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
use standard kernel functions and units where possible

exfat_global.h defines it's own data types and useless wrappers around kernel functions.
Replace the custom data types with kernle standard and get rid of unneccessary defines.

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
get rid of MALLOC

exfat_global.h defines a custom MALLOC() function which is just a wrapper around kmalloc().
This patch replaces MALLOC with kmalloc.

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
get rid of FREE

exfat_global.h defines a custom FREE() function, a wrapper around kfree() that also
always checks wheather the pointer to free is not NULL.
However, this is not very obvious, so get rid of this construct.

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
get rid of PRINT

exfat_global.h defines a PRINT alias for printk.
It has no use, so remove it.

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
remove my_itoa

exfat_global.c defines a function to convert integers to ascii text.
This function is only used once an can easiely be replaced by snprintf, so remove it.

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
get rid of WSTRCHR

The 'wide' (16bit characters) version of strchr is only used once, so there is no need
for it to be a global function. Move it from exfat_global.c to exfat_nls.c.

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
fix coding style, especially get rid of all the return(x) 'calls'

The driver exhibits a strange coding style where arguments to return are put into parenthesis
as if they were function calls. This pach removes the superflous brackets.

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
PRINTK -> DPRINTK

To keep consistency with other kernel modules and to avoid confusion,
name the Debug printk DPRINTK instead of just PRINTK.

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
move exfat_global to exfat_bitmap move DPRINTK to exfat_core.h

After removing unused and unneccesary defines, exfat_global only has 3 functions left.
They all deal with bitmap manipulation, so move them to exfat_bitmap.
These functions are only used in exfat_core.c, but the file is large enough already,
so keep them in a seperate file.
The DPRINTK macro now moves to exfat_core.h

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
add Kconfig option for THERE_IS_MBR, DELAYED_SYNC and ELAPSED_TIME

This exposes the three compile time options THERE_IS_MBR, DELAYED_SYNC and ELAPSED_TIME
to Kconfig. There is however no documentation on what these options do.

Signed-off-by: Benjamin Valentin <benpicco@zedat.fu-berlin.de>
use internal data types
include mutex
avoid conflicts with Linux' bitmap_set
add missing includes
define MIN/MAX
fix includes
silence warning