Commit graph

40 commits

Author SHA1 Message Date
Sudip Mukherjee f9b64692e1 staging: unisys: unneeded NULL check
the NULL check for memregion is not required as it has already been
checked for NULL after kzalloc. so we can reach this part of the code
only if memregion is not NULL.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 09:22:46 -08:00
Benjamin Romer 2291b26874 staging: unisys: refactor visorutil_mod_init()
Fix the function name declaration so it is just one line, and add the missing
brackets to the else clause in the if statement.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:50 -08:00
Benjamin Romer 670db786db staging: unisys: refactor visorutil_spar_detect()
Fix the declaration line so it is just one single line, and add the missing
brackets on the else clause in the if statement.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:50 -08:00
Benjamin Romer 5d2c3960b2 staging: unisys: fix spacing in visorkmodutils.c
Remove all the extraneous blank lines from visorkmodutils.c.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:50 -08:00
Benjamin Romer f0b5c6d353 staging: unisys: fix bracketing in visor_periodic_work_stop()
The last if statement in this function is missing brackets on the else
clause. Add them.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Benjamin Romer 622c9d97c1 staging: unisys: fix spacing in periodic_work.c
Get rid of all extraneous blank lines in periodic_work.c.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Benjamin Romer 6db05d3f9a staging: unisys: fix sizeof() in visor_memregion_create_overlapped()
Use the variable name rather than the type in the sizeof() call in this
function.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Benjamin Romer 92d00cf0f5 staging: unisys: fix line over 80 characters in mapit()
The error output in mapit() in memregion_direct.c has variables past the 80
character limit. Move them to the next line, but the string constant will still
go past the limit, and that's okay.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Benjamin Romer ab2cded1bc staging: unisys: remove extra blank lines in memregion_direct.c
Get rid of the extra blank lines in this file.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Benjamin Romer 49695a534a staging: unisys: remove unnecessary spaces in casts in memregion_direct.c
Get rid of all extra spaces between casts and their targets in this file.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Benjamin Romer fef483891d staging: unisys: refactor visor_memregion_create()
Fix the sizeof() so it uses the variable name rather than the type, fix the
argument alignment to the kzalloc(), and rename the goto label.

Away => cleanup

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Benjamin Romer b63438c4e3 staging: unisys: remove typedef for MEMREGION
Remove the typedef for this structure and just use struct memregion instead.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Benjamin Romer 7146250754 staging: unisys: split double assignment in visor_charqueue_create()
Split up the doubled assignment in visor_charqueue_create() into two separate
assignments.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Benjamin Romer 7a81a6e87e staging: unisys: refactor CHARQUEUE
Remove the typedef and just use struct charqueue instead. Update all references.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Benjamin Romer 20188dd914 staging: unisys: fix line spacing in charqueue.c
Clean up the extraneous blank lines in charqueue.c.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 11:50:49 -08:00
Shrikrishna Khare 1846472c91 Staging: unisys: visorutil: easyproc: fixed a line over 80 characters coding style issue
Fixed a coding style issue.

Signed-off-by: Shrikrishna Khare <shrikrishna.khare@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-27 10:33:07 +08:00
WANG Chao 00e053bd9f staging, unisys: remove leftover function kmalloc_kernel()
kmalloc_kernel() previously declared in timskmodutils.h which recently got
removed. Now also remove kmalloc_kernel(), because it's not used anywhere.

Signed-off-by: WANG Chao <wangchao19890207@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-27 10:33:06 +08:00
Tapasweni Pathak 8d02c02253 staging: unisys: visorutil: Remove null check before kfree
This patch was generated by the following semantic patch:

// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-23 13:43:46 +08:00
Benjamin Romer e3f3b1f2a0 staging: unisys: remove timskmodutils.h
Remove the entire timskmodutils.h file as it had a lot of checkpatch.pl
strict warnings and checks, and nearly all of the functions were not used
anywhere.

The unisys_spar_platform variable was moved to timskmod.h. References to the
removed timskmodutils.h were switched to timskmod.h instead. The unused
visor_seq_file_new_buffer() and visor_seq_file_done_buffer() functions defined
in timskmodutils.h were implemented in visorkmodutils.c, so these were removed
as well.

This patch will generate a warning about updating MAINTAINERS, but there does
not seem to be any need for that.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:42:30 -07:00
Benjamin Romer 2c5653b7de staging: unisys: remove typedef for PERIODIC_WORK
In periodic_work.h, remove the typedef PERIODIC_WORK and replace it with
struct periodic_work, and update functions used to manipulate the
structure to use the new name. The functions used to manipulate the
PERIODIC_WORK type are updated to use the fixed name, corrected for
clarity, and changed to not use periodic_work as the parameter's name.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:42:30 -07:00
Chen Gang f39100e121 drivers/staging/unisys: Let all IOMEM related modules depend on HAS_IOMEM
UNISYS_UISLIB, UNISYS_VISORCHIPSET, and UNISYS_VISORUTIL need HAS_IOMEM,
so depend on it. One of related error (with allmodconfig under um):

    CC [M]  drivers/staging/unisys/uislib/uislib.o
  In file included from drivers/staging/unisys/uislib/uislib.c:34:0:
  drivers/staging/unisys/include/uisutils.h: In function ‘dbg_ioremap_cache’:
  drivers/staging/unisys/include/uisutils.h:88:2: error: implicit declaration of function ‘ioremap_cache’ [-Werror=implicit-function-declaration]
    new = ioremap_cache(addr, size);
    ^
  drivers/staging/unisys/include/uisutils.h:88:6: warning: assignment makes pointer from integer without a cast [enabled by default]
    new = ioremap_cache(addr, size);
        ^
  drivers/staging/unisys/include/uisutils.h: In function ‘dbg_ioremap’:
  drivers/staging/unisys/include/uisutils.h:99:2: error: implicit declaration of function ‘ioremap’ [-Werror=implicit-function-declaration]
    new = ioremap(addr, size);
    ^
  drivers/staging/unisys/include/uisutils.h:99:6: warning: assignment makes pointer from integer without a cast [enabled by default]
    new = ioremap(addr, size);
        ^
  drivers/staging/unisys/include/uisutils.h: In function ‘dbg_iounmap’:
  drivers/staging/unisys/include/uisutils.h:108:2: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration]
    iounmap(addr);
    ^

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 09:39:33 -07:00
Catalina Mocanu 6905cae3a8 staging: unisys: visorutil: remove unnecessary braces
This fixes the following checkpatch.pl warning:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Catalina Mocanu <catalina.mocanu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 13:33:34 -07:00
Benjamin Romer 66e24b7686 staging: unisys: fix visorchipset sysfs attribute functions
This patch cleans up the style, error handling, and string handling in the sysfs
functions recently added to visorchipset:

- Use of sscanf() was changed to type-appropriate kstrto*() functions
- error handling was simplified
- the error return value of visorchannel_write() was corrected
- switch use of driver-specific types to kernel types

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-27 08:57:38 -07:00
Paul Bolle 5573e4f615 staging: unisys: remove unused macros
The macros CONFIG_SPAR_GUEST, GUESTDRIVERBUILD, and NOAUTOVERSION are
defined in Makefiles for the Unisys SPAR driver. They are never used.
Remove the lines that define these macros.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:13:40 -04:00
Ken Cox 3db5540dfd Staging: unisys: Fix sparse warnings
Fix sparse warnings caused by incorrect references to IO space.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:21:10 +09:00
Masaru Nomura e03e1e39b6 staging: unisys: visorutil: Add a blank line
Add a blank line after declarations to meet kernel coding style.

Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:56:32 -07:00
Ken Cox 37b7e990ff Staging: unisys: visorutil: Add MODULE_LICENSE("GPL")
The visorutil module was lacking license info.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:44:17 -07:00
Ken Cox fcd0157ece Staging: unisys: detect s-Par firmware
This patch adds support for detection of s-Par firmware by checking for
the hypervisor bit in the CPU capabilities, and then querying the hypervisor
ID cpuid leaf.

This functionality will be used by the unisys drivers to determine if
they are being loaded on an s-Par platform and refuse to load if no
s-Par firmware is present.

This fixes a problem reported from upstream where a panic occurs if the
unisys drivers are loaded on a non s-Par system.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Tested by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:44:17 -07:00
Benjamin Romer f6d0c1e62b staging: unisys: fix copyright notices
This patch changes all of the various representations of the copyright symbol
to (C).

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 15:25:40 -07:00
Ken Cox 22ad57ba5e Staging: unisys: Remove RETINT macro
The RETINT macro included a goto statement which is not allowed in the
kernel.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:56:31 -07:00
Ken Cox 5e54c97dab Staging: unisys: Remove FAIL macro
The FAIL macro ultimately includes a goto statement which is not allowed
in the kernel.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:56:31 -07:00
Ken Cox d9355f8934 Staging: unisys: Remove RETPTR macro
The RETPTR macro contained a goto statement which is not allowed in
the kernel.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:56:31 -07:00
Ken Cox 61e03b433d Staging: unisys: Remove RETBOOL macro
The RETBOOL macro contained a goto statement which is not allowed in
the kernel.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:56:31 -07:00
Silvio F a3acc83a4a staging: unisys: kmalloc/memset to kzalloc conversation
This patch solves the Coccinelle warning: "kzalloc should be used
instead of kmalloc/memset"

This patch is a fixup for

	linux-next: 97a84f1203
	"Staging: unisys: Replace kmalloc/memset with kzalloc"

The ALLOC_CMDRSP #define is after transformation to kzalloc only a
rename for kzalloc and was completly removed.

Signed-off-by: Silvio F <silvio.fricke@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 16:22:27 -07:00
Ken Cox a771033659 Staging: unisys: visorutil: Clean up sparse warnings in visorutil code
Clean up code to get rid of sparse warnings.

Also fixed variable length arrays declared on the stack by removing
visor_hexDumpToBuffer() and using hex_dump_to_buffer() instead.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:46:36 -07:00
Andreea-Cristina Bernat 97a84f1203 Staging: unisys: Replace kmalloc/memset with kzalloc
This patch solves the Coccinelle warning: "kzalloc should be used instead of
kmalloc/memset".

Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-16 18:20:10 -07:00
Iulia Manda 56116b2b09 staging: unisys: visorutil: Use kzalloc instead of kmalloc with memset
Fix coccinelle warnings of better allocation by using kzalloc.
In these cases, kzalloc is preferred, as kmalloc may fail if it does not find
contiguous memory.

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-13 16:49:02 -07:00
Ken Cox 927c7927ee staging: unisys: Give exported symbols unique names
Many exported symbols had very generic names.  This commit changes the names
so that they will be unique.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 12:01:49 -08:00
Ken Cox 0d776fa465 staging: unisys: remove unreferenced utility functions.
A number of functions were used for debug at one time but that code has been
removed.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 12:01:49 -08:00
Ken Cox 9d9baadd40 staging: visorutil driver to provide common functionality to other s-Par drivers
The visorutil module is a support library required by all other s-Par
driver modules. Among its features it abstracts reading, writing, and
manipulating a block of memory.

Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04 16:52:12 -08:00