From: Steve Magnani <steve.magnani@digidescorp.com>
To: Jan Kara <jack@suse.com>, linux-kernel@vger.kernel.org
Cc: "Steven J . Magnani" <steve@digidescorp.com>
Subject: [PATCH v2 3/3] udf: Fix some sign-conversion warnings
Date: Thu, 12 Oct 2017 08:48:42 -0500 [thread overview]
Message-ID: <1507816122-19405-4-git-send-email-steve@digidescorp.com> (raw)
In-Reply-To: <1507816122-19405-1-git-send-email-steve@digidescorp.com>
Fix some warnings that appear when compiling with -Wconversion.
A sub-optimal choice of variable type leads to warnings about
conversion in both directions between unsigned and signed.
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
---
diff -uprN a/fs/udf/directory.c b/fs/udf/directory.c
--- a/fs/udf/directory.c 2017-10-07 16:46:37.694130197 -0500
+++ b/fs/udf/directory.c 2017-10-11 12:02:27.226674863 -0500
@@ -52,7 +52,7 @@ struct fileIdentDesc *udf_fileident_read
}
if (fibh->eoffset == dir->i_sb->s_blocksize) {
- int lextoffset = epos->offset;
+ uint32_t lextoffset = epos->offset;
unsigned char blocksize_bits = dir->i_sb->s_blocksize_bits;
if (udf_next_aext(dir, epos, eloc, elen, 1) !=
@@ -111,7 +111,7 @@ struct fileIdentDesc *udf_fileident_read
memcpy((uint8_t *)cfi, (uint8_t *)fi,
sizeof(struct fileIdentDesc));
} else if (fibh->eoffset > dir->i_sb->s_blocksize) {
- int lextoffset = epos->offset;
+ uint32_t lextoffset = epos->offset;
if (udf_next_aext(dir, epos, eloc, elen, 1) !=
(EXT_RECORDED_ALLOCATED >> 30))
diff -uprN a/fs/udf/inode.c b/fs/udf/inode.c
--- a/fs/udf/inode.c 2017-10-07 16:46:37.694130197 -0500
+++ b/fs/udf/inode.c 2017-10-11 12:49:03.972233635 -0500
@@ -480,7 +480,7 @@ static int udf_do_extend_file(struct ino
int count = 0, fake = !(last_ext->extLength & UDF_EXTENT_LENGTH_MASK);
struct super_block *sb = inode->i_sb;
struct kernel_lb_addr prealloc_loc = {};
- int prealloc_len = 0;
+ uint32_t prealloc_len = 0;
struct udf_inode_info *iinfo;
int err;
@@ -1193,7 +1193,7 @@ int udf_setsize(struct inode *inode, lof
{
int err;
struct udf_inode_info *iinfo;
- int bsize = i_blocksize(inode);
+ unsigned int bsize = i_blocksize(inode);
if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
S_ISLNK(inode->i_mode)))
prev parent reply other threads:[~2017-10-12 13:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 13:48 [PATCH v2 0/3] udf: Fix some signed/unsigned conversion issues Steve Magnani
2017-10-12 13:48 ` [PATCH v2 1/3] udf: Fix 64-bit sign extension issues affecting blocks > 0x7FFFFFFF Steve Magnani
2017-10-16 14:17 ` Jan Kara
2017-10-16 19:20 ` Steve Magnani
2017-10-12 13:48 ` [PATCH v2 2/3] udf: Fix signed/unsigned format specifiers Steve Magnani
2017-10-12 13:48 ` Steve Magnani [this message]
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=1507816122-19405-4-git-send-email-steve@digidescorp.com \
--to=steve.magnani@digidescorp.com \
--cc=jack@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=steve@digidescorp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome