Documentation sysfs-bus-usb: Document which files are used by libusb

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgnc: adds TODO

This patchs adds a TODO for the driver.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgap: Add missing #include <linux/slab.h>

drivers/staging/dgap/dgap_driver.c: In function ‘dgap_cleanup_module’:
drivers/staging/dgap/dgap_driver.c:423: error: implicit declaration of function ‘kfree’
drivers/staging/dgap/dgap_driver.c: In function ‘dgap_driver_kzmalloc’:
drivers/staging/dgap/dgap_driver.c:940: error: implicit declaration of function ‘kmalloc’
drivers/staging/dgap/dgap_driver.c:940: warning: initialization makes pointer from integer without a cast

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
perf trace: Handle missing HUGEPAGE defines

Needed for compile on Fedora 12 which goes back to the 2.6.32 kernel.
Might be needed for RHEL6. I use F12 to compile static binaries for
Wind River Linux 4.3.

Signed-off-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/n/tip-nd0d7rbajgm8k6tah3xv34v1@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
staging: r8188eu: Fix compiler warnings in os_dep/ioctl_linux.c

The 0-DAY kernel build testing backend reports the following compiler
warnings not shown on my compiler version/options:

   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_mp_efuse_get':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:5836:65: warning: iteration 16u invokes undefined behavior [-Waggressive-loop-optimizations]
        sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeEfuseInitMap[i+j]);
                                                                    ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:5830:3: note: containing loop
      for (i = 0; i < EFUSE_MAP_SIZE; i += 16) {
      ^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:6042:69: warning: iteration 16u invokes undefined behavior [-Waggressive-loop-optimizations]
        sprintf(extra, "%s %02X", extra, pEfuseHal->fakeEfuseModifiedMap[i+j]);
                                                                        ^
   drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:6036:3: note: containing loop
      for (i = 0; i < EFUSE_MAP_SIZE; i += 16) {
      ^

The problem is due to improper settings for some of the EFUSE_XXX defines such that
EFUSE_MAP_SIZE was larger than the sizes of the marked arrays. Thanks to
Fengguang Wu for helping me understand the root cause.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: crystalhd: Resolve sparse 'different base types' warnings.

The result from crystalhd_get_sgle_paddr and crystalhd_get_sgle_len are later
used in calculations, so the result should be in CPU byte ordering.

Signed-off-by: Shaun Laing <shaun@xresource.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: r8188eu: off by one bugs

These should be "<" instead of "<=".  Also we can use the ARRAY_SIZE()
macro.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: rtl8188eu: || vs && typo

Obviously it's impossible for ->KeyLength to be both 5 and 13.  I assume
that && was intended here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: r8188eu: copying one byte too much

There is a copy and paste bug here so we copy 4 bytes instead of 3.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: rtl8188eu: off by one in rtw_set_802_11_add_wep()

"keyid" is used as an offset into the ->dot11DefKey[] array.  The array
has 4 elements.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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>
Staging:BCM:DDRInit.c:Renaming __FUNCTION__

__Function__ gets renamed with __func__

Signed-Off-By: Paul McQuade <paulmcquad@gmail.com>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pkt_sched: fq: prefetch() fix

kbuild bot reported following m68k build error :

  net/sched/sch_fq.c: In function 'fq_dequeue':
>> net/sched/sch_fq.c:491:2: error: implicit declaration of function
'prefetch' [-Werror=implicit-function-declaration]
   cc1: some warnings being treated as errors

While we are fixing this, move this prefetch() call a bit earlier.

Reported-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
ehci: remove ehci_vdbg() verbose debugging statements

This patch removes ehci_vdbg debugging statements from EHCI host controller
driver because they produce too much information, lowering the signal to noise
ratio when debugging, and because they are not used anymore.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ehci: enable debugging code when CONFIG_DYNAMIC_DEBUG is set

The debugging code for ehci is enabled to run if the DEBUG flag is defined.
This patch enables the debugging code also when the kernel is configured
with dynamic debugging on.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ehci: remove duplicate debug_async_open() prototype in ehci-dbg.c

This patch removes the duplicate of debug_async_open() prototype following
three lines below the debug_async_open() declaration.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ehci: remove debugging statement with ehci statistics in ehci_stop()

This patch removes the ehci statictics information output in ehci_stop()
because they do not provide interesting info. At any case, the current
statistics can be viewed by reading the 'registers' file in debugfs.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
usbcore: compare and release one bos descriptor in usb_reset_and_verify_device()

In usb_reset_and_verify_device(), hub_port_init() allocates a new bos
descriptor to hold the value read by the device. The new bos descriptor
has to be compared with the old one in order to figure out if device 's
firmware has changed in which case the device has to be reenumerated.
In the original code, none of the two descriptors was deallocated leading
to memory leaks.

This patch compares the old bos descriptor with the new one to detect change
in firmware and releases the newly allocated bos descriptor to prevent memory
leak.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reported-by: Martin MOKREJS <mmokrejs@gmail.com>
Tested-by: Martin MOKREJS <mmokrejs@gmail.com>
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
firmware loader: fix pending_fw_head list corruption

Got the following oops just before reboot:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
[<8028d300>] (__list_del_entry+0x44/0xac)
[<802e3320>] (__fw_load_abort.part.13+0x1c/0x50)
[<802e337c>] (fw_shutdown_notify+0x28/0x50)
[<80034f80>] (notifier_call_chain.isra.1+0x5c/0x9c)
[<800350ec>] (__blocking_notifier_call_chain+0x44/0x58)
[<80035114>] (blocking_notifier_call_chain+0x14/0x18)
[<80035d64>] (kernel_restart_prepare+0x14/0x38)
[<80035d94>] (kernel_restart+0xc/0x50)

The following race condition triggers here:

  _request_firmware_load()
  device_create_file(...)
  kobject_uevent(...)
  (schedule)
                                       (resume)
                                       firmware_loading_store(1)
                                       firmware_loading_store(0)
                                       list_del_init(&buf->pending_list)
                                       (schedule)
  (resume)
  list_add(&buf->pending_list, &pending_fw_head);
  wait_for_completion(&buf->completion);

causing an oops later when walking pending_list after the firmware has
been released.

The proposed fix is to move the list_add() before sysfs attribute
creation.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Acked-by: Ming Lei <ming.lei@canonical.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Drivers: hv: vmbus: Do not attempt to negoatiate a new version prematurely

The current code would attempt to negotiate a different protocol version if
the current negotiation timed out. This triggers an assert in the host (on debug
builds). Avoid this by negotiating a newer version only if the host properly
rejects the current version being negotiated.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>