Commit Graph

324 Commits

Author SHA1 Message Date
Gulsah Kose d1ffa894cd staging: ft1000: ft1000-usb: Removed unnecessary else statement.
This patch fixes "else is not generally useful after a break or return"
checkpatch.pl warning in ft1000_download.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 10:13:37 -07:00
Gulsah Kose c89e6be711 staging: ft1000: ft1000-usb: Removed unnecessary else statement.
This patch fixes "else is not generally useful after a break or return"
checkpatch.pl warning in ft1000_hw.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 10:13:37 -07:00
Gulsah Kose 3636ce82db staging: ft1000: ft1000-usb: Removed unnecessary parentheses.
This patch fixes "Unnecessary parentheses" checkpatch.pl warning in
ft1000_hw.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 10:13:37 -07:00
Gulsah Kose 6254e1c062 staging: ft1000: ft1000-usb: Added new line after declarations.
This patch fixes "Missing a blank line after declarations" checkpatch.pl
warning in ft1000_hw.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 10:13:37 -07:00
Aybuke Ozdemir a256779f7d staging: ft1000: ft1000-pcmcia: Add require space after that ','
This patch fixes checkpatch.pl error in file ft1000_hw.c
ERROR: space required after that ';' (ctx:VxV)

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 23:26:42 -04:00
Gulsah Kose 56a28395b7 staging: ft1000: ft1000-pcmcia: Used "linux" instead of "asm".
This patch fixes "Use #include <linux/uaccess.h> instead of
<asm/uaccess.h" checkpatch.pl warning in ft1000_dnld.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 23:26:42 -04:00
Gulsah Kose 96bcbea0d5 staging: ft1000: ft1000-pcmcia: Removed unnecessary else expression.
This patch fixes "else is not generally useful after a break or return"
checkpatch.pl warning in ft1000_dnld.c

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 23:26:42 -04:00
Catalina Mocanu c0a7b1cbbf staging: ft1000-usb: use usleep_range instead of msleep
This fixes the following checkpatch.pl warning:
WARNING : msleep < 20ms can sleep for up to 20ms; see
Documentation/timers/timers-howto.txt

Signed-off-by: Catalina Mocanu <catalina.mocanu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 23:05:03 -04:00
Catalina Mocanu ed9034f58e staging: ft1000-usb: remove unnecessary return statement
This fixes the following checkpatch.pl warning:
WARNING: void function return statements are not generally useful

Signed-off-by: Catalina Mocanu <catalina.mocanu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 23:05:03 -04:00
Catalina Mocanu 13e55e4947 staging: ft1000-pcmcia: Don't initialise static to 0
This fixes the following checkpatch.pl error:
ERROR: do not initialise statics to 0 or NULL

Signed-off-by: Catalina Mocanu <catalina.mocanu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 20:34:38 -07:00
Catalina Mocanu 8f3a2e04e3 staging: ft1000-pcmcia: replace DEBUG macro with netdev_dbg
This fixes the following checkpatch.pl warning:
WARNING: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then
dev_dbg(dev, ... then pr_debug(...  to printk(KERN_DEBUG ...

Removing the macro also fixes:
WARNING: macros should not use a trailing semicolon

Signed-off-by: Catalina Mocanu <catalina.mocanu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 20:29:56 -07:00
Greg Donald c802a6447d drivers: staging: ft1000: Fix return is not a function, parentheses are not required errors
Fix checkpatch.pl return is not a function, parentheses are not required errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02 10:48:32 -07:00
Nicolas Thery 6b5886f8b2 staging: ft1000: remove procfs entries
This patch started as a fix to some checkpatch complaints in ft1000
procfs code but Greg suggested to remove the procfs entries altogether:

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2014-July/055594.html

Signed-off-by: Nicolas Thery <nthery@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-27 11:45:46 -07:00
Andrey Utkin eedd8d7ee8 staging: ft1000-usb: check for errors in card_send_command
kmalloc() result check was lacking. Fixing that required also
changing card_send_command() return type from void to int, and
checking its return code everywhere.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78561
Reported-by: Maksymilian Arciemowicz <max@cert.cx>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:18:21 -07:00
Cheng-Wei Lee 2eca281675 staging: ft1000_dnld.c:code indent should use tabs where possible
This patch fixes the following checkpatch.pl issue in
ft1000/ft1000-pcmcia/ft1000_dnld.c
ERROR: code indent should use tabs where possible

Signed-off-by: Quentin Lee <lee.rhapsody@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:35:49 -04:00
Linus Torvalds f9da455b93 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:

 1) Seccomp BPF filters can now be JIT'd, from Alexei Starovoitov.

 2) Multiqueue support in xen-netback and xen-netfront, from Andrew J
    Benniston.

 3) Allow tweaking of aggregation settings in cdc_ncm driver, from Bjørn
    Mork.

 4) BPF now has a "random" opcode, from Chema Gonzalez.

 5) Add more BPF documentation and improve test framework, from Daniel
    Borkmann.

 6) Support TCP fastopen over ipv6, from Daniel Lee.

 7) Add software TSO helper functions and use them to support software
    TSO in mvneta and mv643xx_eth drivers.  From Ezequiel Garcia.

 8) Support software TSO in fec driver too, from Nimrod Andy.

 9) Add Broadcom SYSTEMPORT driver, from Florian Fainelli.

10) Handle broadcasts more gracefully over macvlan when there are large
    numbers of interfaces configured, from Herbert Xu.

11) Allow more control over fwmark used for non-socket based responses,
    from Lorenzo Colitti.

12) Do TCP congestion window limiting based upon measurements, from Neal
    Cardwell.

13) Support busy polling in SCTP, from Neal Horman.

14) Allow RSS key to be configured via ethtool, from Venkata Duvvuru.

15) Bridge promisc mode handling improvements from Vlad Yasevich.

16) Don't use inetpeer entries to implement ID generation any more, it
    performs poorly, from Eric Dumazet.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1522 commits)
  rtnetlink: fix userspace API breakage for iproute2 < v3.9.0
  tcp: fixing TLP's FIN recovery
  net: fec: Add software TSO support
  net: fec: Add Scatter/gather support
  net: fec: Increase buffer descriptor entry number
  net: fec: Factorize feature setting
  net: fec: Enable IP header hardware checksum
  net: fec: Factorize the .xmit transmit function
  bridge: fix compile error when compiling without IPv6 support
  bridge: fix smatch warning / potential null pointer dereference
  via-rhine: fix full-duplex with autoneg disable
  bnx2x: Enlarge the dorq threshold for VFs
  bnx2x: Check for UNDI in uncommon branch
  bnx2x: Fix 1G-baseT link
  bnx2x: Fix link for KR with swapped polarity lane
  sctp: Fix sk_ack_backlog wrap-around problem
  net/core: Add VF link state control policy
  net/fsl: xgmac_mdio is dependent on OF_MDIO
  net/fsl: Make xgmac_mdio read error message useful
  net_sched: drr: warn when qdisc is not work conserving
  ...
2014-06-12 14:27:40 -07:00
Peter Senna Tschudin add6452615 staging: ft1000: Remove useless return variables
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.

Verified by compilation only.

The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
- return ret;
+ return C;
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 02:14:31 +09:00
Masanari Iida 6d602cf17b staging: ft1000: Convert printk to dev_err in ft1000_cs.c
This patch converts printk to dev_err in ft1000_cs.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 02:11:48 +09:00
Artem Fetishev 62ca89a1d0 drivers: staging: ft1000: Fix lines over 80 characters
..plus some function arg indentation which I haven't noticed at first.

Signed-off-by: Artem Fetishev <wwctrsrx@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:51:40 -07:00
Artem Fetishev 48d1e47536 drivers: staging: ft1000: Remove typedefs
Remove typedefs according to the "Chapter 5: Typedefs" from
Documentation/CodingStyle.

Signed-off-by: Artem Fetishev <wwctrsrx@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:51:40 -07:00
Artem Fetishev 5df466cd66 drivers: staging: ft1000: Use pr_info instead of printk
Improve coding style by fixing this checkstyle warning:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...

Signed-off-by: Artem Fetishev <wwctrsrx@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:51:40 -07:00
Artem Fetishev b4da658ea9 drivers: staging: ft1000: Fix IOCTL_FT1000_* marcos
Fixes include:
 - Add closing brackets;
 - Remove sizeof (_IOR and _IOW macro can accept types);
 - Replace _IOW which size of 0 (the last arg) with _IO.
 - Actually these macros are not used anywhere and might be removed.

Signed-off-by: Artem Fetishev <wwctrsrx@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:49:45 -07:00
Artem Fetishev 5fd29b013b drivers: staging: ft1000: Fix indentation
Fixes indentation in header files.

Signed-off-by: Artem Fetishev <wwctrsrx@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:49:45 -07:00
Angus Gibson 77a6f000a1 staging: ft1000: remove explicit static initialisation
Fix checkpatch.pl error where a static variable was explicitly
initialised to false

Signed-off-by: Angus Gibson <darthshrine@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:48:36 -07:00
Paul McQuade 248b6a6756 Staging:ft1000_debug.c:Renaming __FUNCTION__
__Function__ gets renamed with __func__

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:48:36 -07:00
Anders Darander a713cd5941 Staging: ft1000-usb: use netdev_warn
Fix coding style issue by replacing printk with netdev_warn.

Signed-off-by: Anders Darander <anders.darander@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:48:36 -07:00
Anders Darander 87a7630109 Staging: ft1000-usb: wrap macros in do while
Fix coding style issue by wrapping the macro in a do {} while (0).

Signed-off-by: Anders Darander <anders.darander@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:48:36 -07:00
Wilfried Klaebe 7ad24ea4bf net: get rid of SET_ETHTOOL_OPS
net: get rid of SET_ETHTOOL_OPS

Dave Miller mentioned he'd like to see SET_ETHTOOL_OPS gone.
This does that.

Mostly done via coccinelle script:
@@
struct ethtool_ops *ops;
struct net_device *dev;
@@
-       SET_ETHTOOL_OPS(dev, ops);
+       dev->ethtool_ops = ops;

Compile tested only, but I'd seriously wonder if this broke anything.

Suggested-by: Dave Miller <davem@davemloft.net>
Signed-off-by: Wilfried Klaebe <w-lkml@lebenslange-mailadresse.de>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-05-13 17:43:20 -04:00
Gulsah Kose 6d56be08f7 staging: ft1000: Fix line over 80 characters.
Fix checkpatch.pl issues with line over 80 characters in ft1000.h

Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:41:28 -07:00
Monam Agarwal 1633dc5ecc Staging: ft1000-usb: Fix Smatch Warning in ft1000_hw.c
This patch fixes following smatch warning:
/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:1148 ft1000_proc_drvmsg() warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-16 17:43:17 -07:00
Ebru Akagunduz 693e1cc621 Staging:ft1000: Fix __packed is preferred over __attribute__((packed)) in ft1000_ioctl.h
Fix checkpatch.pl issues with  __packed is preferred
over __attribute__((packed)) in ft1000_ioctl.h

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 15:45:54 -08:00
Paul Gortmaker 885a947e5b staging: delete non-required instances of include <linux/init.h>
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 <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 10:08:14 -08:00
Daniel Dodge 588c31eacd Drivers: Staging: ft1000: Fixed C99 // comments styling issue
This patch removes C99 style comments from the driver and whenever
possible attempts to match coding style of the rest of the driver.

Signed-off-by: Daniel Dodge <danieldodgese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-08 17:31:41 -08:00
Chen Gang 3229b869d1 drivers: staging: ft1000: ft1000-usb: ft1000_debug.c: check return value of get_user() in ft1000_ioctl()
get_user() may fail and cause 'msgsz' uninitialized, so need give a
check. The related warning (with allmodconfig under hexagon):

    CC [M]  drivers/staging/ft1000/ft1000-usb/ft1000_debug.o
  drivers/staging/ft1000/ft1000-usb/ft1000_debug.c: In function 'ft1000_ioctl':
  include/uapi/linux/swab.h:53:9: warning: 'msgsz' may be used uninitialized in this function [-Wuninitialized]
  drivers/staging/ft1000/ft1000-usb/ft1000_debug.c:533:17: note: 'msgsz' was declared here

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-03 09:13:05 -08:00
Greg Kroah-Hartman 06749f192b Merge v3.13-rc2 into staging-next
we want these fixes in here.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-02 16:39:07 -08:00
Adam Lee 8a76714dd3 staging: ft1000: fix uninitialized return variable in request_code_segment
The return variable of request_code_segment() is used uninitialized if
the argument boot_case is false, this patch fixes it.

FYI, in ft1000_usb.h: STATUS_SUCCESS 0, and STATUS_FAILURE 0x1001.

Signed-off-by: Adam Lee <adam8157@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-25 12:41:43 -08:00
Michal Nazarewicz 8aced95022 staging: ft1000: fix use of potentially uninitialized variable
If boot_case is false, status in never assigned a value.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-25 09:25:18 -08:00
Aldo Iljazi e1970ee78c Drivers: staging: ft1000-usb: ft1000_proc.c: fixed a few styling issues.
Fixed a few styling issues, particularly:

Lines 36,42: Inserted a space before the open paranthesis.
Line 50: Removed space between function name and open parenthesis.
Lines 56,57: Removed trailing whitespace.
lines: 130, 133: Replaced spaces with tabs for identation.

Signed-off-by: Aldo Iljazi <mail@aldo.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19 16:08:33 -08:00
Aldo Iljazi c4df2822cd Staging: ft1000: ft1000_download: fixed coding style issues
Fixed the following coding style issues:

Lines 84-91,99-106,275,514: Replaced spaces at the start of the lines
with tabs.

Lines 205,271: Inserted spaces after the commas.
Lines 275,1060,1065: Indented the code with tabs instead of spaces.

Line 275: Inserted spaces around '=' and '<', also moved the trailing
statement on the next line.

Line 512: Removed space between function name and open parenthesis.
Line 839: Removed space after '&'.
Line 853: Removed space after '&'.

Signed-off-by: Aldo Iljazi <mail@aldo.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-11 16:27:31 -08:00
Aldo Iljazi c766d23b96 Staging: ft1000: boot.h: fixed a few styling issues
Fixed the following styling issues:

Line 30:
Removed space before open square bracket '['

Lines 31 to 155:
Moved the commas that were in the start of the lines, to the end of the lines.
Inserted spaces after the commas.
Inserted a one tab indentation to each line.

Signed-off-by: Aldo Iljazi <mail@aldo.io>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-11 16:27:31 -08:00
Kelley Nielsen 8d6c558557 staging: ft1000: fix remaining checkpatch issues in ft1000_hw.c
The file ft1000_hw.c is still full of coding style problems that make it
challenging to read and understand. The lines inside the switch cases
in ft1000_proc_drvmsg() are indented too deeply, so remove one leading
tab. Join lines that are now able to fit in the 80 character limit.
This will take care of the "too many leading tabs" issue. Run
checkpatch.pl on the file, and correct all other issues it reports
(except lines with user visible strings over 80 chars).

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Suggested-by: Waskiewicz Jr, Peter P <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 07:55:00 -08:00
Kelley Nielsen a3220b89bd staging: ft1000: flatten nesting in dsp_broadcast_msg_id()
The function dsp_broadcast_msg_id() has four levels of nesting. Move the
handling for failed allocation for *dpram_blk from the else block at the
end to the block immediately following the test, reverse the sense of the
test, and exit with an error code if the allocation fails. This eliminates
descending into an if block if the allocation is successful. Move all
lines inside the removed block one tab to the left, and join lines
that will fall under the 80 char limit.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 07:55:00 -08:00
Kelley Nielsen 9a1261f317 staging: ft1000: fix checkpatch issues in ft1000_poll()
The function ft1000_poll(), in ft1000_hw.c, has many miscellaneous
coding style issues, such as improper indentation, C99 comments, use of
msleep(), and lines over 80 characters. Changes all spaces at the start
of lines to the proper number of tabs. Convert C99 comments to standard
/* */ style. Change calls to msleep(10) to usleep_range(9000, 11000).
Break lines over 80 characters, unless they are user visible strings.
Remove space before open paren in function calls. Fix any other issues
that checkpatch finds.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 07:55:00 -08:00
Kelley Nielsen f3802bdb15 staging: ft1000: flatten nesting in handle_misc_portid
The newly extracted function handle_misc_portid still has several
unnecessary levels of nesting, having inherited its logic from the
original extracted lines. Move handling for failed memory allocation
(of *pdpram_blk) to the top of the function, and return -1 from within
it. This eliminates the if statement around the body of the function.
Change two levels of nested if/else to an if/else-if/else. Create a
label, exit_failure, at the end of the function with the cleanup code,
and goto it at all points of failure. Also, goto it if the call to
ft1000_receive_cmd() fails, instead of descending into an if block if
it succeeds. Pull all lines from inside the former if blocks to the
left, and rejoin lines to take advantage of reclaimed horizontal space.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 07:55:00 -08:00
Kelley Nielsen 8a58cad260 staging: ft1000: extract helper handle_misc_portid()
The function ft1000_poll, in ft1000_hw.c, is complex, with deep levels
of nesting, unnecessary variables, and style issues. Extract the default
case of the switch statement to its own function, handle_misc_portid.
Make the variable struct dpram_blk *pdpram_blk local to the new function
and remove it from the old. The variable struct pseudo_hdr *ppseudo_hdr is
used only once, to access a member of another struct, so eliminate it
and access the member directly. Return -1 in all the places where the
code fails, and 0 on successful completion. Fix coding style errors.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 07:55:00 -08:00
Kelley Nielsen 6eca0c1fa2 staging: ft1000: extract dsp_broadcast_msg_id()
The function ft1000_poll, in ft1000_hw.c, is overly complex, with at
least five levels of nesting. Extract the lines in switch case
DSPBCMSGID into their own function, called dsp_broadcast_msg_id(). Pass
one parameter, struct ft1000_usb *dev. Make a copy of struct dpram_blk
*pdpram_blk local to the new function, since it is initialized at the
top of each case in which it appears. Make unsigned long flags local to
the new function. Remove the assignment to struct pseudo_hdr
*ppseudo_hdr, which is otherwise unused in the switch case, and receives
the same assignment at the top of each case in which it appears. Return
an int, 0 for success and -1 for error. Correct style issues in the
extracted lines.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 07:53:48 -08:00
Kelley Nielsen d5ae3c482d staging: ft1000: remove unused variable nxtph
The function ft1000_poll, in ft1000_hw.c, is overly complex, with at
least five different levels of nesting. While preparing to extract one
of the cases to its own function, I discovered that the variable nxtph
is not used. It is declared and assigned a value in ft1000_poll(), then
passed by reference to the helper function ft1000_receive_command(),
which receives it as parameter. pnxtph does not appear in the body of
this function. Remove all occurrences of nxtph and pnxtph.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 07:53:48 -08:00
Kelley Nielsen 46d981557b staging: ft1000: STATUS defines completely removed
The ft1000 driver ignores the normal Linux error codes, using its
own macros, STATUS, STATUS_SUCCESS, and STATUS_FAILURE, instead.
Unsigned variables (u16 and u32) are sometimes used to hold them.
This patch converts all occurences of these macros to 0, 0 and -1,
respectively. It also changes the last remaining status variables
(mostly called status and ret) to ints, and removes the declarations
of the macros. This patch does not correct the whitespace issues
in the lines where the changes were made.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 07:47:22 -08:00
Kelley Nielsen da3ab48bb8 staging: ft1000: remove formal function headers from ft1000_hw.c
The file ft1000_hw.c contains formal C99 style function headers that
waste space and convey little to no useful information. This patch
converts the headers to either one line standard /* */ style comments
or shorter standard style headers with parameter lists (if the parameter
list seemed helpful), or eliminates them entirely. Besides needing to be
made of its own accord, this change is in preparation to eliminate the
nonstandard STATUS_* #defines from the driver since they were cited in most
of the headers.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 07:47:22 -08:00
Kelley Nielsen 547b5b2256 staging: ft1000: STATUS_ defines removed from ft1000_download.c
Two files in the ft1000 usb driver ignore expected Linux error codes,
and instead use two STATUS_SUCCESS 0, and STATUS_FAILURE
0x1001. This patch removes all remaining occurrences of these from the
file ft1000_download.c. All occurrences of STATUS_SUCCESS have been
replaced by 0, and occurrences of STATUS_FAILURE have been replaced by
-1. One occurence of STATUS_FAILURE has been completely removed:
get_handshake collects either a local #define or 0 from its helper
function, check_usb_db, and immediately sets the collecting variable to
STATUS_FAILURE if the #define is returned. check_usb_db has been
modified to return -1 instead of the #define.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-10 07:47:22 -08:00