It looks like lustre_generic_file_{read,write} are a holdover from
2.6.19 where generic_file_aio_read() replaced generic_file_readv()
and cross-kernel interoperability was required for some period of
time. Lustre has since removed support for those older kernels, but
it looks like the wrappers were not deleted at that time. This patch
will delete them.
Pass &iocb->ki_pos as the last argument for these functions instead
of crw_pos, since this is the convention for other callers. Verify
that this is the same as the current crw_pos argument. This code can
likely be cleaned up further in a later patch.
Merge tag 'iio-for-3.15a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
First set of new drivers and cleanups for IIO in the 3.15 cycle.
New drivers:
* si7005 relative humidity and temperature sensor
* Lite-on ltr501 ambient light and proximity sensor
Cleanups
* Clean up some dead comments in max1363
* Drop some obsolete variables in adjd_s311 and tcs3472 left over from
the introduction of iio_push_to_buffers_with_timestamp.
* Drop some unneeded linux/init.h includes
* Squish a sparse warning in mpl3115 by correctly specifying a be32 variable.
* A number of cleanups and fixes for sca3000
* Drop an unneed checks in mxs-lradc, ad7303 and adis16400.
* Drop a platform_set_drvdata in viperboard after the only use of it was
removed during a devm conversion.
* Add a missing device name for ak8975 to comply with the ABI.
* Put mpu6050 into the IMU menu as it slipped out into the main menu.
* Fix a typo and some comment formatting in mpu6050.
* Document at91 ADC clock properties.
Larry Finger [Sun, 9 Feb 2014 21:15:57 +0000 (15:15 -0600)]
staging: r8188eu: Replace misspelled local container macro
This driver has its own implementation of a "container_of" macro. It
is replaced with the standard container_of version. Most of these
are a straight one-to-one replacement; however, a few of the instances
referred to the member of a union. Those were replaced with the
struct that is part of that union.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Sun, 9 Feb 2014 21:15:56 +0000 (15:15 -0600)]
staging: r8188eu: Remove some dead code from headers
The headers for this driver contain a number of unused structs and macros
that are removed. File include/ioctl_cfg80211.h is now empty and was
deleted.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
SeongJae Park [Sat, 8 Feb 2014 02:59:40 +0000 (11:59 +0900)]
staging: android: binder: use whitespace consistently
Whitespace between #define keyword and BINDER_* constants are space in
some point and tab in some point. Using space or tab is just writer's
choice. But, let's use them more consistently.
Signed-off-by: SeongJae Park <sj38.park@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chase Southwood [Sat, 8 Feb 2014 05:02:27 +0000 (23:02 -0600)]
Staging: comedi: fix memory leak in comedi_bond.c
We allocate bdev and then krealloc the devs pointer in order to add bdev
at the end of the devpriv->devs array list. But if for some reason this
krealloc fails, we need to free bdev before returning an error otherwise
this memory is leaked.
Paul Bolle [Tue, 11 Feb 2014 12:31:32 +0000 (13:31 +0100)]
staging: r8188eu: default to "y" in Kconfig
Two Kconfig entries for this driver default to (uppercase) "Y". But in
Kconfig (lowercase) "y" is a magic symbol. "Y" is an ordinary symbol.
As "Y" is never set these Kconfig symbols will also not be set by
default.
So use "default y" here, as was clearly intended.
Reported-by: Martin Walch <walch.martin@web.de> Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Surendra Patil [Sun, 9 Feb 2014 07:30:27 +0000 (23:30 -0800)]
drivers:staging:rtl8821ae: Fixed few coding style erors and warnings
Fixed multiple coding style errors and warnings
wifi.h:1077: WARNING: please, no space before tabs
wifi.h:762: WARNING: missing space after struct definition
wifi.h:972: WARNING: please, no spaces at the start of a line
wifi.h:1825: WARNING: Unnecessary space after function pointer name
wifi.h:1826: ERROR: "foo * bar" should be "foo *bar"
wifi.h:1099: WARNING: missing space after return type
wifi.h:1320: ERROR: Macros with complex values should be enclosed in parenthesis
wifi.h:1758: WARNING: Multiple spaces after return type
wifi.h:1855: ERROR: code indent should use tabs where possible
wifi.h:2303: ERROR: space prohibited after that open parenthesis '('
wifi.h:2408: ERROR: spaces required around that '=' (ctx:VxV)
In kernel 3.11 O_TMPFILE was introduced, but the open flag value
conflicts with the O_LOV_DELAY_CREATE flag 020000000 previously used
by Lustre-aware applications. O_LOV_DELAY_CREATE allows applications
to defer file layout and object creation from open time (the default)
until it can instead be specified by the application using an ioctl.
Instead of trying to find a non-conflicting O_LOV_DELAY_CREATE flag
or define a Lustre-specific flag that isn't of use to most/any other
filesystems, use (O_NOCTTY|FASYNC) as the new value. These flags
are not meaningful for newly-created regular files and should be
OK since O_LOV_DELAY_CREATE is only meaningful for new files.
I looked into using O_ACCMODE/FMODE_WRITE_IOCTL, which allows calling
ioctl() on the minimally-opened fd and is close to what is needed,
but that doesn't allow specifying the actual read or write mode for
the file, and fcntl(F_SETFL) doesn't allow O_RDONLY/O_WRONLY/O_RDWR
to be set after the file is opened.
Lustre-change: http://review.whamcloud.com/8312
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4209 Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Cc: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch separates ACL and XATTR caches, so that
when updating an ACL only LOOKUP lock is needed and
when updating another XATTR only XATTR lock is needed.
This patch also reverts XATTR cache support for setxattr
because client performing REINT under even PR lock
will deadlock if an active server operation (like unlink)
attempts to cancel all locks, and setxattr has to wait
for it (MDC max-in-flight is 1).
This patch disables the r/o cache if the data is
unreasonably large (larger than maximum single EA
size).
Signed-off-by: Andrew Perepechko <andrew_perepechko@xyratex.com> Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-on: http://review.whamcloud.com/7208
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3669 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Swapnil Pimpale [Sun, 9 Feb 2014 07:51:46 +0000 (02:51 -0500)]
lustre: Unsafe error handling around ll_splice_alias
Callers of ll_splice_alias() should not assign the returned pointer to
the dentry since it can be an err pointer. Fixed the above bug using a
temporary dentry pointer. This temporary pointer is assigned to dentry
only if ll_splice_alias has not returned an err pointer.
Signed-off-by: Swapnil Pimpale <spimpale@ddn.com>
Reviewed-on: http://review.whamcloud.com/7460
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3807 Reviewed-by: Fan Yong <fan.yong@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bobi Jam [Sun, 9 Feb 2014 07:51:45 +0000 (02:51 -0500)]
lustre/lov: avoid subobj's coh_parent race
* during a file lov object initialization, we need protect the access
and change of its subobj->coh_parent, since it could be another
layout change race there, which makes an unreferenced lovsub obj in
the site object hash table.
* dump lovsub objects in the site if the lovsub device reference > 0
during its finalization phase.
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Reviewed-on: http://review.whamcloud.com/6105
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1480 Reviewed-by: Lai Siyao <lai.siyao@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is to pull in the lustre fixes so that others can continue to work
on updating the lustre codebase, as well as resolve some merge issues
with the ion and ocproto drivers to keep linux-next happy.
Merge tag 'iio-fixes-for-3.14b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes:
Second round of IIO fixes for the 3.14 cycle.
Another mixed bag, including some that were not in round 1 because
they applied to elements that went in during the merge window whereas
round 1 predated that. I have been effectively out of action for 3 weeks
so will take a little while to catch up with my backlog.
* mag3110 - report busy in read_raw / write_raw when buffered capture
is underway to avoid either changing the characteristics of the capture or
causing capture issues by reading data destined for the buffer.
* mag3110 - fix a failure to specify leading zeros when formatting a decimal
number.
* lradc - fix a buffer overflow and incorrect reporting of scale for voltage
channel 15
* lradc - drop some scale_available attributes for elements that don't actually
exist. These could otherwise cause some interesting issues for userspace.
* ad799x - a typo in the events information mask resulted in some nasty crashes
on failed probes.
* ak8975 - fix scale attribute output to avoid incorrect intepretation of
readings in userspace.
* adis16400 - make sure the timestamp is the last element in all channel_spec
arrays as this assumption is made by the buffer filling code, but was not
true previously.
* bma180 - correctly use modifiers to distinguish the channels rather than
indexes. This brings the abi inline with the standard option for 3 axis
accelerometers.
* max1363 - use devm_regulator_get_optional instead of the non optional case
to allow the device to successfully probe when a regulator is not specified.
Guenter Roeck [Mon, 27 Jan 2014 18:10:00 +0000 (18:10 +0000)]
iio: max1363: Use devm_regulator_get_optional for optional regulator
In kernel version 3.13, devm_regulator_get() may return no error
if a regulator is undeclared. regulator_get_voltage() will return
-EINVAL if this happens. This causes the driver to fail loading if
the vref regulator is not declared.
Since vref is optional, call devm_regulator_get_optional instead.
Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Beomho Seo [Wed, 2 Apr 2014 08:15:00 +0000 (09:15 +0100)]
iio: ak8975: Fix calculation formula for convert micro tesla to gauss unit
This effects the reported scale of the raw values, and thus userspace
applications that use this value.
One micro tesla equal 0.01 gauss. So I have fixed calculation formula And add RAW_TO_GAUSS macro.
ASA is in the range of 0 to 255. If multiply 0.003, calculation result(in_magn_[*]_scale) is
always 0. So multiply 3000 and return and IIO_VAL_INT_PLUS_MICRO.
As a result, read_raw call back function return accurate scale value.
Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
in_voltage8_scale_available and in_voltage9_scale_available are exposed to
userspace but useless as in_voltage8_raw and in_voltage9_raw are not available.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Dan Carpenter [Mon, 3 Feb 2014 22:38:35 +0000 (01:38 +0300)]
staging: r8188eu: overflow in rtw_p2p_get_go_device_address()
The go_devadd_str[] array is two characters too small to hold the
address so we corrupt memory.
I've changed the user space API slightly and I don't have a way to test
if this breaks anything. In the original code we truncated away the
last digit of the address and the NUL terminator so it was already a bit
broken.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Mon, 3 Feb 2014 04:23:06 +0000 (22:23 -0600)]
staging: r8188eu: Fix typo in USB_DEVICE list
There is a typo in the device list that interchanges the vendor and
product codes for one of the entries. This exchange was determined
by noticing that the vendor code is 0x07b8 for Abocom at
http://www.linux-usb.org/usb.ids.
There are a couple of dereferences such as `*(uint32_t
*)(devpriv->insn_buf + 1)` that are unaligned as `devpriv->insn_buf` is
of type `uint8_t *`. This works on x86 architecture but may not be
supported on other architectures. Call `get_unalign()` to perform the
unaligned dereferences.
Ian Abbott [Tue, 21 Jan 2014 17:06:34 +0000 (17:06 +0000)]
staging: comedi: fix too early cleanup in comedi_auto_config()
`comedi_auto_config()` is usually called from the probe routine of a
low-level comedi driver to allocate and auto-configure a comedi device.
Part of this involves calling the low-level driver's `auto_attach()`
handler, and if that is successful, `comedi_device_postconfig()` tries
to complete the configuration of the comedi device. If either of those
fail, `comedi_device_detach()` is called to clean up, and
`comedi_release_hardware_device()` is called to remove the dynamically
allocated comedi device.
Unfortunately, `comedi_device_detach()` clears the `hw_dev` member of
the `struct comedi_device` (indirectly via `comedi_clear_hw_dev()`), and
that stops `comedi_release_hardware_device()` finding the comedi device
associated with the hardware device, so the comedi device won't be
removed properly.
Since `comedi_release_hardware_device()` also calls
`comedi_device_detach()` (assuming it finds the comedi device associated
with the hardware device), the fix is to remove the direct call to
`comedi_device_detach()` from `comedi_auto_config()` and let the call to
`comedi_release_hardware_device()` take care of it.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Salym Senyonga [Sat, 25 Jan 2014 09:54:41 +0000 (12:54 +0300)]
Staging: ozwpan: Change kmalloc() to kzalloc()
changing to kzalloc lets us get rid of some lines. The other concern
here is that some members of binding->ptype are still uninitialized at
the end of the function.
Signed-off-by: Salym Senyonga <salymsash@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shuah Khan [Fri, 24 Jan 2014 18:34:13 +0000 (11:34 -0700)]
staging/usbip: userspace to use linux header for usb_device_speed enum, missing speeds to speed_strings array
Remove usb_device_speed enum define from usbip_common.h and change it to
include linux/usb/ch9.h instead. Add speed strings for usb wireless and 3.0
to speed_strings array.
Valentina Manea [Thu, 23 Jan 2014 21:12:29 +0000 (23:12 +0200)]
staging: usbip: convert usbip-host driver to usb_device_driver
This driver was previously an interface driver. Since USB/IP
exports a whole device, not just an interface, it would make
sense to be a device driver.
This patch also modifies the way userspace sees and uses a
shared device:
* the usbip_status file is no longer created for interface 0, but for
the whole device (such as
/sys/devices/pci0000:00/0000:00:01.2/usb1/1-1/usbip_status).
* per interface information, such as interface class or protocol, is
no longer sent/received; only device specific information is
transmitted.
* since the driver was moved one level below in the USB architecture,
there is no need to bind/unbind each interface, just the device as a
whole.
Shuah Khan [Wed, 22 Jan 2014 21:24:29 +0000 (14:24 -0700)]
staging/usbip: Change vhci_hcd store_attach() device information message to include speed string
Change vhci_hcd store_attach() routine to include speed string in its device
information message. The current call to dev_info() prints out speed number
which is the enum number. Change to call usb_speed_string() to print speed
string in addition to the number.
When vhci_hcd is enabled, the following message floods the dmesg buffer.
This message doesn't provide any useful information other than cluttering
the dmesg buffer. Fix it by removing the message. There is another debug
message in this routine that dumps detailed port status change information.
staging: comedi: amplc_pci230: standardize error handling of subdev_8255_init()
The subdev_8255_init() call returns 0 for success of a negative errno for failure.
For aesthetics, change the error test in this driver from (rc < 0) to simply (rc)
to follow the style of the other users of this function.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: amplc_pc236: remove dev_err() message due to allocation failure
The subdev_8255_init() call can only fail due to the allocation of the private
data. This failure will alreay have produced an error message. Remove the
redundant dev_err().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: drivers: propogate errno from subdev_8255_init()
The initialization of the 8255 subdevice can fail due to the allocation
of the private data. Make sure all callers of subdev_8255_init() propogate
the errno.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Zhao, Gang [Wed, 5 Feb 2014 16:10:35 +0000 (00:10 +0800)]
staging: et131x: remove spinlock adapter->lock
adapter->lock is only used in et131x_multicast(), which is eventually
called by network stack function __dev_set_rx_mode(). __dev_set_rx_mode()
is always called by (net_device *)dev->addr_list_lock hold, to protect from
concurrent access. So adapter->lock is redundant.
Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Acked-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio Estevam [Thu, 6 Feb 2014 12:12:03 +0000 (10:12 -0200)]
imx-drm: imx-hdmi: Remove parentheses from returns
Fix the following checkpatch warnings:
ERROR: return is not a function, parentheses are not required
#462: FILE: drivers/staging/imx-drm/imx-hdmi.c:462:
+ return (hdmi->hdmi_data.enc_in_format !=
ERROR: return is not a function, parentheses are not required
#468: FILE: drivers/staging/imx-drm/imx-hdmi.c:468:
+ return ((hdmi->hdmi_data.enc_out_format == YCBCR422_8BITS) &&
ERROR: return is not a function, parentheses are not required
#475: FILE: drivers/staging/imx-drm/imx-hdmi.c:475:
+ return ((hdmi->hdmi_data.enc_in_format == YCBCR422_8BITS) &&
While at it, broke the return code from is_color_space_decimation() and
is_color_space_interpolation() for better readability
Dave Hansen [Mon, 3 Feb 2014 22:40:25 +0000 (14:40 -0800)]
staging: rtl8192u: remove unused files
I was doing some code audits looking at scattergather uses, and noticed
that update() in drivers/staging/rtl8192u/ieee80211/digest.c uses
sg.page which doesn't exist any longer, so this can't possibly compile.
Turns out that digest.c is actually unused. It doesn't get referenced
in a Makefile or get compiled and doesn't get used as far as I can see.
I then widened the search to all the files in the directory. There are
a *bunch* that look unused. I removed all of them, then added them
back one at a time until the driver compiled again.
Signed-off-by: Dave Hansen <dave.hansen@intel.com> Cc: jerry-chuang@realtek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Tue, 28 Jan 2014 14:00:52 +0000 (17:00 +0300)]
staging: rtl8821ae: a couple macro expansion bugs
These macros need parentheses, otherwise it causes a macro expansion bug
when they are used like this:
ch->flags &= ~IEEE80211_CHAN_NO_IBSS;
This was found using Smatch:
drivers/staging/rtl8821ae/regd.c:200 _rtl_reg_apply_beaconing_flags()
warn: the 'IEEE80211_CHAN_NO_IBSS' macro might need parens
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rashika Kheria [Thu, 23 Jan 2014 22:44:00 +0000 (04:14 +0530)]
drivers: staging: Mark functions as static and remove unused function in bpctl_mod.c
Mark functions as static in bpctl_mod.c because they are not used
outside this file. Remove unused function from bpctl_mod.c.
This also eliminates the following warnings from bpctl_mod.c:
drivers/staging/silicom/bpctl_mod.c:1507:6: warning: no previous prototype for ‘send_bypass_clear_pulse’ [-Wmissing-prototypes]
drivers/staging/silicom/bpctl_mod.c:1762:5: warning: no previous prototype for ‘cmnd_on’ [-Wmissing-prototypes]
drivers/staging/silicom/bpctl_mod.c:1779:5: warning: no previous prototype for ‘cmnd_off’ [-Wmissing-prototypes]
Dan Carpenter [Thu, 23 Jan 2014 08:24:27 +0000 (11:24 +0300)]
staging: cxt1e1: cleanup mfg_template[] a bit
1) Make it static.
2) Change it to u8 data instead of short.
3) This means we can memcpy() it to the correct location instead of
using a for loop.
4) With memcpy() we can use the union member we want directly instead of
copying to the generic .bytes union member.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dave Jones pointed out that commit 302433daf47aeb7d21d66e55fb84d6a8fffd4aed (staging: vt6656: device.h
Remove typedef enum __device_init_type.), improperly indented a line to
make it look like it was under the if line above it, but it wasn't.
So fix this up.
Reported-by: Dave Jones <davej@redhat.com> Cc: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This driver downloads Xilinx FPGA firmware using gpio pins.
It loads Xilinx FPGA bitstream format firmware image and
program the Xilinx FPGA using SelectMAP (parallel) mode.
Signed-off-by: Insop Song <insop.song@gainspeed.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lidza Louina [Fri, 17 Jan 2014 16:01:37 +0000 (11:01 -0500)]
staging: dgap: removes version.h dependency
This patch removes the version.h dependencies to the
driver.h, fep5.c and tty.c files. This header was used
to help the driver support different versions of the
kernel. The support for different versions was removed
in a previous patch.