Commit Graph

342 Commits

Author SHA1 Message Date
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
Kelley Nielsen b1bdd4d3ed staging: ft1000: return values corrected in scram_start_dwnld
The ft1000 usb driver ignores expected Linux error codes, and uses two
values defined in ft1000_usb.h: STATUS_SUCCESS 0, and STATUS_FAILURE
0x1001; and sometimes -1. This patch changes the return values of the
function scram_start_dwnld to match the status of the handshake returned
by its helper functions, get_handshake and get_handshake_usb. If the
handshake fails, -ENETRESET is returned instead of the inappropriate
STATUS_FAILURE. Also, a new test has been added to differentiate failure
due to timeout from failure due to net reset (the default). -ETIMEDOUT
is returned in this case. Finally, 0 is returned on success instead of
STATUS_SUCCESS.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-29 17:11:36 -07:00
Kelley Nielsen 43fc69b112 staging: ft1000: change values of status return variable in write_dpram32_and_check
The ft1000 usb driver ignores expected Linux error codes, and uses two
values defined in ft1000_usb.h: STATUS_SUCCESS 0, and STATUS_FAILURE
0x1001; and sometimes -1. This patch changes the return value of the
function write_dpram_32_and check to 0 or -EREMOTEIO, respectively. The
relevant change was made in the helper function check_buffers (which is
only called from write_dpram32_and_check); it now returns 0 on success
and -EREMOTEIO on failure, and this is allowed to propagate through
write_dpram32_and_check. Assignments to the return variable status that
are no longer needed were removed as well. In one function up the call
chain, dsp_reload in ft1000_hw.c, the status variable was changed from
u16 to int to avoid collecting a signed value in an unsigned variable.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-29 17:10:22 -07:00
Kelley Nielsen 8cf9ff570b staging: ft1000: status variables changed to int in ft1000_download.c
Linux uses a return type of int for status codes. The file
ft1000_download.c uses a mixture of u16 and u32. This patch changes all
variables called status or Status to ints, whether they are returned
from the function or not. It also changes the return type of all
functions returning one of the variables to correspond. Also, the
declaration of scram_dnldr has been changed in ft1000_usb.h.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-29 08:36:17 -07:00
Kelley Nielsen 74827f8dfa staging: ft1000: style issues fixed in write_blk
function write_blk, in ft1000_download.c, contains many coding style
issues. It has indentations of 3 spaces, long lines, C99 comments, and
extra whitespace. It also has a return type of u32, and changing the
returned variable in the function triggers a checkpatch leading spaces
warning. Indentation should be fixed throughout the file for
consistency.

This patch fixes those issues, in preparation for correcting the status
return type throughout the file. The variable Status has been changed
from u32 to int and renamed status.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-29 08:36:17 -07:00
Kelley Nielsen eb2ec63979 staging: ft1000: function write_dpram32_and_check extracted from write_blk
function write_blk is long and overly complex, consisting of a triply
nested loop. It also has improper indentation and line lengths
throughout, and has return type of u32 rather than int. Some of the
lines, when converted to proper indentation, create checkpatch warnings
for too many leading tabs.

This patch extracts the innermost loop into its own function,
write_dpram32_and_check. This removes several levels of indentation from
the extracted lines and makes the original function simpler. Two local
variables from the original function, u16 resultbuffer[] and a loop
counter, have been made local variables of the new function. Two calls
to msleep() have been replaced with usleep_range() as per Documentation/
timers/timers-howto.txt (which was referred to in a checkpatch warning).
Several other style issues in the extracted code have been corrected as
well.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-29 08:36:17 -07:00
Kelley Nielsen e0a223b465 staging: ft1000: duplicate code replaced with call to request_code_segment
function scram_dnldr, in ft1000_download.c, is very long and consists
mainly of nested switch statements inside a while loop. Some code in one
of the inner switch cases was almost identical to the code in the
previously extracted function request_code_segment. The duplicated code
was replaced with a call to request_code_segment, and
request_code_segment was slightly modified to work in both cases.

A new parameter was added to request_code_segment, a bool to distinguish
which case it was replacing. The name of an existing parameter (now
called endpoint) was changed to reflect the fact that it will be passed
in from more than one place. Several lines from the case containing the
duplicated code were moved to request_code_segment, and a test was added
to determine if these lines or a line from the original function should
be run.

Finally, an unused variable (tempword) was removed from scram_dnldr.

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-10-29 08:36:16 -07:00
Kelley Nielsen aaeb94c93c staging: ft1000: function request_code_segment extracted
function scram_dnldr in ft1000_download.c is very long and contains many
coding style errors and best practice violations. It consists of nested
switch statements inside a while loop. One of the inner switch cases has
been extracted as a helper function. Also, some style errors (such as
C99 comments) have been fixed, an assignment to an unread variable has
been removed, and break statements inside ifs have been converted to
returns.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-29 08:36:16 -07:00
Kelley Nielsen eb3836cefc staging: ft1000: function scram_start_dwnld extracted from scram_dnldr in ft1000_download.c
function scram_dnldr is over 500 lines long, with deep indents that
trigger checkpatch warnings for too many tabs. It mainly consists of a
switch statement with long, complicated cases. The first case has been
extracted to form the helper function scram_start_dwnld. Some style
issues in the extracted lines have been corrected as well.

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-10-28 15:04:24 -07:00
Rashika Kheria 93b2a6c847 Staging: ft1000: Fix assignment of bool to 0/1 in ft1000_dnld.c
This patch fixes the following warning in ft1000-pcmcia/ft1000_dnld.c-

drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c:307:6-18: WARNING: Assignment of bool to 0/1

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-28 15:00:35 -07:00
Rashika Kheria 9d8fe1f788 Staging: ft1000: Fix comparsion of bool to 0/1 in ft1000_hw.c
This patch fixes the following coccinelle warning in ft1000-usb/ft1000_hw.c -

drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:1924:9-25: WARNING: Comparison of bool to 0/1

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-28 15:00:35 -07:00
Rashika Kheria a68d106cb1 Staging: ft1000: Fix assignment of bool to 0/1 in ft1000_hw.c
This patch fixes the following coccinelle warning in ft1000-usb/ft1000_hw.c-

drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:1444:1-19: WARNING: Assignment of bool to 0/1
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:1937:16-34: WARNING: Assignment of bool to 0/1
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:1938:16-35: WARNING: Assignment of bool to 0/1
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:1570:4-22: WARNING: Assignment of bool to 0/1
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:1575:4-22: WARNING: Assignment of bool to 0/1
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:636:1-26: WARNING: Assignment of bool to 0/1
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:638:1-25: WARNING: Assignment of bool to 0/1
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:669:1-26: WARNING: Assignment of bool to 0/1
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:755:1-23: WARNING: Assignment of bool to 0/1
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:756:1-26: WARNING: Assignment of bool to 0/1

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-28 15:00:35 -07:00
Rashika Kheria 36f955bf06 Staging: ft1000: Fix assignment of bool to non-0/1 constant in ft1000_download.c
This patch fixes the following coccinelle error in ft1000-usb/ft1000_download.c -

drivers/staging/ft1000/ft1000-usb/ft1000_download.c:615:1-16: ERROR: Assignment of bool to non-0/1 constant
drivers/staging/ft1000/ft1000-usb/ft1000_download.c:926:5-20: ERROR: Assignment of bool to non-0/1 constant
drivers/staging/ft1000/ft1000-usb/ft1000_download.c:943:7-22: ERROR: Assignment of bool to non-0/1 constant

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-28 15:00:35 -07:00
Rashika Kheria dfff0c3f52 Staging: ft1000: Fix assignment of bool to non-0/1 constant in ft1000_usb.c
This patch fixes the following coccinelle error in ft1000-usb/ft1000_usb.c-
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c:50:4-18: ERROR: Assignment of bool to non-0/1 constant
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c:174:1-15: ERROR: Assignment of bool to non-0/1 constant
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c:39:12-26: ERROR: Assignment of bool to non-0/1 constant

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-28 15:00:34 -07:00
Ebru Akagunduz 7ff1b12bf6 Staging: ft1000: remove unnecessary static function declarations in ft1000_hw.c
This patch removes unnecessary static function
declarations in ft1000_hw.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-27 06:36:39 -07:00
Ebru Akagunduz bfb3af4ebc Staging: ft1000: Fix Sparse Warning for Static Declarations in boot.h
This patch fixes the Sparse Warning: "symbol 'bootimage'
was not declared. Should it be static?" in boot.h

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-27 06:35:54 -07:00
Ebru Akagunduz 40c2f5512c Staging: ft1000: Fix Sparse Warning for Static Declarations in ft1000_hw.c
This patch fixes the Sparse Warning: "symbol 'ft1000_reset'
was not declared. Should it be static?" in ft1000_hw.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-27 06:35:54 -07:00
Aldo Iljazi 0735e83c78 Staging: ft1000: fixed two coding style issues
Fixed two coding style issues, specifically:

ft1000_proc.c:35: ERROR: space required before the open parenthesis '('
ft1000_proc.c:42: ERROR: space required before the open parenthesis '('

Signed-off-by: Aldo Iljazi <me@aldo.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19 13:43:41 -07:00
Kelley Nielsen 4b31e1f8ff staging: ft1000: change scram_dnldr() header to one line comment in ft1000_download.c
As per coding style,C99 comments are not allowed
also, the formal header contained empty space and
redundant information that's right there in the function

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-10-16 09:36:13 -07:00
Kelley Nielsen 456ae7ebfd staging: ft1000: change write_block_fifo() header to /* */ style in ft1000_download.c
As per coding style, C99 comments are not allowed
removed some redundant information and empty space
Left the parameter descriptions because the
parameter list is long and cryptic looking

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-10-16 09:36:12 -07:00
Kelley Nielsen 69f7be1fba staging: ft1000: change write_blk header to /* */ style in ft1000_download.c
As per coding style, C99 comments are not allowed
removed some redundant information and empty space
Left the parameter descriptions because the
parameter list is long and cryptic looking

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-10-16 09:36:12 -07:00
Kelley Nielsen b30f4e234f staging: ft1000: change hdr_checksum() header to one line comment in ft1000_download.c
As per coding style,C99 comments are not allowed
also, the formal header contained empty space and
redundant information that's right there in the function

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-10-16 09:36:12 -07:00
Kelley Nielsen 9e80d03c75 staging: ft1000: change put_request_value() header to single line comment in ft1000_download.c
As per coding style,C99 comments are not allowed
also, the formal header contained empty space and
redundant information that's right there in the function

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-10-16 09:36:12 -07:00
Kelley Nielsen 1f13b0b8e7 staging: ft1000: remove formal get_request_value function header from ft1000-download.c
since there was no information in the C99 style header
for function get_request_type() that was not easily obtainable
by looking at the function, the header was completely removed.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-15 08:50:33 -07:00
Kelley Nielsen c50ede7975 staging: ft1000: remove formal get_request_type function header from ft1000-download.c
since there was no information in the C99 style header
for function get_request_type() that was not easily obtainable
by looking at the function, the header was completely removed.

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-15 08:50:33 -07:00
Kelley Nielsen fafa4dcef4 staging: ft1000: convert formal put_handshake() header to single line comment
As per coding style,C99 comments are not allowed
also, the formal header contained empty space and
redundant information that's right there in the function

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-15 08:50:32 -07:00
Kelley Nielsen 89a03d3662 staging: ft1000: change ft1000-download.c header to /* */ comment style
Coding style requires that comments use the standard /* */ style
instead of C99 style.
Also removed author comment from a previous contributor

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-15 08:50:32 -07:00
Kelley Nielsen 135a9ea056 staging: ft1000: convert formal get_handshake() function header to single line comment
As per coding style,C99 comments are not allowed
also, the formal header contained empty space and
redundant information that's right there in the function

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-14 09:24:49 -07:00
Kelley Nielsen de7a0cc15a staging: ft1000: convert formal function header to single line comment
As per coding style,C99 comments are not allowed
also, the formal header contained empty space and
redundant information that's right there in the function

Signed-off-by: Kelley Nielsen <kelleynnn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-14 09:24:49 -07:00
Kelley Nielsen 6f5519fd83 staging: ft1000: remove space before closing paren
as per coding style,
space prohibited before that close parenthesis

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-10-14 09:23:23 -07:00
Kelley Nielsen 610554d3ac staging: ft1000: remove space before address operator
as per coding style (checkpatch error),
space prohibited after that '&'

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-10-14 09:23:23 -07:00
Kelley Nielsen cfd9d1fad6 staging: ft1000: remove braces from one-line conditional
As per coding style,
braces {} are not necessary for single statement blocks

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-10-14 09:23:22 -07:00
Kelley Nielsen 0c5e802c1c staging: ft1000: change comment style
Coding style requires that comments use the standard /* */ style
instead of C99 style.

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-10-14 09:19:59 -07:00
Kelley Nielsen e072241a31 staging: ft1000-usb: remove space between function name and open paren in ft1000_download.c
fixed checkpatch.pl warning: space prohibited between function name and
open parenthesis '('

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-10-14 09:15:26 -07:00
Linus Torvalds 496322bc91 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:
 "This is a re-do of the net-next pull request for the current merge
  window.  The only difference from the one I made the other day is that
  this has Eliezer's interface renames and the timeout handling changes
  made based upon your feedback, as well as a few bug fixes that have
  trickeled in.

  Highlights:

   1) Low latency device polling, eliminating the cost of interrupt
      handling and context switches.  Allows direct polling of a network
      device from socket operations, such as recvmsg() and poll().

      Currently ixgbe, mlx4, and bnx2x support this feature.

      Full high level description, performance numbers, and design in
      commit 0a4db187a9 ("Merge branch 'll_poll'")

      From Eliezer Tamir.

   2) With the routing cache removed, ip_check_mc_rcu() gets exercised
      more than ever before in the case where we have lots of multicast
      addresses.  Use a hash table instead of a simple linked list, from
      Eric Dumazet.

   3) Add driver for Atheros CQA98xx 802.11ac wireless devices, from
      Bartosz Markowski, Janusz Dziedzic, Kalle Valo, Marek Kwaczynski,
      Marek Puzyniak, Michal Kazior, and Sujith Manoharan.

   4) Support reporting the TUN device persist flag to userspace, from
      Pavel Emelyanov.

   5) Allow controlling network device VF link state using netlink, from
      Rony Efraim.

   6) Support GRE tunneling in openvswitch, from Pravin B Shelar.

   7) Adjust SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF for modern times, from
      Daniel Borkmann and Eric Dumazet.

   8) Allow controlling of TCP quickack behavior on a per-route basis,
      from Cong Wang.

   9) Several bug fixes and improvements to vxlan from Stephen
      Hemminger, Pravin B Shelar, and Mike Rapoport.  In particular,
      support receiving on multiple UDP ports.

  10) Major cleanups, particular in the area of debugging and cookie
      lifetime handline, to the SCTP protocol code.  From Daniel
      Borkmann.

  11) Allow packets to cross network namespaces when traversing tunnel
      devices.  From Nicolas Dichtel.

  12) Allow monitoring netlink traffic via AF_PACKET sockets, in a
      manner akin to how we monitor real network traffic via ptype_all.
      From Daniel Borkmann.

  13) Several bug fixes and improvements for the new alx device driver,
      from Johannes Berg.

  14) Fix scalability issues in the netem packet scheduler's time queue,
      by using an rbtree.  From Eric Dumazet.

  15) Several bug fixes in TCP loss recovery handling, from Yuchung
      Cheng.

  16) Add support for GSO segmentation of MPLS packets, from Simon
      Horman.

  17) Make network notifiers have a real data type for the opaque
      pointer that's passed into them.  Use this to properly handle
      network device flag changes in arp_netdev_event().  From Jiri
      Pirko and Timo Teräs.

  18) Convert several drivers over to module_pci_driver(), from Peter
      Huewe.

  19) tcp_fixup_rcvbuf() can loop 500 times over loopback, just use a
      O(1) calculation instead.  From Eric Dumazet.

  20) Support setting of explicit tunnel peer addresses in ipv6, just
      like ipv4.  From Nicolas Dichtel.

  21) Protect x86 BPF JIT against spraying attacks, from Eric Dumazet.

  22) Prevent a single high rate flow from overruning an individual cpu
      during RX packet processing via selective flow shedding.  From
      Willem de Bruijn.

  23) Don't use spinlocks in TCP md5 signing fast paths, from Eric
      Dumazet.

  24) Don't just drop GSO packets which are above the TBF scheduler's
      burst limit, chop them up so they are in-bounds instead.  Also
      from Eric Dumazet.

  25) VLAN offloads are missed when configured on top of a bridge, fix
      from Vlad Yasevich.

  26) Support IPV6 in ping sockets.  From Lorenzo Colitti.

  27) Receive flow steering targets should be updated at poll() time
      too, from David Majnemer.

  28) Fix several corner case regressions in PMTU/redirect handling due
      to the routing cache removal, from Timo Teräs.

  29) We have to be mindful of ipv4 mapped ipv6 sockets in
      upd_v6_push_pending_frames().  From Hannes Frederic Sowa.

  30) Fix L2TP sequence number handling bugs, from James Chapman."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1214 commits)
  drivers/net: caif: fix wrong rtnl_is_locked() usage
  drivers/net: enic: release rtnl_lock on error-path
  vhost-net: fix use-after-free in vhost_net_flush
  net: mv643xx_eth: do not use port number as platform device id
  net: sctp: confirm route during forward progress
  virtio_net: fix race in RX VQ processing
  virtio: support unlocked queue poll
  net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit
  Documentation: Fix references to defunct linux-net@vger.kernel.org
  net/fs: change busy poll time accounting
  net: rename low latency sockets functions to busy poll
  bridge: fix some kernel warning in multicast timer
  sfc: Fix memory leak when discarding scattered packets
  sit: fix tunnel update via netlink
  dt:net:stmmac: Add dt specific phy reset callback support.
  dt:net:stmmac: Add support to dwmac version 3.610 and 3.710
  dt:net:stmmac: Allocate platform data only if its NULL.
  net:stmmac: fix memleak in the open method
  ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available
  net: ipv6: fix wrong ping_v6_sendmsg return value
  ...
2013-07-09 18:24:39 -07:00
Alexey Khoroshilov 773fe724ab staging: ft1000: fix memory leak on error path in ft1000_probe()
ft1000dev->tx_urb and ft1000dev->rx_urb are not deallocated
if something goes wrong in ft1000_probe(). Also there is no
check for success of urb allocation. The patch fixes the both issues.

By the way, there is no sense in GFP_ATOMIC for urb allocation here,
so it is changed to GFP_KERNEL.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-11 17:13:37 -07:00
Aldo Iljazi 2dad6e4688 Staging: ft1000-pcmcia: ft1000_dnld.c: fixed four checkpatch
Fixed four checkpatch error complains, specifically:
ft1000_dnld.c:512: ERROR: space prohibited after that '&' (ctx:WxW)
ft1000_dnld.c:514: ERROR: space prohibited after that '&' (ctx:WxW)
ft1000_dnld.c:694: ERROR: space prohibited before that close parenthesis ')'
ft1000_dnld.c:713: ERROR: space prohibited before that close parenthesis ')'

Signed-off-by: Aldo Iljazi <neonsync1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 13:12:43 -07:00
Jiri Pirko 351638e7de net: pass info struct via netdevice notifier
So far, only net_device * could be passed along with netdevice notifier
event. This patch provides a possibility to pass custom structure
able to provide info that event listener needs to know.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>

v2->v3: fix typo on simeth
	shortened dev_getter
	shortened notifier_info struct name
v1->v2: fix notifier_call parameter in call_netdevice_notifier()
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-28 13:11:01 -07:00
Katja Collier 518d752d7b staging: fixed else format in ft1000_debug.c
Put else statements on same line as if statement close bracket in
"/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c".

Signed-off-by: Katja Collier <katjacollier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-17 15:54:57 -07:00
Katja Collier 002c6d57ed staging: fixed spaces around parens in ft1000
Deleted extra spaces before and after parens, added a couple necessary
spaces before parens in
"/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c" and
"/drivers/staging/ft1000/ft1000-usb/ft1000_ioctl.h".

Signed-off-by: Katja Collier <katjacollier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-17 15:54:57 -07:00
Katja Collier 52adc0b4ee staging: open braces in ft1000_debug.c and ioctl.h
Fixed open braces error in "/staging/ft1000/ft1000-usb/ft1000_ioctl.h"
and "/staging/ft1000/ft1000-usb/ft1000_debug.c" by moving braces to the
correct line.

Signed-off-by: Katja Collier <katjacollier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-17 15:54:56 -07:00
Katja Collier 312d261e12 staging: improved comment style in ft1000_ioctl.h
Replaced C99 style comments with C89 in
"/drivers/staging/ft1000/ft1000-usb/ft1000_ioctl.h".

Signed-off-by: Katja Collier <katjacollier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-17 15:54:56 -07:00
Katja Collier cbb3ae9998 staging: improved comment style in ft1000_debug.c
Replaced C99 style comments with C89 in
"/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c".

Signed-off-by: Katja Collier <katjacollier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-17 15:53:22 -07:00
Dylan Socolobsky 8671438049 Staging: ft1000: Change C99 comments in ft1000_dnld.c
This simple patch fixes the ERRORs found by checkpatch.pl in the file
ft1000_dnld.c by switching to the standard Kernel comment style.

Signed-off-by: Dylan Socolobsky <dsocolobsky@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:03:44 -07:00
Dylan Socolobsky 6fb3c2bd69 Staging: ft1000: fix brace coding style in ft1000_dnld.c
This simple patch fixes a brace warning raised by checkpatch.pl in ft1000_dnld.c

Signed-off-by: Dylan Socolobsky <dsocolobsky@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:03:43 -07:00
Al Viro bae301d346 staging: single_open() leaks
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-05 00:15:43 -04:00
David Howells 207e39099a ft1000: Don't use create_proc_read_entry()
Don't use create_proc_read_entry() as that is deprecated, but rather use
proc_create_data() and seq_file instead.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marek Belisko <marek.belisko@gmail.com>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Ondrej Zary <linux@rainbow-software.org>
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:51 -04:00
Al Viro 75ef9de126 constify a bunch of struct file_operations instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:16:20 -04:00
Linus Torvalds b5c78e04dd Staging tree update for 3.9-rc1
Here's the big staging tree merge for 3.9-rc1
 
 Lots of cleanups and updates for drivers all through the staging tree.
 We are pretty much "code neutral" here, adding just about as many lines
 as we removed.
 
 All of these have been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEUEABECAAYFAlEmW7QACgkQMUfUDdst+ymlIACXT5mv8Y5A/KJa+QLTNNsofI8u
 aACgq9hNZxJzX6VQMLXUV8+2SILOqYo=
 =5wIj
 -----END PGP SIGNATURE-----

Merge tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging tree update from Greg Kroah-Hartman:
 "Here's the big staging tree merge for 3.9-rc1

  Lots of cleanups and updates for drivers all through the staging tree.
  We are pretty much "code neutral" here, adding just about as many
  lines as we removed.

  All of these have been in linux-next for a while."

* tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (804 commits)
  staging: comedi: vmk80xx: wait for URBs to complete
  staging: comedi: drivers: addi-data: hwdrv_apci3200.c: Add a missing semicolon
  staging: et131x: Update TODO list
  staging: et131x: Remove assignment of skb->dev
  staging: wlan-ng: hfa384x.h: fix for error reported by smatch
  staging/zache checkpatch ERROR: spaces prohibited around that
  staging/ozwpan: Mark read only parameters and structs as const
  staging/ozwpan: Remove empty and unused function oz_cdev_heartbeat
  staging/ozwpan: Mark local functions as static (fix sparse warnings)
  staging/ozwpan: Add missing header includes
  staging/usbip: Mark local functions as static (fix sparse warnings)
  staging/xgifb: Remove duplicated code in loops.
  staging/xgifb: Consolidate return paths
  staging/xgifb: Remove code without effect
  staging/xgifb: Remove unnecessary casts
  staging/xgifb: Consolidate if/else if with identical code branches
  staging: vt6656: replaced custom TRUE definition with true
  staging: vt6656: replaced custom FALSE definition with false
  staging: vt6656: replace custom BOOL definition with bool
  staging/rtl8187se: Mark functions as static to silence sparse
  ...
2013-02-21 12:11:44 -08:00
Joe Perches 78110bb8dc staging: Remove unnecessary OOM messages
alloc failures already get standardized OOM
messages and a dump_stack.

For the affected mallocs around these OOM messages:

Converted kzallocs with multiplies to kcalloc.
Converted kmallocs with multiplies to kmalloc_array.
Converted a kmalloc/strlen/strncpy to kstrdup.
Moved a spin_lock below a removed OOM message and
removed a now unnecessary spin_unlock.
Neatened alignment and whitespace.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-11 10:10:33 -08:00
Kurt Kanzenbach a11b0e860b Staging: ft1000-usb: Fix call to obsolete function
strict_strtoul is obsolete and should be replaced with
kstrto* function as reported by checkpatch.pl.
pInfo->CardNumber is a u8. This is why kstrtou8 should be
used here.

Signed-off-by: Kurt Kanzenbach <shifty91@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:33:45 -08:00
Ondrej Zary dedbc93318 staging: ft1000: rename struct ft1000_device to ft1000_usb
After unifying struct ft1000_info, struct ft1000_device is now wrong name.
Rename it to ft1000_usb to match its semantics.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:33:45 -08:00
Ondrej Zary 3aa2303a20 staging: ft1000: unify struct ft1000_info between USB and PCMCIA drivers
Unify struct ft1000_info between ft1000-usb and ft1000-pcmcia and move it to
common ft1000.h.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Tested-by: Marek Belisko <marek.belisko@open-nandra.com>
Review-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:33:45 -08:00
Jiri Pirko 7826d43f2d ethtool: fix drvinfo strings set in drivers
Use strlcpy where possible to ensure the string is \0 terminated.
Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN
and custom defines.
Use snprintf instead of sprint.
Remove unnecessary inits of ->fw_version
Remove unnecessary inits of drvinfo struct.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-06 21:06:31 -08:00
Devendra Naga f884c19224 staging: ft1000: remove assigments of ret and initialise it in beginning
as ret is every time assigned to EINVAL in fail cases, initialise it at
the beginning.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26 16:21:18 -08:00
Devendra Naga ad139634c5 staging: ft1000: replace c99 comments with c88
replace some of the c99 comments to the structures with c88 comment style
no code change is done here.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17 05:31:32 -07:00
Marek Belisko b0add95059 staging: ft1000: Replace timeout values with USB_CTRL_G(S)ET_TIMEOUT.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13 19:28:58 -07:00
Marek Belisko 18978952c1 staging: ft1000: Fix ft1000_control function timeout argument usage.
Function ft1000_control have input argument timeout which was not passed
to usb_control_msg instead hardcoded to LARGE_TIMEOUT.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13 19:28:58 -07:00
Marek Belisko b70ac75eef staging: ft1000-usb: Fix various checkpach warnings in ft1000_usb.h
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 19:06:18 -07:00
Marek Belisko 35975ea664 staging: ft1000-usb: Replace all C99 comments with regular in ft1000_usb.h.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 19:06:18 -07:00
Marek Belisko f7e5780def staging: ft1000-usb: Fix lines over 80 chars.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 19:06:18 -07:00
Marek Belisko 03b3ac18cf staging: ft1000-usb: Remove name comments from ft1000_usb.h.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 19:06:18 -07:00
Marek Belisko 586288c957 staging: ft1000-usb: Remove spaces from struct dpram_blk.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 19:06:18 -07:00
Marek Belisko e2bdf27d39 staging: ft1000-usb: Remove leading spaces from struct ft1000_info.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 19:06:18 -07:00
Marek Belisko 494e734a40 staging: ft1000-usb: Remove commented lines from ft1000_device.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 19:06:17 -07:00
Marek Belisko 626888df7f staging: ft1000-usb: Change KERN_ERROR usage to pr_err in ft1000_usb.c.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 19:06:17 -07:00
Masanari Iida aaf3ee4f80 staging: ft1000: Fix typo in ft1000_usb.c
Correct spelling typo within debug message of ft1000_usb.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11 17:21:54 -07:00
Devendra Naga 80145a579f staging/ft1000: remove all spaces, tabs issue in while loop of ft1000_interrupt
all spaces in the main while loop of ft1000_interrupt are converted
to tabs.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11 17:21:54 -07:00
Devendra Naga b7c5a774b0 staging/ft1000: remove unnecessary assignment of ret with STATUS_SUCCESS
as ret is assigned to the return of ft1000_poll, we dont need to
initialise ret with STATUS_SUCCESS.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09 12:26:43 -07:00
Devendra Naga 95f2825d3b staging/ft1000-pcmcia: fix checkpatch warnings
The below checkpatch warns fixed,

drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:38: ERROR: that open brace { should be on the previous line
drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:45: ERROR: that open brace { should be on the previous line
drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c:57: ERROR: that open brace { should be on the previous line

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09 12:26:43 -07:00
Devendra Naga cfe116c2c0 staging/ft1000: fix the foo * bar warning
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09 12:26:43 -07:00
Devendra Naga b3a87c3767 staging/ft1000: fix the no brace needed warning in ft1000_read_fifo_len
as the if else statements enclose only one line, so braces around them are not
needed.

The following warning is fixed

drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c💯 WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09 12:26:43 -07:00
Devendra Naga 3bc2311e32 staging/ft1000: fix sparse warning about the kernel thread handler function
sparse throws warning about the ft1000_poll_thread as

drivers/staging/ft1000/ft1000-usb/ft1000_usb.c:40:5: warning: symbol 'ft1000_poll_thread' was not declared. Should it be static?

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09 12:26:43 -07:00
Devendra Naga 3a0ccb0db9 staging/ft1000: fix sparse warning
sparse warns about having 0 assigned to a pointer,
fix it up by using NULL.

The following sparse warning is fixed

drivers/staging/ft1000/ft1000-usb/ft1000_debug.c:170:52: warning: Using plain integer as NULL pointer

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09 12:26:42 -07:00
Devendra Naga 64cab4e276 staging/ft1000: fix the no brace needed warning in ft1000_interrupt
as the if statement encloses only one line braces around it are not
needed.

The following warn fixed,
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09 12:26:42 -07:00
Devendra Naga aab0489239 staging/ft1000: fix minor coding style problem
this following warn is fixed up

drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:1754:
ERROR: open brace '{' following function declarations go on the next line

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06 16:21:54 -07:00
Devendra Naga 06e34dfb85 staging/ft1000: remove usage of ret in ft1000_open
remove the ret and do a simple  "return ft1000_submit_rx_urb"

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20 16:07:07 -07:00
Devendra Naga 42ad4a8da5 staging/ft1000: use kzalloc to allocate the ft1000_device structure
with kzalloc the allocate memory is set to zero, so no need of
calling memset again on the allocated memory

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20 16:07:07 -07:00
Devendra Naga b10c0b92ca staging/ft1000: Return -ENOMEM if kmalloc fails at ft1000_probe
If the kmalloc fails return -ENOMEM , returning 0 is not the proper
way if any function fails

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20 16:07:07 -07:00
David Howells 9ffc93f203 Remove all #inclusions of asm/system.h
Remove all #inclusions of asm/system.h preparatory to splitting and killing
it.  Performed with the following command:

perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *`

Signed-off-by: David Howells <dhowells@redhat.com>
2012-03-28 18:30:03 +01:00
Linus Torvalds 3b59bf0816 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking merge from David Miller:
 "1) Move ixgbe driver over to purely page based buffering on receive.
     From Alexander Duyck.

  2) Add receive packet steering support to e1000e, from Bruce Allan.

  3) Convert TCP MD5 support over to RCU, from Eric Dumazet.

  4) Reduce cpu usage in handling out-of-order TCP packets on modern
     systems, also from Eric Dumazet.

  5) Support the IP{,V6}_UNICAST_IF socket options, making the wine
     folks happy, from Erich Hoover.

  6) Support VLAN trunking from guests in hyperv driver, from Haiyang
     Zhang.

  7) Support byte-queue-limtis in r8169, from Igor Maravic.

  8) Outline code intended for IP_RECVTOS in IP_PKTOPTIONS existed but
     was never properly implemented, Jiri Benc fixed that.

  9) 64-bit statistics support in r8169 and 8139too, from Junchang Wang.

  10) Support kernel side dump filtering by ctmark in netfilter
      ctnetlink, from Pablo Neira Ayuso.

  11) Support byte-queue-limits in gianfar driver, from Paul Gortmaker.

  12) Add new peek socket options to assist with socket migration, from
      Pavel Emelyanov.

  13) Add sch_plug packet scheduler whose queue is controlled by
      userland daemons using explicit freeze and release commands.  From
      Shriram Rajagopalan.

  14) Fix FCOE checksum offload handling on transmit, from Yi Zou."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1846 commits)
  Fix pppol2tp getsockname()
  Remove printk from rds_sendmsg
  ipv6: fix incorrent ipv6 ipsec packet fragment
  cpsw: Hook up default ndo_change_mtu.
  net: qmi_wwan: fix build error due to cdc-wdm dependecy
  netdev: driver: ethernet: Add TI CPSW driver
  netdev: driver: ethernet: add cpsw address lookup engine support
  phy: add am79c874 PHY support
  mlx4_core: fix race on comm channel
  bonding: send igmp report for its master
  fs_enet: Add MPC5125 FEC support and PHY interface selection
  net: bpf_jit: fix BPF_S_LDX_B_MSH compilation
  net: update the usage of CHECKSUM_UNNECESSARY
  fcoe: use CHECKSUM_UNNECESSARY instead of CHECKSUM_PARTIAL on tx
  net: do not do gso for CHECKSUM_UNNECESSARY in netif_needs_gso
  ixgbe: Fix issues with SR-IOV loopback when flow control is disabled
  net/hyperv: Fix the code handling tx busy
  ixgbe: fix namespace issues when FCoE/DCB is not enabled
  rtlwifi: Remove unused ETH_ADDR_LEN defines
  igbvf: Use ETH_ALEN
  ...

Fix up fairly trivial conflicts in drivers/isdn/gigaset/interface.c and
drivers/net/usb/{Kconfig,qmi_wwan.c} as per David.
2012-03-20 21:04:47 -07:00
Danny Kukawka 3274ce71fe Staging: ft1000-pcmcia: print MAC via printk format specifier
Print MAC/dev_addr via printk extended format specifier %pM
instead of custom code.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
2012-02-24 15:41:31 -05:00
Kashyap Gada 8ebc0b65d7 Staging: ft1000: ft1000-pcmia: fix space required after that ', ' in ft1000_proc.c
This is a patch to the ft1000_proc.c that fixes up space required after
',' errors found by the checkpatch.pl tool

Signed-off-by: Kashyap Gada <gada.kashyap@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:44:35 -08:00