Previously a 6 byte array (buf) was erroneously cast to a 8 byte long
(event_bits) on 64-bit architectures which caused a stack corruption.
Signed-off-by: Bart Westgeest <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Check for MODULE is not needed. In a static compilation the parameters
definition is valid and module_exit() does nothing.
Signed-off-by: Miguel Gómez <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The source code defines a macro NULLFUNC
#define NULLFUNC 0
and uses it as a generic null function pointer constant. This is
superfluous. Just use NULL instead.
Signed-off-by: Ian Abbott <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The source code defines a macro NULLFUNC
#define NULLFUNC 0
and uses it as a generic null function pointer constant. This is
superfluous. Just use NULL instead.
Signed-off-by: Ian Abbott <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This side of the if else statement returned with the lock held and IRQs
disabled.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This quiets a couple sparse warnings about:
warning: dubious: !x & y
Also, remove the unnecessary parentheses around the variables.
Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: Mori Hess <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Move the comedi_unlocked_ioctl function in order to remove most of
the forward declarations in this file.
Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: Mori Hess <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
TRIG_ROUND_NEAREST is 0, so a bit-and with it is always false. The
value TRIG_ROUND_MASK covers the bits of the TRIG_ROUND constants, so
first pick those bits and then make the test using ==.
The same is done for TRIG_ROUND_UP for symmetry, even though bit-and would
be sufficient in this case.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When starting the acquisition the labpc_ai_cmd function was
exiting without unlocking the spinlock. This results in a
sparse warning:
warning: context imbalance in 'labpc_ai_cmd' - different lock contexts for basic block
Add the missing spin_unlock_irqrestore calls.
Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: Mori Hess <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Make the comedi sysfs functions a bit more concise by shortening
some of the verbose variable names and reusing some of the
variables that were used for intermediate calculations.
Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: Mori Hess <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Add a comment to comedi_recognize() to describe what it does as it's a
bit confusing.
Signed-off-by: Ian Abbott <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This code is used by some combination of the CONFIG_COMEDI_DAS08_CS,
CONFIG_COMEDI_DAS08_ISA, and CONFIG_COMEDI_DAS08_PCI and contains a lot
of conditional compilation.
Remove most of the conditional compilation, relying on the compiler to
optimize out unused static functions and data. Use the '__maybe_unused'
tag for those functions that cause compiler warnings as a result of
this.
Also change the DO_COMEDI_DRIVER_REGISTER macro from a conditionally
defined macro to a manifest constant macro to allow it to be tested
outside the preprocessor (although this is not currently needed).
Signed-off-by: Ian Abbott <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Calls to optional subsystems cannot be made indiscriminately.
Enclose all of the usb helper functions inside
#if IS_ENABLED(CONFIG_USB)
to fix these build errors.
(The pci helper functions are OK since there are stubs in
linux/pci.h for the called functions when PCI is not enabled.
Possibly the same could be done for the called USB functions.)
ERROR: "usb_deregister" [drivers/staging/comedi/comedi.ko] undefined!
ERROR: "usb_register_driver" [drivers/staging/comedi/comedi.ko] undefined!
Signed-off-by: Randy Dunlap <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: Frank Mori Hess <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit f80a3f6238 ("Staging: strip: delete
the driver") left if_strip.h unused: nothing in the tree includes it
anymore. It is still exported, but since nothing in the kernel uses
struct MetricomAddress, that seems pointless. Delete this header too.
Signed-off-by: Paul Bolle <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The header files should be included in generated tarballs for archives.
Signed-off-by: Natanael Copa <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Using the __aligned() attribute in favor of __attribute__((aligned(size)))
Signed-off-by: Sam Hansen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Porting zram to use the pr_warn() function instead of the deprecated
pr_warning().
Signed-off-by: Sam Hansen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Documentation of various struct page fields
used by zsmalloc.
Changes for v2:
- Regroup descriptions as suggested by Konrad
Signed-off-by: Nitin Gupta <[email protected]>
Acked-by: Konrad Rzeszutek Wilk <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
xvmalloc can't handle PAGE_SIZE page so that zram have to
handle it specially but zsmalloc can do it so let's remove
unnecessary special handling code.
Quote from Nitin
"I think page vs handle distinction was added since xvmalloc could not
handle full page allocation. Now that zsmalloc allows full page
allocation, we can just use it for both cases. This would also allow
removing the ZRAM_UNCOMPRESSED flag. The only downside will be slightly
slower code path for full page allocation but this event is anyways
supposed to be rare, so should be fine."
1. This patch reduces code very much.
drivers/staging/zram/zram_drv.c | 104 +++++--------------------------------
drivers/staging/zram/zram_drv.h | 17 +-----
drivers/staging/zram/zram_sysfs.c | 6 +--
3 files changed, 15 insertions(+), 112 deletions(-)
2. change pages_expand with bad_compress so it can count
bad compression(above 75%) ratio.
3. remove zobj_header which is for back-reference for defragmentation
because firstly, it's not used at the moment and zsmalloc can't handle
bigger size than PAGE_SIZE so zram can't do it any more without redesign.
Cc: Seth Jennings <[email protected]>
Signed-off-by: Minchan Kim <[email protected]>
Acked-by: Nitin Gupta <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
fd1a30de makes a bug that it uses (struct page *) as zsmalloc's handle
although it's a uncompressed page so that it can access random page,
return random data or even crashed by get_first_page in zs_map_object.
Cc: Seth Jennings <[email protected]>
Cc: Jerome Marchand <[email protected]>
Signed-off-by: Minchan Kim <[email protected]>
Acked-by: Nitin Gupta <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
We should use unsigned long as handle instead of void * to avoid any
confusion. Without this, users may just treat zs_malloc return value as
a pointer and try to deference it.
This patch passed compile test(zram, zcache and ramster) and zram is
tested on qemu.
changelog
* from v2
- remove hval pointed out by Nitin
- based on next-20120607
* from v1
- change zcache's zv_create return value
- baesd on next-20120604
Cc: Dan Magenheimer <[email protected]>
Acked-by: Seth Jennings <[email protected]>
Acked-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Minchan Kim <[email protected]>
Acked-by: Nitin Gupta <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
These two places seem like they should be using bitwise OR instead of
bitwise AND. The first one is a noop which is equivalent to:
imr |= (0x0100 & 0x0004 & 0x0001);
The second is sets lcr2 to zero instead of just clearing the high bits.
lcr2 &= (0x00F0 & 0x000F);
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Failures during the dmm probe can cause the kernel to crash. Moved
the spinlock to a global and moved list initializations immediately
after the allocation of the dmm private structure.
Signed-off-by: Andy Gross <[email protected]>
Reviewed-by: Rob Clark <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
During unload, don't cleanup the framebuffer if it is not valid.
Signed-off-by: Andy Gross <[email protected]>
Reviewed-by: Rob Clark <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use DEFINE_PCI_DEVICE_TABLE() to create the device table and add
MODULE_DEVICE_TABLE() to export it.
Signed-off-by: Miguel Gómez <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove the error_flag field from the ipoctal structure, as the error code
is handled through the tty abstraction. Remove the values definition as well.
Signed-off-by: Miguel Gómez <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The configuration of the communication channel is handled by the tty
abstraction, so the ipoctal_config structure has become useless and it's
only used to store values that are never accesed. Remove it.
Signed-off-by: Miguel Gómez <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove the gotos when handling error conditions, as the code gets clearer
and the gotos are not really avoiding code replication.
Signed-off-by: Miguel Gómez <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove the "out" label from tpci200_request_irq(), as it can directly return
the error code instead of jumping.
Signed-off-by: Miguel Gómez <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove the "out" label from tpci200_slot_map_space(), as it can directly return
the error code instead of jumping.
Signed-off-by: Miguel Gómez <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The raw data reading process (ak8975_read_axis) sets the
single measurement mode to take a sample and once the
conversion is completed the device enters into power-down
mode automatically, therefore there is no need to enable
a flag for this to happen.
Signed-off-by: Leed Aguilar <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Acked-by: Laxman Dewangan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Fuse ROM data access mode is the only mode which does not
transition to power-down mode automatically.
As per the AK8975 data sheet, it is recomended to set the
power-down mode first before attempting to change into
another mode.
Signed-off-by: Leed Aguilar <[email protected]>
Acked-by: Laxman Dewangan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use scnprint instead of snprintf, because snprintf returns the number of bytes
that would have been written to the buffer if there was enough space, and as a
result writing to buf[len-1] might cause a access beyond the buffers limits.
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Lars-Peter Clausen <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/iio/frequency/adf4350.c:316:32: warning: ‘val’ may be used uninitialized in this function
[-Wuninitialized]
Signed-off-by: Michael Hennerich <[email protected]>
Reported-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When uninstalling a device, the call to the ipack_bus_ops remove() frees
resources in the ipack device driver but without unregistering the device.
It generates a kernel oops when somebody wants to unregister the device.
Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
tpci200->info is used later when uninstalling the module. As there is another
kfree in the proper place, this patch removes the wrong one.
Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When uninstalling a device, there is a loop of calls that produces, at the end,
two calls to __ipoctal_remove() function with the same ipack_device argument.
The first time works fine, but the second will fail in tty_unregister_driver()
To avoid this situation, the call to __ipoctal_remove() it is done only from the
ipack bus driver and not from the ipack device driver.
Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>