Embedded function names are less appropriate to use when
refactoring, can cause function renaming. Prefer the use
of "%s", __func__ to embedded function names
Signed-off-by: Mohsin Shan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
We do actually need slab.h, by luck we get it on other platforms but not
always on ARM. Include it properly.
Signed-off-by: Greg Hackmann <[email protected]>
Signed-off-by: Jin Qian <[email protected]>
Signed-off-by: Alan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Rewrite comparisons to NULL "data->reg_base == NULL" as "!data->reg_base" to conform to checkpatch.
Signed-off-by: Christian Colic <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Added a space around the "+" at: "reg_base+addr2" to clear up a checkpatch check.
Signed-off-by: Christian Colic <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The goldfish nand driver divides a signed 64-bit number (loff_t)
in multiple places using the do_div() function. This has always
been unreliable but now produces a compiler warning (since 4.5-rc1):
goldfish/goldfish_nand.c: In function 'goldfish_nand_erase':
goldfish/goldfish_nand.c:107:91: error: comparison of distinct pointer types lacks a cast [-Werror]
goldfish/goldfish_nand.c: In function 'goldfish_nand_read_oob':
goldfish/goldfish_nand.c:145:91: error: comparison of distinct pointer types lacks a cast [-Werror]
This changes the code to the equivalent div_s64{,_rem} that
works correctly for negative numbers (which we should never
get here).
The warning has shown up on ARM allmodconfig builds after the goldfish
bus driver has become visible on ARM.
Signed-off-by: Arnd Bergmann <[email protected]>
Fixes: bd2f348db5 ("goldfish: refactor goldfish platform configs")
Acked-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Function nand_setup_cmd_params has 2 goals-
-Initialize the cmd_params field so that it can be used to send and read
commands from the device.
-Get a bus address for the allocated memory to transfer to the device.
Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent.
Coherent mapping guarantees that the device and CPU are in sync.
Signed-off-by: Shraddha Barke <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Prefer kernel type u32 over uint32_t to maintain uniformity.
Signed-off-by: Ravi Teja Darbha <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
As the first argument of gf_write64() was of type unsigned long, and as
some calls to gf_write64() were casting the first argument from void *
to u64 the compiler and/or sparse were printing warnings for casts of
wrong sizes when compiling for i386.
This patch changes the type of the first argument of gf_write64() to
const void *, and update calls to the function. This change fixed the
warnings and allowed to remove casts from 3 calls to gf_write64().
In addition gf_write64() was renamed to gf_write_ptr() as the name was
misleading because it only writes 32 bits on 32 bit systems.
gf_write_dma_addr() was added to handle dma_addr_t values which is
used at drivers/staging/goldfish/goldfish_audio.c.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Peter Senna Tschudin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
Generally, When NULL represents failure, !x is commonly used.
This patch cleans up the tests on the results of these functions, thereby
using !x instead of x == NULL or NULL == x. This is done via following
coccinelle script:
@prob_7@
identifier x;
statement S;
@@
(
x = devm_kzalloc(...);
|
x = usb_alloc_urb(...);
|
x = kmalloc_array(...);
|
x = devm_ioremap(...);
|
x = alloc_netdev(...);
)
...
- if(NULL == x)
+ if(!x)
S
Further we have used isomorphism characteristics of coccinelle to
indicate x == NULL and NULL == x are equivalent. This is done via
following iso script.
Expression
@ is_null @ expression X; @@
X == NULL <=> NULL == X
Signed-off-by: Somya Anand <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Removes extra parentheses around function arguments. Issue
detected and resolved using the following coccinelle script:
@@
expression e;
identifier f;
@@
f(...,
-(
e
-)
,...)
Signed-off-by: Aya Mahfouz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix a pointer check to use NULL instead of 0
Warning:
drivers/staging/goldfish/goldfish_audio.c:300:34: warning: Using plain
integer as NULL pointer
Signed-off-by: Robin Schroer <[email protected]>
Acked-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch introduces the use of managed interfaces like devm_kzalloc,
devm_ioremap, dmam_alloc_coherent, devm_request_irq and does away with
the calls to functions to free the allocated memory in the probe and
remove functions. Also, the labels are removed in the probe function.
Signed-off-by: Himangi Saraogi <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Using an else following a break or return can unnecessarily
indent code blocks.
This patch fixes coding style reported by checkpatch.pl, a part
of eudyptula challenge.
Signed-off-by: Hoang Tran <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Enable the 64-bit goldfish audio driver.
Support 64-bit buffer address and data read/write.
Signed-off-by: Jun Tian <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fix two instances of the following checkpatch warning:
WARNING: Missing a blank line after declarations
Signed-off-by: Garret Kelly <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use a mutex instead of a spinlock in goldfish_nand.c, as suggested by
the TODO list.
Signed-off-by: Kristina Martšenko <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
If misc_register failed in goldfish_audio_probe, the already requested
IRQ wouldn't get freed. Add a call to free_irq() like there is in
goldfish_audio_remove().
Signed-off-by: Tuomas Tynkkynen <[email protected]>
Acked-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>. Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.
Signed-off-by: Paul Gortmaker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The existing comments are using an odd style. Fixed them up to adhereto the
StyleGuide. No code changes.
Signed-off-by: Sara Bird <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fixes the following checkpatch warning:
WARNING: line over 80 characters
Signed-off-by: Hema Prathaban <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
If CONFIG_MTD is not set goldfish_nand fails to compile with the
following linker warnings:
drivers/built-in.o: In function `goldfish_nand_remove':
goldfish_nand.c:(.text+0x6e7d0e): undefined reference to
`mtd_device_unregister'
drivers/built-in.o: In function `goldfish_nand_erase':
goldfish_nand.c:(.text+0x6e8ba2): undefined reference to
`mtd_erase_callback'
drivers/built-in.o: In function `goldfish_nand_init_device':
goldfish_nand.c:(.text+0x6e8eba): undefined reference to
`mtd_device_parse_register'
Reported-by: Randy Dunlap <[email protected]>
Signed-off-by: Peter Huewe <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When building the driver, gcc emits the following warnings:
.../drivers/staging/goldfish/goldfish_nand.c:
In function 'goldfish_nand_read_oob':
goldfish_nand.c:159:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 3 has type 'size_t' [-Wformat]
goldfish_nand.c:159:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 4 has type 'size_t' [-Wformat]
In function 'goldfish_nand_write_oob':
goldfish_nand.c:191:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 3 has type 'size_t' [-Wformat]
goldfish_nand.c:191:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 4 has type 'size_t' [-Wformat]
In function 'goldfish_nand_read':
goldfish_nand.c:215:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 3 has type 'size_t' [-Wformat]
In function 'goldfish_nand_write':
goldfish_nand.c:239:2:
warning: format '%x' expects argument of type 'unsigned int', but
argument 3 has type 'size_t' [-Wformat]
-> As defined in the printk-formats use %zx for size_t variables
Signed-off-by: Peter Huewe <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fold together the NAND driver for Goldfish from Arve with cleanups by
Jun Nakajima and a tidy up to 3.7 and checkpatch.
This provides a virtual flash driver for the Goldfish Android Virtual Platform,
and which is normally used as the root file system when testing emulated
devices.
Signed-off-by: Mike A. Chan <[email protected]>
Signed-off-by: Arve Hjønnevåg <[email protected]>
[Ported to handle x86]
Signed-off-by: Sheng Yang <[email protected]>
Signed-off-by: Yunhong Jiang <[email protected]>
Signed-off-by: Xiaohui Xin <[email protected]>
Signed-off-by: Jun Nakajima <[email protected]>
Signed-off-by: Bruce Beare <[email protected]>
[Ported to 3.4]
Signed-off-by: Tom Keel <[email protected]>
[Ported to 3.7 and tided for checkpatch etc]
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(remove change to another file that escaped into the patch set)
From: Mike Lockwood <[email protected]>
Provide a simple audio channel between the kernel and the emulator that host
sit. Queued for staging right now as this ought to be an ALSA driver not
just a dumb device of its own making.
Signed-off-by: Mike A. Chan <[email protected]>
[x86 support]
Signed-off-by: Sheng Yang <[email protected]>
Signed-off-by: Yunhong Jiang <[email protected]>
Signed-off-by: Xiaohui Xin <[email protected]>
Signed-off-by: Jun Nakajima <[email protected]>
Signed-off-by: Bruce Beare <[email protected]>
[Clean up]
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>