Commit Graph

34 Commits

Author SHA1 Message Date
Greg Kroah-Hartman 2acadc269f Staging: hv: remove DPRINT_ENTER macro
We have ftrace to look at function traces if its really
needed.  Don't roll custom macros for this.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 15:00:18 -07:00
Tobias Klauser 15f0beb169 Staging: hv: Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 09:22:28 -07:00
Greg Kroah-Hartman 2d82f6c734 Staging: hv: rename VersionInfo.h to version_info.h
The great renaming of the hv code is now complete.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:18 -07:00
Bill Pemberton a3810b0ef6 staging: hv: remove ASSERT()s in vmbus_drv.c
These ASSERT()s serve no purpose other than for debugging.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:36:15 -07:00
Lars Lindley 0686e4f4a2 Staging: hv: trivial whitespace fixes found by checkpatch.pl
Signed-off-by: Lars Lindley <lindley@coyote.org>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:36 -07:00
Hank Janssen 3e18951955 staging: hv: Corrected all header comment formats kernel-doc format
Removed kerneldoc /** from functions that should not have them.
Added proper kerneldoc headers to functions that should have them.

This includes fixes as pointed out by Randy Dunlap and Joe Perches.

Cc: Joe Perches <joe@perches.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:32 -07:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Greg Kroah-Hartman c22090facd Staging: hv: match on DMI values to know if we should run.
The HV core mucks around with specific irqs and other low-level stuff
and takes forever to determine that it really shouldn't be running on a
machine.  So instead, trigger off of the DMI system information and
error out much sooner.  This also allows the module loading tools to
recognize that this code should be loaded on this type of system.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:37 -08:00
Greg Kroah-Hartman 9a775dbd4e Staging: hv: add a pci device table
This allows the HV core to be properly found and autoloaded
by the system tools.

It uses the Microsoft virtual VGA device to trigger this.

Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:37 -08:00
Haiyang Zhang f916a34dc0 Staging: hv: Rename struct device_context and re-arrange the fields inside
Rename struct device_context and re-arrange the fields inside.

Rename struct device_context to struct vm_device, and move struct device
field to the end according to Document/driver-model standard.

Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:37 -08:00
Hank Janssen 26c14cc119 Staging: hv: Add proper versioning to HV drivers
Provide proper versioning information for all HV drivers.

With removal of build time/date/and Minor number as requested by Greg KH

Signed-off-by: Hank Janssen    <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang   <haiyang@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:37 -08:00
Milan Dadok 9fb5cce4d6 Staging: hv: fix oops in vmbus - udev events
Fix typos in udev event send and guid variables copy

Signed-off-by: Milan Dadok <milan@dadok.name>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-10-30 14:47:43 -07:00
Haiyang Zhang 1bb40a25b2 Staging: hv: Fix null pointer error after vmbus loading
Fix null pointer error after vmbus loading. Remove code that checks for
dev_name, the affected structure is kzalloc-ed prior to this routine, so
it is always null at this stage.

Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-10-30 14:47:43 -07:00
Greg Kroah-Hartman 21707bed7e Staging: hv: remove function pointer typedefs from vmbus.h
It's amazing the hoops that people go through to make code work
when they don't opensource the whole thing.  Passing these types
of function pointers around for no good reason is a mess, this needs
to be unwound as everything is now in the open.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:03 -07:00
Greg Kroah-Hartman 90c9960e20 Staging: hv: coding style cleanups for vmbus_drv.c
Almost clean.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:02 -07:00
Greg Kroah-Hartman 689bf40682 Staging: hv: warn the world of a bug in the release function
All device release functions need to do something, if not, it's a bug.
By merely providing an "empty" release function, it gets the kernel to
shut up, but that's not solving the problem at all.  Stick a big fat
WARN_ON(1); in there to get people's attention.


Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:02 -07:00
Greg Kroah-Hartman 645954c542 Staging: hv: move logging.h
Move it out of the include subdirectory.

No code changes here, just file movements.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:00 -07:00
Greg Kroah-Hartman ee3d7ddfe5 Staging: hv: typedef removal for VmbusApi.h
The function pointers still have ugly names, but the structures
are now cleaned up.

Note, a comment was added where the driver structure is pointing
at a problem that needs to be fixed up later in the code.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:58 -07:00
Greg Kroah-Hartman 870cde8086 Staging: hv: move vmbus.h
This moves vmbus.h from the include/ subdirectory.  It doesn't
belong there.

No code changes happened here.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:57 -07:00
Greg Kroah-Hartman daaa8cc31f Staging: hv: osd.h: fix GUID reference problem
As GUID was a typedef, it hid the fact that we were passing it
a 2 variables in functions.  This fixes this up by passing it
as a pointer, as it should be.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:56 -07:00
Greg Kroah-Hartman caf26a31b5 Staging: hv: osd.h: remove GUID typedef
GUID should not be a typedef.  As proof of the problem of typedefs,
look, we are passing 2 of these as a value in functions!  Bah...

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:56 -07:00
Greg Kroah-Hartman 4983b39a06 Staging: hv: move osd.h
This moves osd.h out of the include/ subdirectory.

No code changes are made here.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:56 -07:00
Bill Pemberton f488841708 Staging: hv: remove wrapper functions for atomic operations
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:53 -07:00
Greg Kroah-Hartman bd1de70916 Staging: hv: fix sparse static warnings
This fixes up all of the sparse warnings about static functions.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:52 -07:00
Nicolas Palix 775ef25e57 Staging: hv: Remove typedef DRIVER_OBJECT and PDRIVER_OBJECT
typedef DRIVER_OBJECT and PDRIVER_OBJECT are removed and their usages
are replace by the use of struct hv_driver and struct hv_driver *
respectively.

Here is the semantic patch generated to perform this transformation:
(http://coccinelle.lip6.fr/)

//<smpl>
@rm_DRIVER_OBJECT@
@@
-typedef struct _DRIVER_OBJECT
+struct hv_driver
{...}
-DRIVER_OBJECT
;

@rm_PDRIVER_OBJECT@
@@
-typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
+struct hv_driver;

@fixtypedef_DRIVER_OBJECT@
typedef DRIVER_OBJECT;
@@
-DRIVER_OBJECT
+struct hv_driver

@fixstruct__DRIVER_OBJECT@
@@
struct
-_DRIVER_OBJECT
+hv_driver

@fixtypedef_PDRIVER_OBJECT@
typedef PDRIVER_OBJECT;
@@
-PDRIVER_OBJECT
+struct hv_driver*
//</smpl>

Signed-off-by: Nicolas Palix <npalix@diku.dk>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:52 -07:00
Nicolas Palix 3d3b5518a3 Staging: hv: Transform PDEVICE_OBJECT and DEVICE_OBJECT typedefs into their corresponding structs
Remove typedef DEVICE_OBJECT and use a struct named hv_device instead.
Remove typedef PDEVICE_OBJECT which aliases a pointer and use
struct hv_device * instead.

Here is the semantic patch to perform this transformation:
(http://coccinelle.lip6.fr/)

//<smpl>
@rm_PDEVICE_OBJECT@
@@
-typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;

@rm_DEVICE_OBJECT@
@@
-typedef struct _DEVICE_OBJECT
+struct hv_device
{...}
-DEVICE_OBJECT
;

@fixtypedef_PDEVICE_OBJECT@
typedef PDEVICE_OBJECT;
@@
-PDEVICE_OBJECT
+struct hv_device*

@fixtypedef_DEVICE_OBJECT@
typedef DEVICE_OBJECT;
@@
-DEVICE_OBJECT
+struct hv_device

@fixstruct__DEVICE_OBJECT@
@@
struct
-_DEVICE_OBJECT
+hv_device
//</smpl>

Signed-off-by: Nicolas Palix <npalix@diku.dk>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:51 -07:00
Bill Pemberton 25fb66ce44 Staging: hv: vmbus_drv.c: remove unused structs
vmbus_ctl_table_hdr, vmbus_dev_ctl_table, vmbus_ctl_table, and
vmus_root_ctl_table were never used.  This removes them.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:51 -07:00
Bill Pemberton 5d48a1c202 Staging: hv: check return value of device_register()
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:51 -07:00
Bill Pemberton c19fbca307 Staging: hv: check return value of bus_register()
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:50 -07:00
Bill Pemberton b2aba7cc71 Staging: hv: vmbus_drv.c: fix print formatting
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:50 -07:00
Bill Pemberton 454f18a963 Staging: hv: Remove C99 comments
Remove C99 // comments with traditional /* */ comments

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:50 -07:00
Moritz Muehlenhoff c18b5aed9d Staging: hv: Remove compatibility ifdefry
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:49 -07:00
Greg Kroah-Hartman 09d50ff8a2 Staging: hv: make the Hyper-V virtual bus code build
The #define KERNEL_2_6_27 needs to be set, and I adjusted the include
directories a bit to get things to build properly.

I also fixed up the direct access of bus_id, as that field is now gone.

The hv_vmbus code should now build properly, with no errors.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:44 -07:00
Hank Janssen 3e7ee4902f Staging: hv: add the Hyper-V virtual bus
This is the virtual bus that all of the Linux Hyper-V drivers use.

Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:43 -07:00