staging: comedi: ni_660x: cleanup the NI660X_IO_CFG register helpers
Convert the inline functions used to set the bits in the NI600X_IO_CFG
registers into macros. Also convert the enum ni_660x_pfi_output_select
into defines. This clarifies the association with the register.
This also fixes a number of checkpatch.pl issues about:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
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>
All the registers are defined struct NI_660xRegisterData and they are
either 2 or 4 bytes in size. Remove the enum and just use a char member
to define the size as 2 or 4 bytes.
Simplify the ni_660x_{write,read}_register() functions and remove the
unnecessary BUG() in each.
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 member of the struct is not used, and just takes up space. Remove it.
Instead, add the enum ni_660x_register indexes to the table to clarify, and
document, the entries.
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: ni_660x: change IOConfigReg() into a macro
The BUG_ON() in this function is unnecessary. The 'pfi_channel' will
always be in range of the subdevice 'n_chan' (NUM_PFI_CHANNELS) which
will return a valid 'reg'.
Convert the inline function into a simple macro.
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>
Leo Kim [Fri, 25 Mar 2016 12:16:56 +0000 (21:16 +0900)]
staging: wilc1000: removes unused local variable
This patch removes unused local variable.
This variable is operation definition that back off from sending packets
for some time.
However, that has been deleted operation code.
That is removes all relative code.
Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Leo Kim [Fri, 25 Mar 2016 12:16:53 +0000 (21:16 +0900)]
staging: wilc1000: replaces memcmp with ether_addr_equal_unaligned
This patch replaces memcmp with ether_addr_equal_unaligned.
Warning reported by checkpatch.pl
- Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()
Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chaehyun Lim [Wed, 23 Mar 2016 12:28:34 +0000 (21:28 +0900)]
staging: wilc1000: use completion instead of struct semaphore hif_sema_driver
struct semaphore hif_sema_driver is used to signal completion of host
interface message. This patch replaces struct semaphore hif_sema_driver
with struct completion hif_driver_comp. It is better to use completion
than semaphore for this case.
Chaehyun Lim [Wed, 23 Mar 2016 12:28:33 +0000 (21:28 +0900)]
staging: wilc1000: use completion instead of struct semaphore hif_sema_thread
struct semaphore hif_sema_thread is used to signal completion of host
interface thread. This patch replaces struct semaphore hif_sema_thread
with struct completion hif_thread_comp. It is better to use completion
than semaphore for this case.
Alexander Curtin [Thu, 24 Mar 2016 02:15:53 +0000 (22:15 -0400)]
staging: unisys: include: changed 'v' variable to 'state'
The argument for ULTRA_CHANNELCLI_STRING is supposed to be
an integer representing the channel state. 'state' is a more
descriptive variable name for this.
Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alexander Curtin [Thu, 24 Mar 2016 02:15:52 +0000 (22:15 -0400)]
staging: unisys: visorbus: replaced use of vague 'x' variable
In client_bus_info_show, the variable 'x' is used to create keep track
of the offset that the current 'pos' in the output buffer needs to be
incremented by. Since 'off' is already taken 'shift' was used since it's
used to shift the pointer.
Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alexander Curtin [Thu, 24 Mar 2016 02:15:51 +0000 (22:15 -0400)]
staging: unisys: visorbus: replaced vague 'p' variable with 'pos'
In the case of client_bus_info_show, the variable 'p' was used to
indicate the position in the output buffer. This was changed to 'pos' to
indicate that it kept track of the current position in the output
buffer.
Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alexander Curtin [Thu, 24 Mar 2016 02:15:50 +0000 (22:15 -0400)]
staging: unisys: visorbus: replaced vague variable name in zoneguid_show
The variable name "s" doesn't indicate the purpose of the string, which
is to store the id collected from the visorchannel_zoneid function. This
just replaces the name with "zoneid".
Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alexander Curtin [Thu, 24 Mar 2016 02:15:49 +0000 (22:15 -0400)]
staging: unisys: visorbus: replaced vague variable name in typeguid_show
The variable name "s" doesn't indicate the purpose of the string, which
is to store the id collected from the visorchannel_id function. This
just replaces the name with "typeid".
Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
James Simmons [Tue, 22 Mar 2016 23:04:11 +0000 (19:04 -0400)]
staging: lustre: libcfs: move function declarations from libcfs_ioctl.h
Move the function declartions that are used only by
kernel space to libcfs.h This makes libcfs_ioctl.h
a offical uapi header now.
Move large inline functions out of libcfs_ioctl.h to
the source file linux-module.c belonging to libcfs.
This code is only used by the core of libcfs and such
inline functions don't belong in a uapi header file.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17643 Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
James Simmons [Tue, 22 Mar 2016 23:04:10 +0000 (19:04 -0400)]
staging: lustre: libcfs: migrate inline functions to source file
Move large inline functions out of libcfs_ioctl.h to
the source file linux-module.c belonging to libcfs.
This code is only used by the core of libcfs and such
inline functions don't belong in a uapi header file.
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17643 Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
With struct libcfs_device_userstate gone we can remove
the remaining code of libcfs_psdev_ops.p_[open|close]
as well as the libcfs_psdev_[open|release] functions.
Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com> Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Parinay Kondekar [Tue, 22 Mar 2016 23:04:04 +0000 (19:04 -0400)]
staging:lustre: remove last bits of the IOC_LIBCFS_PANIC ioctl
A few pieces still exist for the IOC_LIBCFS_PANIC ioctl. Remove
these last bits to prevent old tools from using them. The latest
lustre utilities no longer use this ioctl.
Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com> Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
John L. Hammond [Tue, 22 Mar 2016 23:04:02 +0000 (19:04 -0400)]
staging: lustre: libcfs: move libcfs_ioctl_handler stuff to libcfs.h
Move all the libcfs_ioctl_handler code from libcfs_ioctl.h to
libcfs.h. The header libcfs_ioctl.h is a uapi header so their
is no reason to keep kernel internals in that header.
Signed-off-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14180 Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Reviewed-by: frank zago <fzago@cray.com> Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Liang Zhen [Tue, 22 Mar 2016 23:03:51 +0000 (19:03 -0400)]
staging: lustre: libcfs: merge libcfs_ioctl_handle into libcfs_ioctl
This is apart of the cleanup of libcfs_ioctl* code. In this
part we turn libcfs_ioctl_handle into libcfs_ioctl since
libcfs_ioctl is now a skeleton function.
Liang Zhen [Tue, 22 Mar 2016 23:03:50 +0000 (19:03 -0400)]
staging: lustre: libcfs: merge code from libcfs_ioctl into libcfs_ioctl_getdata
This is apart of the cleanup of libcfs_ioctl* code. In this
part some of the code in libcfs_ioctl is migrated into
libcfs_ioctl_getdata_len() which is renamed libcfs_ioctl_getdata()
Liang Zhen [Tue, 22 Mar 2016 23:03:48 +0000 (19:03 -0400)]
staging: lustre: libcfs: replace LNET_MAX_IOCTL_BUF_LEN with something bigger
The size of LNET_MAX_IOCTL_BUF_LEN restricts the size of
libcfs ioctl to the maximum needs of the LNet layer. Since
libcfs also handles things like debugging we might need
to let user land pass more data to or from the kernel than
what is possible
Commit 4671a0266 change the parameter of the second parameter of
cfs_precpt_alloc() from a sizeof type to sizeof type *pointer.
This was incorrect in this case and it caused a crash when the LNet
layer was brought up in my testing. The reason is cfs_precpt_alloc()
creates an array of items where the arrays size is equal to the
number of CPTs that exist. Changing to type *pointer only had
cfs_precpt_alloc() create an array of pointers instead of an array
of actual data structures. This patch reverse this change and adds
comments to explain what cfs_precpt_alloc() is actually doing to
avoid potential issues like this again.
Changelog:
v1) Simple revert of the original patch
v2) Added in comments to explain why cfs_precpt_alloc() has the
arguments it uses.
staging: media: omap1: Replace request_irq with devm_request_irq
Replace request_irq with devm_request_irq to get the interrupt
for device which is automatically freed on exit. Remove
corresponding free_irq from probe and remove functions of a
platform device.
staging: media: omap1: Switch to devm_ioremap_resource
Replace calls to request_mem_region and ioremap with a direct
call to devm_ioremap_resource instead and modify error
handling.
Move the call to platform_get_resource adjacent to the call to
devm_ioremap_resource to make the connection between them more
clear.
Also remove unnecessary labels, variable initialisations and
release_mem_region iounmap from probe and remove functions.
staging: media: omap1: Replace clk_get with devm_clk_get
devm_clk_get allocated resources get released when a driver detaches.
Replace clk_get with devm_clk_get and remove corresponding data
releasing function clk_put from probe and remove functions of a
platform device. Also remove an unnecessary label.
This change was made with the help of the following Coccinelle
semantic patch:
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
.probe = probefn,
.remove = removefn,
};
staging: comedi: amplc_pci230: Convert macro GAT_CONFIG to static inline function
Convert macro GAT_CONFIG to static inline function as static inline
functions are preferred over macros. This change is possible since the
arguments at all call sites have the same type.
This was done using Coccinelle:
@r@
expression e;
@@
- #define GAT_CONFIG(chan, src) e
+ static inline unsigned int pci230_gat_config(unsigned int chan,
+ unsigned int src)
+{
+ return ((chan & 3) << 3) | (src & 7);
+}
Chaehyun Lim [Mon, 21 Mar 2016 23:39:24 +0000 (08:39 +0900)]
staging: wilc1000: use mutex instead of struct semaphore hif_sema_deinit
This patch replaces struct semaphore hif_sema_deinit with struct mutex
hif_deinit_lock. It is better to use mutex because mutex gives better
performance than semaphore.
staging: comedi: dt282x: tidy up register bit defines
Arnd Bergmann pointed out that gcc-6 warns about passing negative signed
integer into swab16() due to the macro expansion of 'outw'.
It appears that the register map constants are causing the warnings.
Actually, it might just be the (1 << 15) ones...
Convert all the constants as suggested by checkpatch.pl:
CHECK: Prefer using the BIT macro
The BIT() macro will make all the constants explicitly 'unsigned', which
helps to avoid the warning.
Fix the, unsused, DT2821_CHANCSR_PRESLA() macro. The "Present List
Address" (PRESLA) bits in the CHANCSR register are read only. This
define was meant to extract the bits from the read value.