Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1166962AbdD2Pt5 (ORCPT ); Sat, 29 Apr 2017 11:49:57 -0400 Received: from mail.CARNet.hr ([161.53.123.6]:59643 "EHLO mail.carnet.hr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161076AbdD2Ptu (ORCPT ); Sat, 29 Apr 2017 11:49:50 -0400 From: Valentin Vidic To: Oleg Drokin , Andreas Dilger , James Simmons , Greg Kroah-Hartman , lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Valentin Vidic Date: Sat, 29 Apr 2017 17:49:00 +0200 Message-Id: <20170429154900.25819-1-Valentin.Vidic@CARNet.hr> X-Mailer: git-send-email 2.11.0 X-SA-Exim-Connect-IP: 161.53.12.131 Subject: [PATCH] staging: lustre: fix sparse warnings on assignment X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1667 Lines: 41 Fixes the following sparse warnings: drivers/staging/lustre/lustre/lmv/lmv_obd.c:2305:23: warning: invalid assignment: |= drivers/staging/lustre/lustre/lmv/lmv_obd.c:2305:23: left side has type restricted __le32 drivers/staging/lustre/lustre/lmv/lmv_obd.c:2305:23: right side has type int drivers/staging/lustre/lustre/lmv/lmv_obd.c:2383:39: warning: invalid assignment: |= drivers/staging/lustre/lustre/lmv/lmv_obd.c:2383:39: left side has type restricted __le32 drivers/staging/lustre/lustre/lmv/lmv_obd.c:2383:39: right side has type int Replaces one final conversion with two conversions on flag assignment. Signed-off-by: Valentin Vidic --- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 09b469243d73..4e6c1202a957 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -2302,7 +2302,7 @@ static int lmv_read_striped_page(struct obd_export *exp, dp = kmap(ent_page); memset(dp, 0, sizeof(*dp)); dp->ldp_hash_start = cpu_to_le64(offset); - dp->ldp_flags |= LDF_COLLIDE; + dp->ldp_flags |= cpu_to_le32(LDF_COLLIDE); area = dp + 1; left_bytes = PAGE_SIZE - sizeof(*dp); @@ -2380,8 +2380,7 @@ static int lmv_read_striped_page(struct obd_export *exp, ent_page = NULL; } else { if (ent == area) - dp->ldp_flags |= LDF_EMPTY; - dp->ldp_flags = cpu_to_le32(dp->ldp_flags); + dp->ldp_flags |= cpu_to_le32(LDF_EMPTY); dp->ldp_hash_end = cpu_to_le64(hash_offset); } -- 2.11.0