diff options
author | Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> | 2015-03-10 19:03:18 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-15 18:41:12 +0100 |
commit | 6e2fef9d3260e169c17fc5eea842ff4c64c23e5c (patch) | |
tree | 149d5e9903d6341419bd0586e257395ded307e26 | |
parent | cb53b00de93d4a165b31781e9d4598415e3c07a4 (diff) |
staging: ft1000: ft1000-usb: ft1000_download.c: adjust function arguments
Handles the following issues:
Removing extra parentheses around function arguments,
Removing unnecessary pointer to pointer cast.
Issues were detected using the following coccinelle script:
@@
expression e;
type t;
identifier f;
@@
f(...,
-(t *)
e
,...)
@@
expression e;
identifier f;
@@
f(...,
&
-(
e
-)
,...)
@@
expression e;
identifier f;
@@
f(...,
-(
e
-)
,...)
Parentheses removal were left to the script. However, handling pointer
casts were done manually because not all replacements generated by the
script were suitable. In general, the following cases were discarded:
pointer casts in macros,
pointer casts on function arguments in the form of:
<func>(...,(<type> *)&<expression>,...)
since both cases generated compilation warnings.
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/ft1000/ft1000-usb/ft1000_download.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c index e8126325877b..800450ff5222 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c @@ -230,7 +230,7 @@ static u16 get_handshake_usb(struct ft1000_usb *ft1000dev, u16 expected_value) while (loopcnt < 100) { if (ft1000dev->usbboot == 2) { status = ft1000_read_dpram32(ft1000dev, 0, - (u8 *)&(ft1000dev->tempbuf[0]), 64); + (u8 *)&ft1000dev->tempbuf[0], 64); for (temp = 0; temp < 16; temp++) { pr_debug("tempbuf %d = 0x%x\n", temp, ft1000dev->tempbuf[temp]); @@ -538,7 +538,7 @@ static int write_blk_fifo(struct ft1000_usb *ft1000dev, u16 **pUsFile, usb_sndbulkpipe(ft1000dev->dev, ft1000dev->bulk_out_endpointAddr), ft1000dev->tx_buf, byte_length, usb_dnld_complete, - (void *)ft1000dev); + ft1000dev); usb_submit_urb(ft1000dev->tx_urb, GFP_ATOMIC); @@ -704,7 +704,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, case REQUEST_CODE_SEGMENT: status = request_code_segment(ft1000dev, &s_file, &c_file, - (const u8 *)boot_end, + boot_end, true); break; default: @@ -799,7 +799,7 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, status = request_code_segment(ft1000dev, &s_file, &c_file, - (const u8 *)code_end, + code_end, false); break; @@ -971,11 +971,11 @@ int scram_dnldr(struct ft1000_usb *ft1000dev, void *pFileStart, /* Get buffer for provisioning data */ pbuffer = - kmalloc((pseudo_header_len + - sizeof(struct pseudo_hdr)), + kmalloc(pseudo_header_len + + sizeof(struct pseudo_hdr), GFP_ATOMIC); if (pbuffer) { - memcpy(pbuffer, (void *)c_file, + memcpy(pbuffer, c_file, (u32) (pseudo_header_len + sizeof(struct pseudo_hdr))); |