public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	virtualization@lists.osdl.org, Greg KH <greg@kroah.com>,
	Sam Ramji <sramji@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Hank Janssen <hjanssen@microsoft.com>,
	shemminger@linux-foundation.org
Subject: Re: [patch 27/54] Staging: hv: remove ULONG and LONG typedefs
Date: Mon, 20 Jul 2009 19:45:57 -0700	[thread overview]
Message-ID: <20090721024557.GA17242@suse.de> (raw)
In-Reply-To: <20090721023823.GA12154@suse.de>

On Mon, Jul 20, 2009 at 07:38:23PM -0700, Greg KH wrote:
> On Tue, Jul 21, 2009 at 02:00:16AM +0200, Arnd Bergmann wrote:
> > On Friday 17 July 2009, Greg Kroah-Hartman wrote:
> > > From: Greg Kroah-Hartman <gregkh@suse.de>
> > > 
> > > The ULONG and LONG typedefs are now removed from the Hyper-V driver
> > > code
> > > 
> > 
> > This conversion is not equivalent:
> > 
> > >  //
> > > -// unsigned types
> > > -//
> > > -typedef unsigned int		ULONG;
> > > -
> > > -//
> > > -// signed types
> > > -//
> > > -typedef int					LONG;
> > 
> > - // redefine the world, because we can
> > - extern char *i;
> > - void abs(unsigned u);
> > - #define FALSE (2)
> > 
> > ;-)
> > 
> > > --- a/drivers/staging/hv/include/StorVscApi.h
> > > +++ b/drivers/staging/hv/include/StorVscApi.h
> > > @@ -117,7 +117,7 @@ typedef struct _STORVSC_DRIVER_OBJECT {
> > >  } STORVSC_DRIVER_OBJECT;
> > >  
> > >  typedef struct _STORVSC_DEVICE_INFO {
> > > -	ULONG	PortNumber;
> > > +	unsigned long	PortNumber;
> > >      unsigned char	PathId;
> > >      unsigned char	TargetId;
> > >  } STORVSC_DEVICE_INFO;
> > 
> > If this is an API (as the header file name suggests), you just changed it.
> > Same for the other hunks in this patch.
> 
> Ah crap, you're right, that's all wrong, nice catch.
> 
> I'll go redo it to be "unsigned int", but for some reason, the code
> still seems to work properly :)

Ok, here's the updated version.  Thanks for the review.

Hank, a lot of these should probably be converted to "real" kernel
types, like u32, or u64 if it's really needed.  Especially if they are
crossing the kernel/hypervisor boundry.

thanks,

greg k-h

-------------
From: Greg Kroah-Hartman <gregkh@suse.de>
Subject: Staging: hv: remove ULONG and LONG typedefs

From: Greg Kroah-Hartman <gregkh@suse.de>

The ULONG and LONG typedefs are now removed from the Hyper-V driver
code.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/staging/hv/StorVsc.c            |    2 +-
 drivers/staging/hv/include/StorVscApi.h |    2 +-
 drivers/staging/hv/include/osd.h        |   10 ----------
 drivers/staging/hv/include/vstorage.h   |   12 ++++++------
 4 files changed, 8 insertions(+), 18 deletions(-)

--- a/drivers/staging/hv/StorVsc.c
+++ b/drivers/staging/hv/StorVsc.c
@@ -62,7 +62,7 @@ typedef struct _STORVSC_DEVICE{
 
 	//  Each unique Port/Path/Target represents 1 channel ie scsi controller. In reality, the pathid, targetid is always 0
 	// and the port is set by us
-	ULONG						PortNumber;
+	unsigned int						PortNumber;
     unsigned char						PathId;
     unsigned char						TargetId;
 
--- a/drivers/staging/hv/include/StorVscApi.h
+++ b/drivers/staging/hv/include/StorVscApi.h
@@ -117,7 +117,7 @@ typedef struct _STORVSC_DRIVER_OBJECT {
 } STORVSC_DRIVER_OBJECT;
 
 typedef struct _STORVSC_DEVICE_INFO {
-	ULONG	PortNumber;
+	unsigned int	PortNumber;
     unsigned char	PathId;
     unsigned char	TargetId;
 } STORVSC_DEVICE_INFO;
--- a/drivers/staging/hv/include/osd.h
+++ b/drivers/staging/hv/include/osd.h
@@ -95,16 +95,6 @@ typedef struct _DLIST_ENTRY {
 } DLIST_ENTRY;
 
 //
-// unsigned types
-//
-typedef unsigned int		ULONG;
-
-//
-// signed types
-//
-typedef int					LONG;
-
-//
 // Other types
 //
 typedef unsigned long		SIZE_T;
--- a/drivers/staging/hv/include/vstorage.h
+++ b/drivers/staging/hv/include/vstorage.h
@@ -155,7 +155,7 @@ typedef struct
     unsigned char DataIn;
     unsigned char Reserved;
 
-    ULONG DataTransferLength;
+    unsigned int DataTransferLength;
 
     union
     {
@@ -185,11 +185,11 @@ typedef struct
     //
     // Note: port number is only really known on the client side
     //
-    ULONG  PortNumber;
+    unsigned int  PortNumber;
 
-    ULONG  Flags;
+    unsigned int  Flags;
 
-    ULONG  MaxTransferBytes;
+    unsigned int  MaxTransferBytes;
 
     //
     //  This id is unique for each channel and will correspond with
@@ -249,13 +249,13 @@ typedef struct _VSTOR_PACKET
     //  Flags - see below for values
     //
 
-    ULONG     Flags;
+    unsigned int     Flags;
 
     //
     // Status of the request returned from the server side.
     //
 
-    ULONG     Status;
+    unsigned int     Status;
 
     //
     // Data payload area

  reply	other threads:[~2009-07-21  2:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090717180850.873962925@mini.kroah.org>
     [not found] ` <20090717180923.620590305@mini.kroah.org>
2009-07-20 23:39   ` [patch 47/54] Staging: hv: make gVmbusConnection.ChannelLock a real spinlock Arnd Bergmann
2009-07-21  2:11     ` Greg KH
     [not found] ` <20090717180921.448023599@mini.kroah.org>
2009-07-20 23:46   ` [patch 34/54] Staging: hv: remove STRUCT_PACKED and STRUCT_ALIGNED defines Arnd Bergmann
2009-07-24 21:32     ` Jörn Engel
2009-07-24 21:50       ` Stephen Hemminger
2009-07-24 23:06         ` Jörn Engel
     [not found] ` <20090717180920.285605541@mini.kroah.org>
2009-07-21  0:00   ` [patch 27/54] Staging: hv: remove ULONG and LONG typedefs Arnd Bergmann
2009-07-21  0:44     ` Hank Janssen
2009-07-21  2:38     ` Greg KH
2009-07-21  2:45       ` Greg KH [this message]
2009-07-21  8:26     ` Bernd Petrovitsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090721024557.GA17242@suse.de \
    --to=gregkh@suse.de \
    --cc=arnd@arndb.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=greg@kroah.com \
    --cc=haiyangz@microsoft.com \
    --cc=hjanssen@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    --cc=sramji@microsoft.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=virtualization@lists.osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox