All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: Tao Ma <tao.ma@oracle.com>, Joel Becker <joel.becker@oracle.com>,
	ocfs2-devel@oss.oracle.com
Cc: Mark Fasheh <mfasheh@suse.com>,
	linux-kernel@vger.kernel.org,
	Goldwyn Rodrigues <rgoldwyn@suse.de>
Subject: [Ocfs2-devel] ocfs2: char is not always signed
Date: Thu, 18 Nov 2010 04:20:23 -0000	[thread overview]
Message-ID: <1290054011_17741@mail4.comsite.net> (raw)

Commit 1c66b360fe262 (Change some lock status member in ocfs2_lock_res
to char.)  states that these fields need to be signed due to comparision
to -1, but only changed the type from unsigned char to char.   However, it
is a compiler option if char is a signed or unsigned type.  Change these
fields to signed char so the code will work with all compilers.

Signed-off-by: Milton Miller <miltonm@bga.com>
---
I did not look for other fields that might be char.  PowerPC compilers
default to unsigned char, and aparently arm does as well from a quick
google search, to name two examples.

diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 1efea36..70dd3b1 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -159,9 +159,9 @@ struct ocfs2_lock_res {
 	char                     l_name[OCFS2_LOCK_ID_MAX_LEN];
 	unsigned int             l_ro_holders;
 	unsigned int             l_ex_holders;
-	char			 l_level;
-	char			 l_requested;
-	char			 l_blocking;
+	signed char		 l_level;
+	signed char		 l_requested;
+	signed char		 l_blocking;
 
 	/* Data packed - type enum ocfs2_lock_type */
 	unsigned char            l_type;

WARNING: multiple messages have this Message-ID (diff)
From: Milton Miller <miltonm@bga.com>
To: Tao Ma <tao.ma@oracle.com>, Joel Becker <joel.becker@oracle.com>,
	<ocfs2-devel@oss.oracle.com>
Cc: Mark Fasheh <mfasheh@suse.com>, <linux-kernel@vger.kernel.org>,
	Goldwyn Rodrigues <rgoldwyn@suse.de>
Subject: ocfs2: char is not always signed
Date: Wed, 17 Nov 2010 22:20:11 -0600	[thread overview]
Message-ID: <1290054011_17741@mail4.comsite.net> (raw)

Commit 1c66b360fe262 (Change some lock status member in ocfs2_lock_res
to char.)  states that these fields need to be signed due to comparision
to -1, but only changed the type from unsigned char to char.   However, it
is a compiler option if char is a signed or unsigned type.  Change these
fields to signed char so the code will work with all compilers.

Signed-off-by: Milton Miller <miltonm@bga.com>
---
I did not look for other fields that might be char.  PowerPC compilers
default to unsigned char, and aparently arm does as well from a quick
google search, to name two examples.

diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 1efea36..70dd3b1 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -159,9 +159,9 @@ struct ocfs2_lock_res {
 	char                     l_name[OCFS2_LOCK_ID_MAX_LEN];
 	unsigned int             l_ro_holders;
 	unsigned int             l_ex_holders;
-	char			 l_level;
-	char			 l_requested;
-	char			 l_blocking;
+	signed char		 l_level;
+	signed char		 l_requested;
+	signed char		 l_blocking;
 
 	/* Data packed - type enum ocfs2_lock_type */
 	unsigned char            l_type;

             reply	other threads:[~2010-11-18  4:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18  4:20 Milton Miller [this message]
2010-11-18  4:20 ` [Ocfs2-devel] ocfs2: char is not always signed Milton Miller
2010-11-18  5:40 ` Tao Ma
2010-11-18  5:40   ` Tao Ma
2010-11-18 23:43 ` [Ocfs2-devel] " Joel Becker
2010-11-18 23:43   ` Joel Becker

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=1290054011_17741@mail4.comsite.net \
    --to=miltonm@bga.com \
    --cc=joel.becker@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=rgoldwyn@suse.de \
    --cc=tao.ma@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.