From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Thu, 07 Nov 2013 07:42:32 +0000 Subject: [patch] ocfs2: remove some impossible checks Message-Id: <20131107074232.GC21844@elgon.mountain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ocfs2-devel@oss.oracle.com pv_major and pv_minor are unsigned char type so these checks are just noise. Signed-off-by: Dan Carpenter diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 4599de7..eca3f93 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -808,11 +808,7 @@ static int lvb_to_version(char *lvb, struct ocfs2_protocol_version *ver) &ocfs2_user_plugin.sp_max_proto; memcpy(&pv, lvb, sizeof(struct ocfs2_protocol_version)); - if ((pv.pv_major = LONG_MIN) || (pv.pv_major = LONG_MAX) || - (pv.pv_major > (u8)-1) || (pv.pv_major < 1)) - return -ERANGE; - if ((pv.pv_minor = LONG_MIN) || (pv.pv_minor = LONG_MAX) || - (pv.pv_minor > (u8)-1) || (pv.pv_minor < 0)) + if (pv.pv_major < 1) return -ERANGE; if ((pv.pv_major != max->pv_major) || (pv.pv_minor > max->pv_minor)) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Thu, 7 Nov 2013 10:42:32 +0300 Subject: [Ocfs2-devel] [patch] ocfs2: remove some impossible checks Message-ID: <20131107074232.GC21844@elgon.mountain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ocfs2-devel@oss.oracle.com pv_major and pv_minor are unsigned char type so these checks are just noise. Signed-off-by: Dan Carpenter diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 4599de7..eca3f93 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -808,11 +808,7 @@ static int lvb_to_version(char *lvb, struct ocfs2_protocol_version *ver) &ocfs2_user_plugin.sp_max_proto; memcpy(&pv, lvb, sizeof(struct ocfs2_protocol_version)); - if ((pv.pv_major == LONG_MIN) || (pv.pv_major == LONG_MAX) || - (pv.pv_major > (u8)-1) || (pv.pv_major < 1)) - return -ERANGE; - if ((pv.pv_minor == LONG_MIN) || (pv.pv_minor == LONG_MAX) || - (pv.pv_minor > (u8)-1) || (pv.pv_minor < 0)) + if (pv.pv_major < 1) return -ERANGE; if ((pv.pv_major != max->pv_major) || (pv.pv_minor > max->pv_minor))