mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefano Manni <stefano.manni@gmail.com>
To: Oleg Drokin <oleg.drokin@intel.com>,
	Andreas Dilger <andreas.dilger@intel.com>,
	James Simmons <jsimmons@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, stefano.manni@gmail.com
Subject: [PATCH 2/4] staging: lustre: fixed signedness of llite
Date: Wed, 22 Nov 2017 20:38:29 +0100	[thread overview]
Message-ID: <20171122193831.11801-3-stefano.manni@gmail.com> (raw)
In-Reply-To: <20171122193831.11801-1-stefano.manni@gmail.com>

sparse warnings on dir.c:
warning: incorrect type in argument 5 (different signedness)
expected unsigned int [usertype] *vallen
got int *<noident>

sparse warnings on llite_lib.c:
warning: incorrect type in argument 5 (different signedness)
expected unsigned int [usertype] *vallen
got int *<noident>

sparse warnings on lproc_llite.c:
warning: incorrect type in argument 2 (different signedness)
expected int *max_mdsize
got unsigned int *<noident>
warning: incorrect type in argument 2 (different signedness)
expected int *default_mdsize
got unsigned int *<noident>
warning: incorrect type in initializer (different signedness)
expected int *off_count
got unsigned int *<noident>
warning: incorrect type in initializer (different signedness)
expected int *process_count
got unsigned int *<noident>

Signed-off-by: Stefano Manni <stefano.manni@gmail.com>
---
 drivers/staging/lustre/lustre/llite/dir.c         |  3 ++-
 drivers/staging/lustre/lustre/llite/llite_lib.c   |  9 ++++++---
 drivers/staging/lustre/lustre/llite/lproc_llite.c | 14 ++++++--------
 3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 5b2e47c..ee6e8ef 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -1422,7 +1422,8 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	case LL_IOC_FLUSHCTX:
 		return ll_flush_ctx(inode);
 	case LL_IOC_GETOBDCOUNT: {
-		int count, vallen;
+		int count;
+		unsigned int vallen;
 		struct obd_export *exp;
 
 		if (copy_from_user(&count, (int __user *)arg, sizeof(int)))
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 8666f1e..6f82bff 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -159,7 +159,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
 	struct md_op_data *op_data;
 	struct lustre_md lmd;
 	u64 valid;
-	int size, err, checksum;
+	int err, checksum;
+	unsigned int size;
 
 	obd = class_name2obd(md);
 	if (!obd) {
@@ -571,7 +572,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
 
 int ll_get_max_mdsize(struct ll_sb_info *sbi, int *lmmsize)
 {
-	int size, rc;
+	int rc;
+	unsigned int size;
 
 	size = sizeof(*lmmsize);
 	rc = obd_get_info(NULL, sbi->ll_dt_exp, sizeof(KEY_MAX_EASIZE),
@@ -604,7 +606,8 @@ int ll_get_max_mdsize(struct ll_sb_info *sbi, int *lmmsize)
  */
 int ll_get_default_mdsize(struct ll_sb_info *sbi, int *lmmsize)
 {
-	int size, rc;
+	int rc;
+	unsigned int size;
 
 	size = sizeof(int);
 	rc = obd_get_info(NULL, sbi->ll_md_exp, sizeof(KEY_DEFAULT_EASIZE),
diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 644bea2..52dbd56 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -734,14 +734,13 @@ static ssize_t max_easize_show(struct kobject *kobj,
 {
 	struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
 					      ll_kobj);
-	unsigned int ealen;
-	int rc;
+	int rc, ealen;
 
 	rc = ll_get_max_mdsize(sbi, &ealen);
 	if (rc)
 		return rc;
 
-	return sprintf(buf, "%u\n", ealen);
+	return sprintf(buf, "%d\n", ealen);
 }
 LUSTRE_RO_ATTR(max_easize);
 
@@ -763,14 +762,13 @@ static ssize_t default_easize_show(struct kobject *kobj,
 {
 	struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
 					      ll_kobj);
-	unsigned int ealen;
-	int rc;
+	int rc, ealen;
 
 	rc = ll_get_default_mdsize(sbi, &ealen);
 	if (rc)
 		return rc;
 
-	return sprintf(buf, "%u\n", ealen);
+	return sprintf(buf, "%d\n", ealen);
 }
 
 /**
@@ -1479,8 +1477,8 @@ void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
 	int i, cur = -1;
 	struct ll_rw_process_info *process;
 	struct ll_rw_process_info *offset;
-	int *off_count = &sbi->ll_rw_offset_entry_count;
-	int *process_count = &sbi->ll_offset_process_count;
+	unsigned int *off_count = &sbi->ll_rw_offset_entry_count;
+	unsigned int *process_count = &sbi->ll_offset_process_count;
 	struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info;
 
 	if (!sbi->ll_rw_stats_on)
-- 
2.5.5

  parent reply	other threads:[~2017-11-22 19:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 19:38 [PATCH 0/4] staging: lustre: fixed some signedness warns from sparse Stefano Manni
2017-11-22 19:38 ` [PATCH 1/4] staging: lustre: fixed signedness of some socklnd params Stefano Manni
2017-11-23 12:13   ` Dan Carpenter
2017-11-23 23:47     ` Stefano Manni
2017-11-24 12:49       ` Dan Carpenter
2017-11-22 19:38 ` Stefano Manni [this message]
2017-11-22 19:38 ` [PATCH 3/4] staging: lustre: fixed signedness of lov Stefano Manni
2017-11-24 15:42   ` Greg Kroah-Hartman
2017-11-22 19:38 ` [PATCH 4/4] staging: lustre: fixed signedness of obdclass Stefano Manni
2017-11-23  4:59 ` [PATCH 0/4] staging: lustre: fixed some signedness warns from sparse Tobin C. Harding
2017-11-23 11:51   ` Dan Carpenter
2017-11-23 22:20     ` Tobin C. Harding
2017-11-23 23:32       ` Stefano Manni
2017-11-24 13:02       ` Dan Carpenter
2017-11-24 21:37         ` Tobin C. Harding

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=20171122193831.11801-3-stefano.manni@gmail.com \
    --to=stefano.manni@gmail.com \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.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

all inboxes | Powered by JetHome®