[go: nahoru, domu]

History log of /drivers/staging/bcm/Bcmchar.c
Revision Date Author Comments
38bb617449060ae5301c1b0802bbe4c0fb1252e3 22-Sep-2014 Heena Sirwani <heenasirwani@gmail.com> Staging: bcm: Remove unneeded else after return.

The following patch fixes the checkpatch.pl warning:
WARNING: else is generally not useful after a break or return.

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
e324ae64c6777c0afd434c1b2081c9b8fcaf67c2 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "NOB" -> "nob"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b67bc7788f1bcfb0ac17719d9859ebb177cefb3a 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "pTarang" -> "tarang"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ad4a9e6d996f5ca57cb1c20f9d17a4e0d7cfbcba 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "stTimeElapsedSinceNetEntry" -> "time_elapsed_since_net_entry"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bafa367468ed3a1d9d31d2651bab963f4ee5ae9a 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "DevInfo" -> "dev_info"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bd8107b2b2dc9fb1113bfe1a9cf2533ee19c57ee 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "RxCntrlMsgBitMask" -> "rx_cntrl_msg_bit_mask"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1b2318a19f71e22cedf7ee97efe368fe9c5bb3d6 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "ReadOffset" -> "read_offset"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bd5148325d05a1b8e8fae92ea62b8d763ad883b1 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "stNVMRead" -> "nvm_read"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3f1d98eab69ba478ceb40f4e0400fcdab98ae380 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "SectOfset" -> "sect_offset"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
50a9e6fe6dadc0fc4800beaf8f35042bc463eefc 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "sCopySectStrut" -> "copy_sect_strut"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
d35be09d772eaa30f2aa088872dab8245352e5f2 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "eFlash2xSectionVal" -> "flash_2x_section_val"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
d16c8489c164dad8bd3469aae591bc3db3a8c8c2 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "psFlash2xBitMap" -> "flash_2x_bit_map"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
57240f04343177ae505ec422501f495f367d11a8 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "WriteOffset" -> "write_off"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1b81edbc3d3c7a26f812a6d65f10fe203f3883be 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "InputAddr" -> "input_addr"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
63f7a797f698e5f598600d2da316b2db472a8bd7 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "pWriteBuff" -> "write_buff"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b69e66bcc03b3fd8f108753b5dd682f1e91a9bf2 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "WriteBytes" -> "write_bytes"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ca3c80c2801cee676a95523f7673041537845df5 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "ReadBytes" -> "read_bytes"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ac56aa228a1cada777bd0a70f034522f09e1e758 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "BuffSize" -> "buff_size"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3416bc87237d9bb76f355861add826b87dd00b40 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "pReadBuff" -> "read_buff"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ddf559a91adce5a45da1bf1e4a0bdeb4594dad6d 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "sFlash2xRead" -> "flash_2x_read"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
f45700481f011a4dc27ea393514bd6e044bc370a 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "pReadData" -> "read_data"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bad5f56d0eb7a09876a5dcc05a927b5d271ebfe4 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "stNVMReadWrite" -> "nvm_rw"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
0622a6f46cd0c1cb16d14097a0e2872cf0e67c6f 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "sUserDebugState" -> "user_debug_state"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
70edad0eaa2517d30823f2fde577b67a0445b0a4 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "uiSectorSize" -> "sector_size"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
db1f4df0b3a298ce10e9b8f2a066d43844f3f373 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "uiTempVar" -> "tmp"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
81d69c748ae596c1fb199bf6d275f2697dadd719 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "pBulkBuffer" -> "bulk_buff"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27c31808014ae8b61e9a752460d900bda177ec12 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "uiData" -> "data"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2955572eaaa4171cd5a9e99d1750d44b23888bbf 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "uiLoopIndex" -> "i"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7029fbb7611ca150f3d377dad9a47c4f94a307a6 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "NVMAccess" -> "nvm_access"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3f262b21dab0834ca09979fb404922c5f561eeed 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "psFwInfo" -> "fw_info"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ea3d010d3ba6ec73cb4c6cbd5dbf7ee044605c1f 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "ulSFId" -> "sf_id"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
f9940ea6b6efd44f05727d1611803e6ea2835994 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "pvBuffer" -> "buff"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
0ed2c01674015419e7e4d4d98c4e41f49e00b52f 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "ucResetValue" -> "reset_val"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5ab1b7f2ae07bb0505c9f8e56ce79da87ed8c2b1 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "Status" -> "status"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
92dae16fb42c33869aa6d1b9d4ef78a079235c5c 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "ucRead" -> "read"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
a00765a0dae0516e61d41bddfe7be609e085266f 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "uiBit" -> "bit"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9b62b9636c9e6a2957eeb3feaec02c480d7715f5 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "IoBuffer" -> "io_buff"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
657c65dd666058c3783796f3f844c6507c78d5f0 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "threadReq" -> "thread_req"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11d37b1f36c83e80267630c9856eb205b7426e0b 27-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable: "Adapter" -> "ad"

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2a2c9cea711348a4860e1ac0b414eea0e6f56bc2 18-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Fixed debug output

The output prints some struct variable contents, but uses a wrong
variable name. This is fixed by this patch.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fe773165210890082ccab524b2818a4a466656dc 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "uiOperation" -> "operation"

Renamed variable "uiOperation" -> "operation" in
bcm_char_ioctl_gpio_set_request().

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
198d73daacb97a49a4daa4894609f48819e39c0a 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "uiBit" -> "bit"

Renamed variable "uiBit" -> "bit" in bcm_char_ioctl_gpio_set_request().

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
80c329ad0c1a743ca15e997bbcef8bc622c1df58 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "ucResetValue" -> "reset_val"

Renamed variable "ucResetValue" -> "reset_val" in
bcm_char_ioctl_gpio_set_request().

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
41e708109475001431a8182716f90898621e0555 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "uiTempVar" -> "tmp"

Renamed variable "uiTempVar" -> "tmp" in

bcm_char_ioctl_reg_write_private()
bcm_char_ioctl_eeprom_reg_read()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
95123f22a17f57bb5c51d662b1ecc3f6cc21afe6 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "sWrmBuffer" -> "wrm_buff"

Renamed variable "sWrmBuffer" -> "wrm_buff" in

bcm_char_ioctl_reg_write_private()
bcm_char_ioctl_eeprom_reg_read()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
343fae74744506948d86af5144d3d9eadda59943 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "Bufflen" -> "buff_len"

Renamed variable "Bufflen" -> "buff_len" in
bcm_char_ioctl_reg_read_private().

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
00c6fbcdab7ba34f3597715497b3a8224164c508 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "IoBuffer" -> "io_buff"

Renamed variable "IoBuffer" -> "io_buff" in

bcm_char_ioctl_reg_read_private()
bcm_char_ioctl_reg_write_private()
bcm_char_ioctl_reg_write_private()
bcm_char_ioctl_eeprom_reg_read()
bcm_char_ioctl_gpio_set_request()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
201893bc516a1797d2fac8e931fe551eb78ed8f5 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "sRdmBuffer" -> "rdm_buff"

Renamed variable "sRdmBuffer" -> "rdm_buff" in

bcm_char_ioctl_reg_read_private()
bcm_char_ioctl_reg_write_private()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
aafec40c30e97cbcbc703ca17ab1ebf7fc06cf3a 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "Packet" -> "packet"

Renamed variable "Packet" -> "packet" in bcm_char_read().

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
dab41a0ea8a7704b8a7bf806f123fd8a3d2c0362 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "PktLen" -> "pkt_len"

Renamed variable "PktLen" -> "pkt_len" in bcm_char_read().

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
f90a8a25f500700bb1c603b5c9d8a5069e6aa5b9 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "pTarang" -> "tarang"

Renamed variable "pTarang" -> "tarang" in

bcm_char_open()
bcm_char_release()
bcm_char_read()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
900025a3bd73e38ed6df25e3751c480babbcaf4c 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "ulDSDMagicNumInUsrBuff" -> "dsd_magic_num_in_usr_buff"

Renamed variable "ulDSDMagicNumInUsrBuff" ->
"dsd_magic_num_in_usr_buff" in handle_flash2x_adapter().

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bd9a40788d7d25b6fa17ad119c9000c536e6e58d 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "Status" -> "status"

Renamed variable "Status" -> "status" in

bcm_handle_nvm_read_cmd()
handle_flash2x_adapter()
bcm_char_ioctl_reg_read_private()
bcm_char_ioctl_reg_write_private()
bcm_char_ioctl_reg_write_private()
bcm_char_ioctl_eeprom_reg_read()
bcm_char_ioctl_gpio_set_request()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9dc535b57a0d1971044c28ca11bb6a95603a54e1 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "stNVMReadWrite" -> "nvm_rw"

Renamed variable "stNVMReadWrite" -> "nvm_rw" in

bcm_handle_nvm_read_cmd()
handle_flash2x_adapter()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
e17219af18faf7e093390d6273f709df7e20ff60 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "pReadData" -> "read_data"

Renamed variable "pReadData" -> "read_data" in

bcm_handle_nvm_read_cmd()
handle_flash2x_adapter()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5a7add1cc72f1ef3662146505add0fa5744fdbec 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Renamed variable "Adapter" -> "ad"

Renamed variable "Adapter" -> "ad" in

bcm_handle_nvm_read_cmd()
handle_flash2x_adapter()
bcm_char_open()
bcm_char_release()
bcm_char_read()
bcm_char_ioctl_reg_read_private()
bcm_char_ioctl_reg_write_private()
bcm_char_ioctl_reg_write_private()
bcm_char_ioctl_eeprom_reg_read()
bcm_char_ioctl_gpio_set_request()

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bf8fa21cb70ceaf8d5898c57b80e707dfca79fa9 10-Aug-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Bcmchar.c: Fixed indentation of function arguments

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
806c4879e04408e66ae35d7d0af37ec3c050e456 29-May-2014 Sachin Kamat <sachin.kamat@linaro.org> staging: bcm: Remove redundant casting in Bcmchar.c

Casting value returned by kzalloc is useless.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4764ca981b040048766e4f39a45a4b9c5cecff9c 26-May-2014 Peter Senna Tschudin <peter.senna@gmail.com> drivers/staging: 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
when strict
return
- ret
+ C
;
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2c11ca29a06a2fe5b54fd5d4d73cf3c536cca2d4 22-May-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Indentation fixes in Bcmchar.c

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
e5c34a1aade7befa50c46381d0cc7b8f61475b31 22-May-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Outsourced IsFlash2x() handling

This patch outsources the code from the IsFlash2x() check in
bcm_char_ioctl_nvm_rw() function to shorten it.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8224ac2a787540afb77c18cc338284b1ad697b8e 22-May-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Outsourced cmd handling to function

This patch outsourced the true-branch for the IOCTL_BCM_NVM_READ command
handling to shorten the bcm_char_ioctl_nvm_rw() function.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22840adaf7c66bcba826a22e56e81c58c007421a 22-May-2014 Matthias Beyer <mail@beyermatthias.de> Staging: bcm: Fixed line lengths

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7d057e7d634a7d28b5559f3acd98170bcb7a2c3d 13-Mar-2014 Ebru Akagunduz <ebru.akagunduz@gmail.com> Staging: bcm: Removed unreachable code line in Bcmchar.c

This patch removes unreachable code line and
unnecessary braces in Bcmchar.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
18e26b358a1a67ce2648270a07b647fe613bc81b 13-Mar-2014 Ebru Akagunduz <ebru.akagunduz@gmail.com> Staging: bcm: fix line over 80 characters in Bcmchar.c

Fix checkpatch.pl issues with line over 80
characters in Bcmchar.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
ee2104ea865f8a12eebb382aa502f248e14a5a2d 17-Feb-2014 Dan Carpenter <dan.carpenter@oracle.com> staging/bcm: integer underflow leads to Oom

We do:

if (NOB > DEFAULT_BUFF_SIZE)
BuffSize = DEFAULT_BUFF_SIZE;
else
BuffSize = NOB;

Since NOB can be negative it results in a larger than intended BuffSize
and makes kzalloc() fail.

The code is still a bit crap because it lets the users read as much as
they want from nvram, but I don't know what a sensible upper limit
should be.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cfff3e5c8d2139c38d40d90e3d9fc13721222076 17-Feb-2014 Dan Carpenter <dan.carpenter@oracle.com> staging/bcm: two information leaks in ioctl

There are a couple paths where we don't check how much data we copy back
to the user.

Cc: Dave Jones <davej@redhat.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
84f7a542f9e0191b6f7ab87881a050889576a5c4 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_TIME_SINCE_NET_ENTRY case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fe59cefb6971ded0f130bbdd3dfeb1fcc9446c31 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GET_DEVICE_DRIVER_INFO case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8f7e14eee717487086c66ae17fb9936e834c4469 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_CNTRLMSG_MASK case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b3e5804e48dfad205ef45f03e30afb8a31256566 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_NVM_RAW_READ case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3c06b7a174bd4e8ca1db9614a9d5be49db2dc868 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_SELECT_DSD case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3aae97fb491bf17d0ef0b39b55207fa3f199cc89 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GET_FLASH_CS_INFO case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3e2aea599222a5f345fc425084fb17668f5d88e5 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_COPY_SECTION case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
56b682a5ac237c02cf7c11748e4f285fe0c8b0cb 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: formatting cleaning for IOCTL_BCM_IDENTIFY_ACTIVE_SECTION

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9e0d6e1a0d9c6edba6dc27978b921180a1bef509 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_SET_ACTIVE_SECTION case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
338a5c4a36d360865163fd6c5b32d9ae474bd61d 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GET_FLASH2X_SECTION_BITMAP case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
174b3b46bdceb7f4663ef7227dd9ede394732e58 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_FLASH2X_SECTION_WRITE case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b4571fc2067b2568c5c05b063e7488ba30476670 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_FLASH2X_SECTION_READ case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5be531c22a9fa2b8f988462fa3950fa2fe33eacd 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_NVM_[READ|WRITE] cases out to their own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
085ca029bef8e120ebf2b400ba28eef336fe6fe8 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_SET_DEBUG case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1e1ee184628a1f7e9597e58f90a187c7c1afd7d0 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_CAL_INIT case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1c55e38104fdb9b60efb1db13f82f120b86e55eb 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GET_NVM_SIZE case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b32384b43d12a72ffd1493c8f60803d023b96726 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_BULK_WRM case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
db9a4dc78f961a4f4a3812f5a6f7cf79d56814ed 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GET_HOST_MIBS case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4d476affecd21c5e0d8387486c5eb00f56d47c4c 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GET_DSX_INDICATION case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cfd01356f95ac95801d8eb183b505dd2801dc289 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_SET_MAC_TRACING case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9c434f8e23c29c8cd2ff88048ca6508e9d3ed360 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GET_CURRENT_STATUS case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
dfb442d455abf50149a55b25f1c58a46806100c0 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GET_DRIVER_VERSION case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
a0ad961a2777b27ef529097449b5dfff5195e5f0 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_SWITCH_TRANSFER_MODE case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
645926b3139d5989fb92c0982cf49b071291c9a4 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_QOS_THRESHOLD case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6e5781c67dfc0946cb53baa0cb034a12925911dd 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_CHIP_RESET case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
49444b558d6c19cb6d6e76c689b33bf6dd7071e8 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_BUFFER_DOWNLOAD_STOP case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
d9db71bdd3a28431b724d7790d40c4dffd63bed8 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_BUFFER_DOWNLOAD case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
79f99494892c8bd7e7464ee273d8a43fc08c406d 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_BUFFER_DOWNLOAD_START case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
0566ee9536c29e6eca0b0f9191f9ea3585a7ea46 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move several request ioctl cases out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
e2d94d261e7ffce29af31086703fd5aa03653c43 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GPIO_MODE_REQUEST case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3903246c417b01514cf949477a2235f6928dd633 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GPIO_MULTI_REQUEST case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3eedb5fa71f38bdb07491af8b65da27d48dd0f3b 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GPIO_STATUS_REQUEST case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3eccdbcdb75dcbec142d6332075c446473e9b4d6 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move BCM_LED_THREAD_STATE_CHANGE_REQ case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
f494a916d3bed992e1275157eeaf709d8383aa27 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_GPIO_SET_REQUEST case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4d4b00a968278d9187b92f5cdc2b1bf55e010bbc 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_EEPROM_REGISTER_WRITE case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3195d4e0d9d6f2a51a2260abb7b21569af81f6ed 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_EEPROM_REGISTER_READ case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6827009f09d27e51aed337c11c699f7b1cfc84ce 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_REGISTER_WRITE_PRIVATE case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
59fbe7025ad5878bc6e6a002d2818b08d9a07e38 13-Feb-2014 Dave Jones <davej@redhat.com> staging/bcm: move IOCTL_BCM_REGISTER_READ_PRIVATE case out to its own function.

bcm_char_ioctl is one of the longest non-generated functions in the kernel,
at 1906 lines. Splitting it up into multiple functions should simplify
this a lot.

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
276d30eab931eae0ce5c5504b8ff4ab4c97b207b 11-Jan-2014 Masanari Iida <standby24x7@gmail.com> staging: bcm : Fix typo in staging/bcm

This patch fixed spelling typo in comment and printks
withing staging/bcm.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5570de180d4a69f582564db82e89b08bfa09a151 10-Nov-2013 Ingrid Cheung <hi@ingridcheung.com> Staging: bcm: Fix checkpatch warnings for long lines.

Fixes multiple checkpatch warnings for long lines in Bcmchar.c.

Signed-off-by: Ingrid Cheung <hi@ingridcheung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7fae8b0a0b09b59539e8056f943b3cf0c60b738f 10-Nov-2013 Ingrid Cheung <hi@ingridcheung.com> Staging: bcm: Fix checkpatch warning for long line.

Fixed a line that was over 80 characters in Bcmchar.c.

Signed-off-by: Ingrid Cheung <hi@ingridcheung.com>
Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ab46b7920cb1eabf2991f9f829094e53663650a0 01-Nov-2013 Nandini Hanumanthagowda <nandu.hgowda@gmail.com> staging: bcm: removed prohibited space before semicolon

removed prohibited space before semicolon(;) to fix
checkpatch warning

Signed-off-by: Nandini Hanumanthagowda <nandu.hgowda@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8d1e72250c847fa96498ec029891de4dc638a5ba 29-Oct-2013 Dan Carpenter <dan.carpenter@oracle.com> Staging: bcm: info leak in ioctl

The DevInfo.u32Reserved[] array isn't initialized so it leaks kernel
information to user space.

Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
0cd2da41a35ae990233eaeadea3da90d1481be43 23-Oct-2013 Chuong Ngo <cngo.github@gmail.com> drivers: staging: bcm: Removed a developer debug statement.

Removed a developer debug statement per the TODO list. Additionally,
removed braces for the if-statement to match coding style.

Signed-off-by: Chuong Ngo <cngo.github@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
f70c8a91cd0e743d0531a158d939bbdb6c0874dc 28-Oct-2013 Lisa Nguyen <lisa@xenapiadmin.com> staging: bcm: Replace FALSE with false

Replace user-defined type FALSE with C defined false keyword.

Signed-off-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bad40bb4be4acc40434a5f2dcce9d6f4190a4da5 29-Aug-2013 navin patidar <navinp@cdac.in> staging: bcm: remove Version.h file.

many of the macros defined in Version.h are not being used,
so we can remove the file.

Signed-off-by: navin patidar <navinp@cdac.in>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14704ccf2a6c687324a556106eb4105b04a1660f 29-Apr-2013 Severin Gsponer <svgsponer@gmail.com> Staging: bcm: Fix of a litte white space error in Bcmchar.c

Fixed a wrong placed whitespace. Found with the checkpatch.pl script.
checkpatch.pl error message:
ERROR: "foo * bar" should be "foo *bar"
+static int bcm_char_open(struct inode *inode, struct file * filp)

Signed-off-by: Severin Gsponer <svgsponer@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
075dd9b83da5bc54b53b23f6e315c19b54f2d800 06-Mar-2013 Xi Wang <xi.wang@gmail.com> Staging: bcm: avoid use-after-free in bcm_char_ioctl()

Free pBulkBuffer (pvBuffer) after pBulkBuffer->Register.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cb9cc9cae9ebde1148e48c9682205af8518ec0c9 09-Jan-2013 Dan Carpenter <dan.carpenter@oracle.com> Staging: bcm: copying more data than intended

This was changed to bcm_flash2x_cs_info instead of bcm_flash_cs_info
when we got rid of the typedefs. bcm_flash2x_cs_info is quite a bit
larger than bcm_flash_cs_info (436 bytes instead of 96) so it would
corrupt user memory and it's an info leak.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
a049728928b14cadc6ceb128cedde9f8e5af2b3c 05-Jan-2013 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Change the name of typedef USER_BCM_DBG_STATE to bcm_user_debug_state.

This patch removes typedef for USER_BCM_DBG_STATE, and
changes the name of the struct to bcm_user_debug_state.
In addition, any calls to struct "USER_BCM_DBG_STATE"
are changed to call directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
a23e67f1a26bef151595cd3373d489683cf1fe80 21-Dec-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _LINK_STATE and call directly.

This patch removes typedef for _LINK_STATE, and changes
the name of the struct to bcm_link_state. In addition,
any calls to struct "LINK_STATE, or PLINK_STATE" are
changed to call directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
168b14009a135d669cb68fa9839cf3b796dd6382 01-Dec-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _FLASH_CS_INFO and call directly.

This patch removes typedef for _FLASH_CS_INFO, and
changes the name of the struct to bcm_flash_cs_info.
In addition, any calls to typedefs FLASH_CS_INFO, or
*PFLASH_CS_INFO are changed to call the struct
directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
08391731e08d9e0d48664680e7b174e6f61d00e3 01-Dec-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _FLASH_2X_CS_INFO and call directly.

This patch removes typedef for _FLASH_2X_CS_INFO, and
changes the name of the struct to bcm_flash2x_cs_info.
In addition, any calls to typedefs FLASH2X_CS_INFO, or
*PFLASH2X_CS_INFO are changed to call the struct
directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
954f91d1afbdb1b7e1870df405c824b68fd145ad 26-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _S_MIBS_HOST_STATS_MIBS and call directly.

This patch removes typedef for _S_MIBS_HOST_STATS_MIBS,
and changes the name of the struct to bcm_host_stats_mibs.
In addition, any calls to typedefs S_MIBS_HOST_STATS_MIBS
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
dc23445a118addb0b79e60754e70f99a3cf5177b 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for rdmbuffer and call directly.

This patch removes typedef for rdmbuffer, and
changes the name of the struct to bcm_rdm_buffer.
In addition, any calls to typedefs RDM_BUFFER, or
*PRDM_BUFFER are changed to call the struct
directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
a2521d79715680386f3dbefbc2ffc93fdf08b58a 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for wrmbuffer and call directly.

This patch removes typedef for wrmbuffer, and
changes the name of the struct to bcm_wrm_buffer.
In addition, any calls to typedefs WRM_BUFFER, or
*PWRM_BUFFER are changed to call the struct
directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
86d289d2570bfa469b756e95bf54cb694d12eeb5 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for stGPIOInfo and call directly.

This patch removes typedef for stGPIOInfo, and
changes the name of the struct to bcm_gpio_info.
In addition, any calls to typedefs GPIO_INFO, or
*PGPIO_INFO are changed to call the struct
directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bac02ed8a74f09848f81ffa2d53c36a6256ebbf9 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for ioctlbuffer and call directly.

This patch removes typedef for ioctlbuffer, and
changes the name of the struct to bcm_ioctl_buffer.
In addition, any calls to typedefs IOCTL_BUFFER, or
*PIOCTL_BUFFER are changed to call the struct
directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
d532703c384c0df449c343ca3604f3650dad53b6 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for stUserThreadReq and call directly.

This patch removes typedef for stUserThreadReq,
and changes the name of the struct to bcm_user_thread_req.
In addition, any calls to typedefs USER_THREAD_REQ, or
*PUSER_THREAD_REQ are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ff4e065de10f877af48e997c1ba5f1197ff90f4c 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _FLASH2X_SECTION_VAL and reference directly.

This patch removes typedef for _FLASH2X_SECTION_VAL,
and changes the name of the enum to bcm_flash2x_section_val.
In addition, any calls to typedefs FLASH2X_SECTION_VAL
are changed to reference the enum directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ff31e745cdec6fac43a8bbfc3b978937da75a2a4 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _DEVICE_DRIVER_INFO and call directly.

This patch removes typedef for _DEVICE_DRIVER_INFO,
and changes the name of the struct to
bcm_driver_info. In addition, any calls to
typedefs DEVICE_DRIVER_INFO are changed to call
the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b4a29e104aca0fe7fe946b0111122d4217e3dcbb 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _FLASH2X_READWRITE and call directly.

This patch removes typedef for _FLASH2X_READWRITE,
and changes the name of the struct to
bcm_flash2x_readwrite. In addition, any calls to
typedefs FLASH2X_READWRITE, or *PFLASH2X_READWRITE
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3712af0c0d6889408c17138671814ab315ff53ce 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _NVM_READWRITE and call directly.

This patch removes typedef for _NVM_READWRITE,
and changes the name of the struct to
bcm_nvm_readwrite. In addition, any calls to
typedefs NVM_READWRITE, or *PNVM_READWRITE
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
98e341d3ddb1eec46f7164a7a895149c671d10f5 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for bulkwrmbuffer and call directly.

This patch removes typedef for bulkwrmbuffer,
and changes the name of the struct to
bcm_bulk_wrm_buffer. In addition, any calls to
typedefs BULKWRM_BUFFER, or *PBULKWRM_BUFFER
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b1206c091b2dbe9fb7555eb6bc21694ff11b3579 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _FLASH2X_COPY_SECTION and call directly.

This patch removes typedef for _FLASH2X_COPY_SECTION,
and changes the name of the struct to
bcm_flash2x_copy_section. In addition, any calls to
typedefs FLASH2X_COPY_SECTION, or *PFLASH2X_COPY_SECTION
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
d48a430c2ce42d0a2e214bb6ac93a9e5ab9393c4 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _FLASH2X_BITMAP and call directly.

This patch removes typedef for _FLASH2X_BITMAP,
and changes the name of the struct to
bcm_flash2x_bitmap. In addition, any calls
to typedefs FLASH2X_BITMAP, or *PFLASH2X_BITMAP
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
0395a61d9151b18866210f070681fd6af362f1a5 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _ST_TIME_ELAPSED_ and call directly.

This patch removes typedef for _ST_TIME_ELAPSED_,
and changes the name of the struct to
bcm_time_elapsed. In addition, any calls
to typedefs ST_TIME_ELAPSED, or *PST_TIME_ELAPSED
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
63df64a27a42deb75907b411f0e2f5916febc241 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for stGPIOMultiInfo and call directly.

This patch removes typedef for stGPIOMultiInfo,
and changes the name of the struct to
bcm_gpio_multi_info. In addition, any calls
to typedefs GPIO_MULTI_INFO, or *PGPIO_MULTI_INFO
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9e91edb71d899818ca769aa372372a8ed998357a 22-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for stGPIOMultiMode and call directly.

This patch removes typedef for
stGPIOMultiMode, and changes the name of the
struct to bcm_gpio_multi_mode. In addition,
any calls to typedefs GPIO_MULTI_MODE, or
*PGPIO_MULTI_MODE are changed to call the
struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
d6861cfef2e42fecd5f0d51554493e45df6612a6 02-Nov-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _S_INTERFACE_ADAPTER and call directly.

This patch removes typedef for
_S_INTERFACE_ADAPTER, changes the
name of the struct to bcm_interface_adapter.
In addition, any calls to typedefs
S_INTERFACE_ADAPTER, or *PS_INTERFACE_ADAPTER
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7fac0c47ed1835b6eecf899df6980f0287f4c61c 31-Oct-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for stLocalSFAddIndicationAlt and call directly.

This patch removes typedef for
stLocalSFAddIndicationAlt, changes the
name of the struct to bcm_add_indication_alt,
and removes a comment. In addition, any
calls to typedef stLocalSFAddIndicationAlt
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
dce15efebe76088dc381ab91156842ebf7c79aca 03-Sep-2012 Wei Yongjun <yongjun_wei@trendmicro.com.cn> staging: bcm: fix possible memory leak in bcm_char_ioctl()

psFwInfo has been allocated in this function and should be
freed before leaving from the error handling cases.

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2979460d7aba1dac3452edcacd7b8c4cfcf06067 26-May-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _MINI_ADAPTER and call directly.

This patch removes typedef for _MINI_ADAPTER, changes the
name of the struct from _MINI_ADAPTER to bcm_mini_adapter.
In addition, any calls to the following typedefs
"MINI_ADAPTER, *PMINI_ADAPTER" are changed to call
the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2610c7a889103587ce9a5714291a53dbf5490c3c 26-May-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for link_request and call directly.

This patch removes typedef for link_request, changes the
name of the struct from link_request to bcm_link_request.
In addition, any calls to the following typedefs
"LINK_REQUEST, *PLINK_REQUEST, *CONTROL_MESSAGE"
are changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
0b3edf760a56cf5372d2dafa35b400561ddc0eb0 26-May-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _packet_info and call directly.

This patch removes typedef for _packet_info,
changes the name of the struct from
_packet_info to bcm_packet_info.
In addition, any calls to the following typedefs
"PacketInfo, _packet_info" are changed to call the
struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
774bea8314c3fa59a977e64114286d6e3341b7cc 26-May-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for _PER_TARANG_DATA and call directly.

This patch removes typedef for _PER_TARANG_DATA,
changes the name of the struct from
_PER_TARANG_DATA to bcm_per_tarang_data.
In addition, any calls to the following typedefs
"PER_TARANG_DATA, *PPER_TARANG_DATA" are
changed to call the struct directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7a27a2ccf8a6368f6d7f77cb02f5c5c698015c2e 26-May-2012 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove typedef for FirmwareInfo and call directly.

This patch removes typedef for FirmwareInfo,
changes the name from Firmwareinfo to
bcm_firmware_info. In addition, any calls to
the following typedefs "PFIRMWARE_INFO,
FIRMWARE_INFO" are changed to call the struct
directly.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2d9ebe77b7665a431a9816eff3eb588e05176dfa 22-Jan-2012 Thomas Meyer <thomas@m3y3r.de> Staging: bcm: Use memdup_user rather than duplicating its implementation

This is a little bit restricted to reduce false positives

The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup_user.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b71dbbcfaa2a2965e0797db7333396a71062a341 20-Dec-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Fix an integer overflow in IOCTL_BCM_NVM_READ/WRITE

Variables stNVMReadWrite.uioffset and stNVMReadWrite.uiNumBytes
are chosen from userspace and can be very high. The sum of
these two digits would result in a small number. Therefore,
this patch verifies a negative number was not entered, and
reorganizes the equation to remove the integer overflow.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
221fd753dd002222b595f8af0e289fff0c9cf5a8 17-Dec-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Fix an invalid dereference to a kmalloc in IOCTL_BCM_BULK_WRM

Variable IoBuffer.InputLength is chosen from userspace,
and can therefore be less than the intended size. In this
case,the memory from the kmalloc call is eventually cast
to a PBULKWRM_BUFFER. If the IoBuffer.InputLength does not
meet the minimum size of PBULKWRM_BUFFER, then we will get
a kernel Oops. To resolve this issue, this patch verifies
IoBuffer.InputLength meets the minimum size before invoking
the kmalloc call.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
b72a7c859efc9e0cf13600b30a555457a08dd86f 15-Dec-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Fix information leak in IOCTL_BCM_GET_DRIVER_VERSION

This ioctl, IOCTL_BCM_GET_DRIVER_VERSION, is
responsible for sending the driver version
to userspace. However, the requested size stored
in IoBuffer.OutputLength may be incorrect.
Therefore, we altered the code to send the
exact length of the version, plus one for the
null character.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d3a21c3c4bbab3d51bde0e4828cb8165d04d6399 06-Dec-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Alter return value for copy_to/from_user() to "return -EFAULT" when an error occurs.

In this clean up patch, I altered functions: copy_to/
from_user() to return -EFAULT when an error occurs.
I also replaced break statements when an error occurs
from copy_to/from_user() with direct returns of -EFAULT.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6561f91d68e6f93cba91e64a3b9e0feba8b84fb8 02-Dec-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Alter code to move error handling closer to the calls; and remove white space, IOCTL_BCM_NVM_WRITE.

This is a clean up patch for IOCTL_BCM_NVM_WRITE
that replaces the assignment of the Status
variable with direct returns of the error code,
replaces the break statements with direct returns,
and removes a white space.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
09468b0392b1d2b079b334d60a23d7da8105dc53 02-Dec-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Fix double free of 'pReadData' in IOCTL_BCM_NVM_WRITE.

This patch fixes a memory error in ioctl,
IOCTL_BCM_NVM_WRITE. While copying data to
user space, if an error occurs, pReadData
is freed. Then, at the end of the ioctl,
pReadData was being freed again.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
19a177e6fb097c2a0dd94aeeb2805f0c04a4185f 28-Nov-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Reverse semaphore locking in IOCTL_BCM_BUFFER_DOWNLOAD_STOP.

This patch reorders the semaphore locking.
It makes better sense to first evaluate
fw_download_sema semaphore then
NVMRdmWrmLocl semaphore. The
fw_download_sema is suppose to be
acquired in the START ioctl. If this is
not true, then it does not make sense
to continue.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
8fbebb091a1695b8896597573c2d75831e41929a 28-Nov-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Alter code to move error handling closer to the calls.

This is a cleanup patch. I've shuffled the code around to
move the error handling closer to the calls. I've removed
some indent levels. I've replaced break statements with
direct returns.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fef5675ecbeb0c92d49c8b350e1324164bb348a5 28-Nov-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Clean up patch that calls semaphore down_trylock directly.

This patch evaluates/calls the down_trylock locking
function directly, instead of storing the results
in a variable and evaluating the variable. These
changes were made in:
IOCTL_BCM_BUFFER_DOWNLOAD_STOP and
IOCTL_BCM_BUFFER_DOWNLOAD_START.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d9f26a6689a3e4ae643fca9c2acda3148b717e63 23-Nov-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Fix semaphore locking error when downloading firmware.

This patch releases semaphore locks when
an error occurrs while attempting to
download firmware for the bcm driver.
When downloading firmware for this driver,
a process is expected to call
the following ioctl's in this order:
(1)IOCTL_BCM_BUFFER_DOWNLOAD_START,
(2)IOCTL_BCM_BUFFER_DOWNLOAD, and (3)
IOCTL_BCM_BUFFER_DOWNLOAD_STOP.
Semaphore, “Adapter->fw_download_sema” is
expected to be acquired in the first ioctl,
IOCTL_BCM_BUFFER_DOWNLOAD_START, and it should
block until IOCTL_BCM_BUFFER_DOWNLOAD_STOP
is called. In this case, if an error
occurred before STOP finished, the semaphore
"Adapter->fw_download_sema" was not being released.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
abe33fc0933f9221193fc047fbf93cf9db23c8f6 23-Nov-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Fix semaphore locking bug in, IOCTL_BCM_BUFFER_DOWNLOAD

In this ioctl, we are testing to see if the lock is held.
If it is not held, that means this ioctl used incorrectly.
Therefore, we do not want to take the lock ourselves here.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
77121d52a4de5e06c0b37d7e2fb9f6060904ecca 23-Nov-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Remove unnecessary "do while" statement in, IOCTL_BCM_BUFFER_DOWNLOAD

This patch removes a superfluous "do while"
statement in IOCTL_BCM_BUFFER_DOWNLOAD.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
51935d2259a476162bbf5c35ff81f3a01057ed6f 09-Nov-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Clean up code in ioctl: IOCTL_BCM_EEPROM_REGISTER_READ

This patch verifies two conditions before executing
a kmalloc call. First, it checks to see that
IoBuffer.OutputLength is not greater than an
unsigned short. If so, an invalid value may be
returned. The second change is a check to make
sure IoBuffer.OutputLength is not equal to
zero. Which simply keeps this code inline with
the other ioctl, IOCTL_BCM_REGISTER_READ_PRIVATE.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
41c7b7c0fa2f68afb1154e88597ff6b9b97334cf 06-Nov-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Fix information leak in ioctl: IOCTL_BCM_REGISTER_READ_PRIVATE, IOCTL_BCM_EEPROM_REGISTER_READ

This patch fixes an information leak in ioctl
IOCTL_BCM_REGISTER_READ_PRIVATE and
IOCTL_BCM_EEPROM_REGISTER_READ when determining
the number of bytes to copy to user space. Function,
usb_control_msg, returns the correct number of
bytes from the hardware. Instead of using
this value, we were using a value derived from
user space. In this case, this value could be more
than the hardware allocated. Therefore, this
patch copies the proper number of bytes from
the hardware, and uses this value as the maximum
number of bytes for user space.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2505aa6ce42a686b2d3db95ccdcc7bc100e7b8c0 28-Sep-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Alter LOC for readability/understandability purposes

This patch alters a line of code to make it more readable
and easier to understand. The purpose of the original line
of code was to compute the amount of memory to request from
kmalloc. This mulit-step algorithm was being done in one
line of code, thus making it more difficult to understand.
Therefore, I split this algorithm into three logical steps.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
0a2cc4977ffd551b58ae20c646bd7083ba5a89d2 27-Sep-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Add min/max restrictions for IOCTL_BCM_REGISTER_READ_PRIVATE

This patch fixes two issues within bcm/Bcmchar.c. The
first condition in the or statement checks if variable
IoBuffer.OutputLength, defined from user space, is
greater than the maximum value allowed for an
unsigned short. IoBuffer.OutputLength is then used
in a kmalloc call to return a pointer to memory. If
this size is greater than an unsigned short, it
becomes useless. The second condition in the or statement
checks if the same variable, IoBuffer.OutputLength is
equal to zero before invoking the kmalloc call. In
this case, if a zero size is sent to kmalloc, a valid
pointer to memory is returned instead of the expected NULL.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
e228b7426e65df0f2e93c783c2c89baabe318b9b 19-Sep-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Add size maximum size restrictions for IOCTL_IDLE_REQ

In the first alteration, the MAX_CNTL_PKT_SIZE is the
maximum size of the control packet in ->Adapter->txctlpacket[]
which is defined in InitAdapter(). This caps the size of
kmalloc memory allocation. In the second change, this max
cap fixes a potential memory corruption bug when subsequent
memset and memcpy calls are invoked.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
5ac5bd8754b3dabcf4aea7b5f4a28a1d8494a1b0 19-Sep-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Add size minimum size restrictions for IOCTL_IDLE_REQ

If IoBuffer.InputLength is zero then this will cause an Oops when
we dereference the ZERO_SIZE_PTR. Or if it's smaller than
sizeof(struct link_request) then we would get memory corruption
when we set ->PLength in CopyBufferToControlPacket().

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1dc634772b0daead0e841b9034e88b6c76a05709 16-Aug-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Fix memory leak reported during compile.

This patch fixes a potential memory leak were temp_buff buffer
is not being freed when a certain condition is true.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fbfcdf254d7be71b25bfc053e9d22ef8ff061750 16-Aug-2011 Kevin McKinney <klmckinney1@gmail.com> Staging: bcm: Fix a coding style error reported by checkpatch.pl

Tool checkpatch.pl reported the following error: extern struct class *bcm_class;"
declaration not allowed in .c files. Therefore, I move this declaration into
the header "headers.h" file.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6c15e002f97db64d23552099c908a066a8219baa 16-Aug-2011 Kevin McKinney <klmckinney1@gmail.com> staging: bcm: fix coding style warnings and errors reported by checkpatch.pl tool

Staging: bcm: Fix coding style errors reported by checkpatch.pl

Fix multiple warnings and errors reported by checkpatch.pl

Signed-off-by: Kevin McKinney<klmckinney1@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
f4a0e6b1354cd0bec6aca405883cc45662511f03 09-Mar-2011 Alexander Beregalov <a.beregalov@gmail.com> staging: bcm: optimize kmalloc to kzalloc

Use kzalloc rather than kmalloc followed by memset with 0.
Found by coccinelle.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
78acd58746b513c062b3dafd5b563401bc9e9d47 12-Feb-2011 Javier Martinez Canillas <martinez.javier@gmail.com> Staging: bcm: Bcmchar: Fix some checkpatch errors

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7227ba06479f981f5cf9977a7eeb3a20d30dc501 12-Feb-2011 Javier Martinez Canillas <martinez.javier@gmail.com> Staging: bcm: Bcmchar: Fix style issues on bcm_char_read()

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
a7d3976edc32e6041f9d68c79ba64a17d5ec5095 12-Feb-2011 Javier Martinez Canillas <martinez.javier@gmail.com> Staging: bcm: Bcmchar: Fix style issues on bcm_char_release()

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1e1233234edeacabbcaab9d086474224ba5af015 12-Feb-2011 Javier Martinez Canillas <martinez.javier@gmail.com> Staging: bcm: Bcmchar: Fix style issues on bcm_char_open()

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
00719fab9f6eb90b9e427d1096ad540d51878661 25-Jan-2011 Javier Martinez Canillas <martinez.javier@gmail.com> Staging: bcm: Check correct user provided length and fix error code returned

bcm driver copies a buffer length provided by userpace without checking it.

RxCntrlMsgBitMask is of type unsigned long so only makes sense to copy
sizeof(unsigned long) bytes.

Also, copy_from_user() returns the number of bytes that could not be copied.
The driver is returning that value as error code instead of -EFAULT.

This patch solves both issues.

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
eccbf04a904fc99c54ab37c29a2a4dedcec66e33 21-Oct-2010 Dan Carpenter <error27@gmail.com> Staging: bcm: use get_user() to access user pointers

This fixes some places that dereference user pointers directly instead
of using get_user().

Please especially check my changes to IOCTL_BCM_GET_CURRENT_STATUS. The
original code modified the struct which "arg" was pointing to. I think
this was a bug in the original code and that we only wanted to write to
the OutputBuffer. Also with the original code you could read as much
memory as you wanted so I had to put a cap on OutputLength. The only
value of OutputLength that makes sense is sizeof(LINK_STATE) so now if
OutputLength is not sizeof(LINK_STATE) it returns -EINVAL.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
9c5d77009db6ff09d02a7b0a99a70c0dfd3af6c6 01-Nov-2010 Stephen Hemminger <stephen.hemminger@vyatta.com> beceem: don't overrun user buffer on read

Serious bug in original code, if app reads 10 bytes but 20 byte msg
received memory would get overwritten.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
9e0a3169a34ba5fd04bde058a63fa0a36f2d7ed3 01-Nov-2010 Stephen Hemminger <stephen.hemminger@vyatta.com> beceem: create class on module installation

First step to supporting multiple devices, create device class
when module is initialized.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
ada692b09f4707a8e06b087b1546d9f5b3f2d37d 01-Nov-2010 Stephen Hemminger <stephen.hemminger@vyatta.com> beceem: fix character device ioctl

Sparse caught several places where ioctl interface was incorrectly using user
memory. Fix all the ioctl cases for casting and __user annotation.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
3644c1a2f12b15e1c8bfb9ebfaacbd177011a72d 01-Nov-2010 Stephen Hemminger <stephen.hemminger@vyatta.com> beceem: remove dead code

Remove commented out with '#if 0'

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
6ba8fe77ddd3a25daa8409333295b90c26a43bae 01-Nov-2010 Stephen Hemminger <stephen.hemminger@vyatta.com> beceem: print better message on bad ioctl

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
082e889b475c46e71be6e779f15ab095f888e03f 01-Nov-2010 Stephen Hemminger <stephen.hemminger@vyatta.com> beceem: remove OS wrapper library

Use native kernel functions for kmalloc/kfree directly

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
91d29ee1a82fedcd7d1bbf24007b31a49c47e90a 29-Oct-2010 Stephen Hemminger <stephen.hemminger@vyatta.com> beceem: remove ifdef's

There were a lot of ifdef's for driver options which have no
configuration options. Choose the current value and remove the
ifdef.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
bf58bd66f6212d838dda4384b8cd21337b47e363 08-Oct-2010 Dan Carpenter <error27@gmail.com> Staging: bcm: return -EFAULT on copy_to_user() failures

There were a number of places in the bcm_char_ioctl() which returned the
number of bytes remaining to be copied instead of returning -EFAULT.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
44a17eff844d92421c8b568c84df29735e1e45f9 30-Sep-2010 Arnd Bergmann <arnd@arndb.de> staging/bcm: add sparse annotations

This marks up the code where sparse complains in most cases.
Most of the changes are in the ioctl handling code, which
gets __user annotations, finding one unchecked user access.

The rest is mostly about marking functions static when they
are only used in one file.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
9f1c75ac2dba752ad3734bd3ffab805a6a3fbeda 30-Sep-2010 Arnd Bergmann <arnd@arndb.de> staging/bcm: fix most build warnings

This removes all warnings I get on a 64 bit build except
for those that look unfixable, where we convert a pointer
to a 32 bit integer and change its byte order!

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
d16044cf8ce0ff6384cd80eb0abaa2ba57b19a5e 30-Sep-2010 Arnd Bergmann <arnd@arndb.de> staging: make new character devices nonseekable

As a preparation for changing the default behaviour of llseek to no_llseek,
every file_operations structure should have a .llseek operation.

There are three new instances in staging now, which can all be changed
into no_llseek explicitly since the devices do not need to seek.

Add nonseekable_open where appropriate, to prevent pread/pwrite as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
3e8acee461f3bdcec0a0a5cbf2886710a21a6662 15-Sep-2010 Randy Dunlap <randy.dunlap@oracle.com> staging/bcm: fix printk format warnings

Fix lots of printk format warnings in bcm. Here is a sample of them:

drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int'
drivers/staging/bcm/CmHost.c:1955: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 4 has type 'long int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 3 has type 'long int'
drivers/staging/bcm/LeakyBucket.c:85: warning: format '%d' expects type 'int', but argument 4 has type 'long int'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
f8942e07a3db9d82e8fb11d3d494876b8bae9ff9 08-Sep-2010 Stephen Hemminger <stephen.hemminger@vyatta.com> staging: Beeceem USB Wimax driver

The Sprint 4G network uses a Wimax dongle with Beecem
chipset. The driver is typical of out of tree drivers, but
maybe useful for people, and the hardware is readily available.

Here is a staging ready version (i.e warts and all)

0. Started with Rel_5.2.7.3P1_USB from Sprint4GDeveloperPack-1.1
1. Consolidated files in staging
2. Remove Dos cr/lf
3. Remove unnecessary ioctl from usbbcm_fops

Applied patches that were in the developer pack, surprising
there were ones for 2.6.35 already.

This is compile tested only, see TODO for what still needs
to be done.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>