Johnny Kim [Thu, 20 Aug 2015 07:32:53 +0000 (16:32 +0900)]
staging: wilc1000: change address to fixed value
The linux_wlan_init_test_config() is called once when net driver is loaded.
And because the pointer type of the pstrWFIDrv is changed with the interger
type, this patch replaces it with designated value instead of pointer.
Signed-off-by: Johnny Kim <johnny.kim@atmel.com> Signed-off-by: Tony Cho <tony.cho@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johnny Kim [Thu, 20 Aug 2015 07:32:51 +0000 (16:32 +0900)]
staging: wilc1000: add an argument for Handle_SetWfiDrvHandler
Similar to functions of same layer, this patch add an argument for
Handle_SetWfiDrvHandler function. As a result, the redundant typecasting is
removed.
Signed-off-by: Johnny Kim <johnny.kim@atmel.com> Signed-off-by: Tony Cho <tony.cho@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johnny Kim [Thu, 20 Aug 2015 07:32:50 +0000 (16:32 +0900)]
staging: wilc1000: use the real data type
This patch changes the type of gu8FlushedJoinReqDrvHandler with his real
data type becasue typecasting is not necessary. In result, typecasting
which is not necessary and some building warnings is removed.
Signed-off-by: Johnny Kim <johnny.kim@atmel.com> Signed-off-by: Tony Cho <tony.cho@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Raphaël Beamonte [Wed, 19 Aug 2015 03:14:50 +0000 (23:14 -0400)]
staging: wilc1000: replace MALLOC_WILC_BUFFER() macro to avoid possible memory leak
The MALLOC_WILC_BUFFER() macro was using a return statement, and didn't
take care of possible memory leaks and subsequent bugs when it was failing
after succeeding some allocations. This patch corrects this behavior.
staging: comedi: usbduxfast: remove unnecessary clearing of private data
The clearing of the private data members in the (*detatch) is not
necessary. The comedi core is going to kfree the private data as soon
as the (*detach) finishes.
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>
The semaphore down/up in usbduxfast_attach_common() is not necessary.
This function is only called as part of the (*auto_attach) and does
not talk to the USB device.
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: usbduxfast: document strange ai maxdata
The subdevice 'maxdata' is typically a mask of the valid bits that can
be returned by a subdevice, (1 << bits) - 1. The analog inputs of this
device have a resolution of 12-bits so the 'maxdata' should be 0x0fff.
But, this hardware can produce a value of 0x1000 indicating an overflow
from the ADC. The comedilib library's comedi_to_phys() function will
then return NAN when this value is read from the hardware.
Add a comment to clarify the strage 'maxdata' value.
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: usbduxfast: TRIG_EXT is only valid for cmd->start_src
According to the code, and verified with the author Bernd Porr, the
TRIG_EXT trigger is only valid for the cmd->start_src. Remove this
trigger from the cmd->scan_begin_src and cmd->convert_src.
The only valid scan_begin_src is then TRIG_FOLLOW and the convert_src
is only TRIG_TIMER. Remove the redundant unique trigger checks in Step
2b of the (*do_cmdtest) as well as any other unnecessary checks of
those trigger sources.
Also remove the incorrect comment for a cmd->stop_src of TRIG_EXT.
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>
The private data 'devpriv' is allocated in the (*auto_attach) before
the subdevices are initialized and the (*auto_attach) has to complete
successfully before the core will call any of the subdevice operations.
Because of this the (!devpriv) checks in the subdevice code can never
fail. Remove them.
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: usbduxfast: only chanlist of 1, 2, 3, or 16 are supported
The analog input (*do_cmd) only supports channel lists of 1, 2, 3, or 16
channels. Add a check for this to usbduxfast_ai_check_chanlist() and remove
the check from usbduxfast_ai_cmd().
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: usbduxfast: chanlist check is Step 5 of (*do_cmdtest)
The channel list should be checked in Step 5 of the (*do_cmdtest) not
as part of the (*do_cmd). Factor the check out of usbduxfast_ai_cmd().
Tidy up the factored out code. The channel number 'i' will never be
greater than NUMCHANNELS due to the subdevice setup and the checks
done in the code. The up/down of the semaphore is also not needed
because the (*do_cmdtest) never actually tries to access the hardware.
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: s526: remove #if 0'ed out code block
This #if 0'ed out code is not necessary. It's actually just a copy
of the psuedo code in the S526 Hardware Manual that shows an example
of a counter application. Remove it.
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>
This (*insn_config) does not follow the comedi core API. It also
would not work as expected.
It appears to be trying to configure the analog input subdevice so
that the (*insn_read) would read multiple channels (data[0]) and
optionally enable the 15us delay (data[1]) needed for the multiplexor
to change channels between samples.
Unfortunately, the comedi core expects (*insn_read) operations to
return 1 or more samples for a single channel, which is what the
(*insn_read) in this driver does.
The (*insn_config) is also enabling the analog input end-of-conversion
interrupt. This isn't needed, and might be a problem since the driver
does not currently request and interrupt. The enable bit does not
need to be set for the end-of-conversion to occur in the interrupt
status register.
Remove the (*insn_config) and modify the (*insn_read) to automatically
handle the 15us delay when needed.
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: s526: wait for analog output conversions to complete
It's possible for the user to write more than one value to an analog
output channel with the (*insn_write) operation. Use comedi_timeout()
to check the interrupt status register to ensure that each data
conversion is complete before writing the next value.
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>
The S526 board has 4 general purpose counter/timers. The current
defines used for the registers of these devices do not provide much
clarity in what they are.
Refactor the code to add some clarity.
Replace the current register defines with macros that return the
correct offset based on the counter 'channel'. Introduce a some helper
functions to handle reading/writing the LSB/MSB registers so that
they are always accessed in the correct oreder.
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: serial2002: usleep_range is preferred over udelay
Fix checkpatch issue: "CHECK: usleep_range is preferred over udelay;
see Documentation/timers/timers-howto.txt". Replace the udelay() with
usleep_range() with a reasonable upper limit.
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: unioxx5: remove this flawed driver
I was going to clean up this driver but looking it over it has a
number of serious flaws. Also, Fastwell published an End-Of-Life
notification for the board on 24/Jan/2014 (End-of-sale 30/Jun/2014,
End-of-delivery 30/Dec/2014).
Since the driver has a comedi driver status of "unkown", lets just
remove the driver instead of trying to fix the flaws.
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>
The comedi core can only call this subdevice function is the private
data was successfully allocated during the (*auto_attach). Remove
the unnecessary check.
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: usbdux: use common code path to check the cmd->scan_begin_arg
There are currently separate code paths to check the scan_begin_arg based
of the USB speed. Refactor the code to use a common code path and simplify
the code.
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>
Add some missing space to quiet the checkpatch.pl issues about:
CHECK: spaces preferred around that '/' (ctx:VxV)
CHECK: spaces preferred around that '+' (ctx:VxV)
CHECK: spaces preferred around that '*' (ctx:VxV)
CHECK: spaces preferred around that '-' (ctx:VxV)
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>
Jeff Becker [Mon, 24 Aug 2015 18:28:18 +0000 (11:28 -0700)]
staging/lustre: fix block comment formatting
Running checkpatch.pl on lnet/klnds/o2iblnd/o2iblnd.h produces several
"Block comments use a trailing */ on a separate line" warnings. This patch
fixes these.
Signed-off-by: Jeff Becker <Jeffrey.C.Becker@nasa.gov> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The locking scheme used in ptlrpc_deactivate_and_unlock_import and
ptlrpc_deactivate_import generates the followings sparse errors:
drivers/staging/lustre/lustre/ptlrpc/import.c:209:9: warning: context
imbalance in 'ptlrpc_deactivate_and_unlock_import' - unexpected unlock
drivers/staging/lustre/lustre/ptlrpc/import.c:221:6: warning: context
imbalance in 'ptlrpc_deactivate_import' - wrong count at exit
As ptlrpc_deactivate_and_unlock_import is only used by
ptlrpc_deactivate_import as a helper function, this patch moves its code
into ptlrpc_deactivatre_import to fix the sparse warnings.
Signed-off-by: Maxime Lorrillere <maxime.lorrillere@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Merge tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris
Pull CRIS updates from Jesper Nilsson:
"Mostly removal of old cruft of which we can use a generic version, or
fixes for code not commonly run in the cris port, but also additions
to enable some good debug"
* tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris: (25 commits)
CRISv10: delete unused lib/dmacopy.c
CRISv10: delete unused lib/old_checksum.c
CRIS: fix switch_mm() lockdep splat
CRISv32: enable LOCKDEP_SUPPORT
CRIS: add STACKTRACE_SUPPORT
CRISv32: annotate irq enable in idle loop
CRISv32: add support for irqflags tracing
CRIS: UAPI: use generic types.h
CRIS: UAPI: use generic shmbuf.h
CRIS: UAPI: use generic msgbuf.h
CRIS: UAPI: use generic socket.h
CRIS: UAPI: use generic sembuf.h
CRIS: UAPI: use generic sockios.h
CRIS: UAPI: use generic auxvec.h
CRIS: UAPI: use generic headers via Kbuild
CRIS: UAPI: fix elf.h export
CRIS: don't make asm/elf.h depend on asm/user.h
CRIS: UAPI: fix ptrace.h
CRISv32: Squash compile warnings for axisflashmap
CRISv32: Add GPIO driver to the default configs
...
Linus Torvalds [Wed, 27 May 2015 22:32:15 +0000 (15:32 -0700)]
blk: rq_data_dir() should not return a boolean
rq_data_dir() returns either READ or WRITE (0 == READ, 1 == WRITE), not
a boolean value.
Now, admittedly the "!= 0" doesn't really change the value (0 stays as
zero, 1 stays as one), but it's not only redundant, it confuses gcc, and
causes gcc to warn about the construct
switch (rq_data_dir(req)) {
case READ:
...
case WRITE:
...
that we have in a few drivers.
Now, the gcc warning is silly and stupid (it seems to warn not about the
switch value having a different type from the case statements, but about
_any_ boolean switch value), but in this case the code itself is silly
and stupid too, so let's just change it, and get rid of warnings like
this:
drivers/block/hd.c: In function ‘hd_request’:
drivers/block/hd.c:630:11: warning: switch condition has boolean value [-Wswitch-bool]
switch (rq_data_dir(req)) {
The odd '!= 0' came in when "cmd_flags" got turned into a "u64" in
commit 5953316dbf90 ("block: make rq->cmd_flags be 64-bit") and is
presumably because the old code (that just did a logical 'and' with 1)
would then end up making the type of rq_data_dir() be u64 too.
But if we want to retain the old regular integer type, let's just cast
the result to 'int' rather than use that rather odd '!= 0'.
Fix up the writeback plugging introduced in commit d353d7587d02
("writeback: plug writeback at a high level") that then caused problems
due to the unplug happening with a spinlock held.
* writeback-plugging:
writeback: plug writeback in wb_writeback() and writeback_inodes_wb()
Revert "writeback: plug writeback at a high level"
writeback: plug writeback in wb_writeback() and writeback_inodes_wb()
We had to revert the pluggin in writeback_sb_inodes() because the
wb->list_lock is held, but we could easily plug at a higher level before
taking that lock, and unplug after releasing it. This does that.
Chris will run performance numbers, just to verify that this approach is
comparable to the alternative (we could just drop and re-take the lock
around the blk_finish_plug() rather than these two commits.
I'd have preferred waiting for actual performance numbers before picking
one approach over the other, but I don't want to release rc1 with the
known "sleeping function called from invalid context" issue, so I'll
pick this cleanup version for now. But if the numbers show that we
really want to plug just at the writeback_sb_inodes() level, and we
should just play ugly games with the spinlock, we'll switch to that.
Cc: Chris Mason <clm@fb.com> Cc: Josef Bacik <jbacik@fb.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Neil Brown <neilb@suse.de> Cc: Jan Kara <jack@suse.cz> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
I didn't notice this when merging the thermal code from Zhang, but his
merge (commit 5a924a07f882: "Merge branches 'thermal-core' and
'thermal-intel' of .git into next") of the thermal-core and
thermal-intel branches was wrong.
In thermal-core, commit 17e8351a7739 ("thermal: consistently use int for
temperatures") converted the thermal layer to use "int" for
temperatures.
But in parallel, in the thermal-intel branch commit d0a12625d2ff
("thermal: Add Intel PCH thermal driver") added support for the intel
PCH thermal sensor using the old interfaces that used "unsigned long"
pointers.
This resulted in warnings like this:
drivers/thermal/intel_pch_thermal.c:184:14: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.get_temp = pch_thermal_get_temp,
^
drivers/thermal/intel_pch_thermal.c:184:14: note: (near initialization for ‘tzd_ops.get_temp’)
drivers/thermal/intel_pch_thermal.c:186:19: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.get_trip_temp = pch_get_trip_temp,
^
drivers/thermal/intel_pch_thermal.c:186:19: note: (near initialization for ‘tzd_ops.get_trip_temp’)