diff mbox

[OPW,kernel,07/10] staging: lustre: Fix incorrect type in assignment

Message ID 9e587915ec78c255796c2efad5fcba18e02c083b.1383233124.git.dulshani.gunawardhana89@gmail.com
State New, archived
Headers show

Commit Message

Dulshani Gunawardhana Oct. 31, 2013, 3:32 p.m. UTC
Fix the following sparse warings in local_storage.c.

drivers/staging/lustre/lustre/obdclass/local_storage.c:269:16: warning:
incorrect type in assignment (different base types)
drivers/staging/lustre/lustre/obdclass/local_storage.c:269:16:
expected unsigned long long [unsigned] [usertype] lastid
drivers/staging/lustre/lustre/obdclass/local_storage.c:269:16:    got
restricted __le64 [usertype] <noident>
drivers/staging/lustre/lustre/obdclass/local_storage.c:820:24: warning:
incorrect type in assignment (different base types)
drivers/staging/lustre/lustre/obdclass/local_storage.c:820:24:
expected unsigned long long [unsigned] [usertype] lastid
drivers/staging/lustre/lustre/obdclass/local_storage.c:820:24:    got
restricted __le64 [usertype] <noident>

Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
---
 drivers/staging/lustre/lustre/obdclass/local_storage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Greg Kroah-Hartman Oct. 31, 2013, 3:49 p.m. UTC | #1
On Thu, Oct 31, 2013 at 09:02:53PM +0530, Dulshani Gunawardhana wrote:
> Fix the following sparse warings in local_storage.c.
> 
> drivers/staging/lustre/lustre/obdclass/local_storage.c:269:16: warning:
> incorrect type in assignment (different base types)
> drivers/staging/lustre/lustre/obdclass/local_storage.c:269:16:
> expected unsigned long long [unsigned] [usertype] lastid
> drivers/staging/lustre/lustre/obdclass/local_storage.c:269:16:    got
> restricted __le64 [usertype] <noident>
> drivers/staging/lustre/lustre/obdclass/local_storage.c:820:24: warning:
> incorrect type in assignment (different base types)
> drivers/staging/lustre/lustre/obdclass/local_storage.c:820:24:
> expected unsigned long long [unsigned] [usertype] lastid
> drivers/staging/lustre/lustre/obdclass/local_storage.c:820:24:    got
> restricted __le64 [usertype] <noident>
> 
> Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
> ---
>  drivers/staging/lustre/lustre/obdclass/local_storage.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/obdclass/local_storage.c b/drivers/staging/lustre/lustre/obdclass/local_storage.c
> index cc19fba..46a4ecb 100644
> --- a/drivers/staging/lustre/lustre/obdclass/local_storage.c
> +++ b/drivers/staging/lustre/lustre/obdclass/local_storage.c
> @@ -266,7 +266,7 @@ int local_object_create(const struct lu_env *env,
>  
>  	/* update local oid number on disk so that
>  	 * we know the last one used after reboot */
> -	lastid = cpu_to_le64(los->los_last_oid);
> +	lastid = los->los_last_oid;

Same as before, you are changing the logic here, which isn't good.
Perhaps lastid should be __le64, right?

thanks,

greg k-h
diff mbox

Patch

diff --git a/drivers/staging/lustre/lustre/obdclass/local_storage.c b/drivers/staging/lustre/lustre/obdclass/local_storage.c
index cc19fba..46a4ecb 100644
--- a/drivers/staging/lustre/lustre/obdclass/local_storage.c
+++ b/drivers/staging/lustre/lustre/obdclass/local_storage.c
@@ -266,7 +266,7 @@  int local_object_create(const struct lu_env *env,
 
 	/* update local oid number on disk so that
 	 * we know the last one used after reboot */
-	lastid = cpu_to_le64(los->los_last_oid);
+	lastid = los->los_last_oid;
 
 	dti->dti_off = 0;
 	dti->dti_lb.lb_buf = &lastid;
@@ -817,7 +817,7 @@  int local_oid_storage_init(const struct lu_env *env, struct dt_device *dev,
 		if (rc)
 			GOTO(out_lock, rc);
 
-		lastid = cpu_to_le64(first_oid);
+		lastid = first_oid;
 
 		dti->dti_off = 0;
 		dti->dti_lb.lb_buf = &lastid;