This commit fixes the checkpath warning 'void function return
statements are not generally useful' caused by the 'return' at the end
of 'void' function.
Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgnc: Remove 'volatile' modifier where it is not needed
This commit fixes the checkpath warning about misused 'volatile'
modifier. In this case the 'volatile' was not needed as it was used
for regular automatic variable. Thos commit removes the 'volatile'.
Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
It turned out that the TODO file contained the invalid information as
some of the work has already been done. This commit updates it with the
current status of what is left to be done.
Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit slightly simplifies the sgnc_start() function by
rearranging it. As a result the indentation level is reduced.
This is not the functional change.
Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgnc: Move utility functions out of dgnc_driver.c
This commit moves the utility functions out of dgnc_driver.c file and
puts them in the new dgnc_utils.{c,h} files. The accompanying changes
adjust the existing code to work with this design.
Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgnc: Remove unnecessary functions from dgnc_driver.c
This commit slightly cleans up the dgnc_driver.c file. The changes
include removing one-line proxy functions as they were not needed.
Additionaly the pci 'remove' function is deleted because it was no
need for it.
Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: dgnc: Fix externs should be avoided in the .c files
This commit fixes the following checkpatch warnings:
WARNING: externs should be avoided in .c files
#80: FILE: drivers/staging/dgnc/dgnc_driver.c:80:
+int dgnc_init_module(void);
#81: FILE: drivers/staging/dgnc/dgnc_driver.c:81:
+void dgnc_cleanup_module(void);
This was caused by putting the declarations for module init and module
exit fucntions on the top of the file. The fix removes these
declarations plus it also corrects the type of the init/exit functions.
Due to the dependency between init and exit functions the
dgnc_cleanup_module had to be put first.
Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: wlan-ng: fix sparse warning in prism2fw.c
Fix the following sparse warning :
In file included from drivers/staging/wlan-ng/prism2usb.c:5:0:
drivers/staging/wlan-ng/prism2fw.c: In function
‘read_cardpda.constprop.43’:
drivers/staging/wlan-ng/prism2fw.c:792:1: warning: the frame size of
1068 bytes is larger than 1024 bytes [-Wframe-larger-than=]
The variable to 'struct p80211msg_p2req_readpda' was previously being created
on the stack, which inturn exeeded the frame size limit, resulting in a
sparse warning. This patch alloctes the memory to the structure dynamically
and the operations are left unchanged.
Signed-off-by: A Raghavendra Rao <arrao@cdac.in> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: amplc_dio200_pci: remove 'mainsize' from PCI boardinfo
The 'mainsize' member in the boardinfo for the DIO200 PCI boards is only used
for a sanity check of the pci_resource_len(). This sanity check is not needed.
Remove the sanity check along with the 'mainsize' values in the boardinfo.
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_dio200: remove 'mainsize' from ISA boardinfo
All the ISA DIO200 boards have an i/o region size of 0x20 (DIO200_IO_SIZE).
Remove the boardinfo and open code the size in the comedi_request_region()
call.
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_dio200: remove private data
The private data in this driver only has one member, 'intr_sd', which is
the index to the interrupt subdevice.
This member is initialized during the attach of the driver when the sd_intr
subdevice is detected in the boadinfo 'layout'. The member is then used in
the interrupt handler to get the pointer to the subdevice.
This member is not necessary. The comedi_device 'read_subdev' is also
initialized during the attach. This can be used in the interrupt handler
to get the subdevice pointer.
Refactor the code to not require the private data and remove the struct
and its allocations.
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>
Ian Abbott [Thu, 31 Jul 2014 13:47:55 +0000 (14:47 +0100)]
staging: comedi: amplc_pci224: no need to comedi_set_hw_dev() here
The comedi core module calls `comedi_set_hw_dev()` to associate the
hardware `struct device` with the `struct comedi_device` before it calls
the comedi driver's "auto_attach" hook `pci224_auto_attach()`. There is
no need for `pci224_auto_attach()` to call `comedi_set_hw_dev()` itself,
so remove the call.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The macros `PCI_DEVICE_ID_AMPLICON_PCI224` and
`PCI_DEVICE_ID_AMPLICON_PCI234` are only used in the PCI module device
table `amplc_pci224_pci_table[]`. Just expand the macros where they are
used and remove them. The macro `PCI_DEVICE_ID_INVALID` is no longer
used either, so remove it.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 4 Aug 2014 11:14:28 +0000 (12:14 +0100)]
staging: comedi: amplc_pci224: put board indices in PCI driver_data
The `driver_data` member value from the matched entry of the PCI module
device table `amplc_pci224_pci_table[]` is passed through to our comedi
"auto_attach" handler, `pci224_auto_attach()`. Use that to index
directly into our static board data array `pci224_boards[]` instead of
calling `pci224_find_pci_board()` to search for the entry matching the
PCI device ID. That function can be removed. The `devid` and `model`
members of `struct pci224_board` are no longer needed either and can be
removed.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Thu, 31 Jul 2014 13:47:51 +0000 (14:47 +0100)]
staging: comedi: amplc_pci224: no need to manipulate PCI ref count
This driver no longer supports a "legacy" attach mechanism that searches
for a suitable PCI device and increments it's reference count, but since
the common "detach" handler `pci224_detach()` still has a left-over
`pci_dev_put()`, a matching `pci_dev_get()` is needed in the
"auto_attach" handler `pci224_auto_attach()`. There is no longer any
reason to "get" and "put" the PCI device, so those calls can be removed.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Since the driver no longer supports options in its "legacy" attach
mechanism to describe the jumper settings (or any options beyond
restricting a PCI search to a particular bus and/or slot), there is no
need to retain this mechanism in the driver. Remove the comedi driver
"attach" handler `pci224_attach()`, and the now unused
`pci224_find_pci_dev()`. Also, remove the "wildcard" entry from the
board table `pci224_boards[]` as it is no longer needed.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Thu, 31 Jul 2014 13:47:49 +0000 (14:47 +0100)]
staging: comedi: amplc_pci224: remove options to select output ranges
When attaching a PCI224 or PCI234 manually via the `COMEDI_DEVCONFIG`
ioctl, there are several options the user can supply that describe the
state of the hardware jumpers (LK1 for PCI224, LK1 thru LK5 for PCI234).
These options control how the driver sets up the AO range tables for the
device. Those options are useless when the board is attached
automatically via the PCI driver probe function
`amplc_pci225_pci_probe()`, `comedi_pci_auto_config()`, and the
comedi driver "auto_attach" handler `pci224_auto_attach()`.
Rip out the range table selection options and use a single, static range
table per board type, containing all the software- and
hardware-selectable ranges for that board. The PCI234 used to have a
per-channel `range_table_list` rather than an all-channel `range_table`,
as the jumpers selected different ranges for all channels. Now that the
channels are using a unified range table, use an all-channel
`range_table` instead.
When checking the channel list for an asynchronous command in
`pci224_ao_check_chanlist()` make sure the ranges specified in the list
have compatible jumper settings. We don't know how the jumpers are
actually set, but we can at least avoid conflicting settings.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Thu, 31 Jul 2014 13:47:45 +0000 (14:47 +0100)]
staging: comedi: amplc_pci224: omit '!= 0' from logical expressions
Since anything non-zero is logically "true", don't bother doing
"not-equal" comparisons with zero, except when testing for an explicit
number 0 (not as a result of bit tests for example).
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Thu, 31 Jul 2014 13:47:38 +0000 (14:47 +0100)]
staging: comedi: amplc_pci224: reformat some comments
Reformat comments to fit in with the preferred coding style, including
the copyright and comedi driver description comments at the start of the
file. Also, remove a boiler-plate comment for the comedi device private
data structure.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Benjamin Romer [Tue, 5 Aug 2014 18:57:53 +0000 (14:57 -0400)]
staging: unisys: clean up vmcall functions
Clean up the format of the vmcall functions in iovmcall_gnuc.h. These functions
are rewritten for clarity and to correct the indention, without changing any
functionality.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Benjamin Romer [Sun, 3 Aug 2014 02:03:42 +0000 (22:03 -0400)]
staging: unisys: move remaining macros from commontypes.h to channel.h
All of the remaining macros in commontypes.h - the CHANNEL_*_MISMATCH macros
and UltraLogEvent() - are used only in channel.h. Move the entire set of them
to their new home.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Benjamin Romer [Sun, 3 Aug 2014 02:03:41 +0000 (22:03 -0400)]
staging: unisys: remove OFFSETOF from commontypes
The only place OFFSETOF was being used was in iochannel.h. Remove the macro
from commontypes.h and replace all uses of it in iochannel.h with offsetof()
instead.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Benjamin Romer [Sun, 3 Aug 2014 02:03:40 +0000 (22:03 -0400)]
staging: unisys: remove GUEST_PHYSICAL_ADDRESS from commontypes.h
The typedef for GUEST_PHYSICAL address is only used in two files, so remove it
from commontypes.h and add it to visorchipset/file.c and controlvmchannel.h.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Benjamin Romer [Sun, 3 Aug 2014 02:03:39 +0000 (22:03 -0400)]
staging: unisys: remove INLINE define from commontypes
There was a macro for INLINE. Delete it and fix the one occurrance of it to
just use 'inline' instead, though that function looks awfully big for an
inline...
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Benjamin Romer [Sun, 3 Aug 2014 02:03:38 +0000 (22:03 -0400)]
staging: unisys: remove MEMORYBARRIER AND VolatileBarrier from commontypes
Remove the MEMORYBARRIER and VolatileBarrier() defines from commontypes.h and
convert the spots that used this to mb(). Add comments to each use to indicate
that the barrier is used to ensure channel synchronization between guests.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Benjamin Romer [Sun, 3 Aug 2014 02:03:37 +0000 (22:03 -0400)]
staging: unisys: remove MEMCPY functions from commontypes.h
This patch removes MEMCPY, MEMCPY_FROMIO, and MEMCPY_TOIO from commontypes.h,
and switches all use of these macros to the appropriate built in definition.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daeseok Youn [Sat, 9 Aug 2014 05:39:29 +0000 (14:39 +0900)]
staging: dgap: cleanup print messages for dgap driver
* use dev_{warn,err} instead of pr_{warn,err}
* removes dgap_err() and just use pr_err(). pr_err() used in
dgap_parsefile() not dev_err() because if dgap_parsefile() is
failed, just one message is printed.
* removes "out of memory" messages.
Daeseok Youn [Sat, 9 Aug 2014 05:38:41 +0000 (14:38 +0900)]
staging: dgap: Simplify to set a concentrator type
It is same manner with setting a board type.
For example of config file for concentrator,
"conc ccon" or
"conc epcon"
After allocating a type of "CNODE" then set a type of concentrator.
So remove cases in swith statement, just get a token from string
and set to "conc.type". And also it doesn't need to "conc.v_type".
Daeseok Youn [Sat, 9 Aug 2014 05:38:14 +0000 (14:38 +0900)]
staging: dgap: Simplify set a board type from configration file
Board types need to separate normal command like IO, MEM and so on.
And the board type will come after "board" string in config file normally.
(If it is not, dgap_gettok returns an error with zero)
After that, set a variable of a number which is matched with specific
a board number to "board.type". The dgap_gettok() returns that number so
just set to "board.type" and also "v_type" can be removed.
In case of boards of PCI type are set variables to zero. These can
be removed because "p" as cnode get memory from kzalloc so already
set to zero.
Daeseok Youn [Sat, 9 Aug 2014 05:36:44 +0000 (14:36 +0900)]
staging: dgap: remove useless variable
dgap_major_serial_registered and dgap_major_transparent_print_registered
could be checked whether a board is initialized.
But it doesn't need to check that variables becasue dgap module
isn't calling the dgap_cleanup_tty() without initializing
for a board completely.