From mboxrd@z Thu Jan 1 00:00:00 1970 From: Doug Ledford Date: Mon, 09 Oct 2017 17:12:31 +0000 Subject: Re: [PATCH] IB/core: remove redundant check on prot_sg_cnt Message-Id: <1507569151.46071.48.camel@redhat.com> List-Id: References: <20171009161200.4465-1-colin.king@canonical.com> In-Reply-To: <20171009161200.4465-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Colin King , Sean Hefty , Hal Rosenstock , "J . Bruce Fields" , Chuck Lever , linux-rdma@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org On Mon, 2017-10-09 at 17:12 +0100, Colin King wrote: > From: Colin Ian King > > prot_sg_cnt cannot be zero as a previous check on ret (from which > prot_sg_cnt is assigned) returns -ENOMEM if is it zero. Since > it cannot be zero we can simplify the code by removing the non > -zero check on prot_sg_cnt and redundant else statement. > > Detected by CoverityScan, COD#1357188 ("Logically dead code") > > Signed-off-by: Colin Ian King Thanks, applied. -- Doug Ledford GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD From mboxrd@z Thu Jan 1 00:00:00 1970 From: Doug Ledford Subject: Re: [PATCH] IB/core: remove redundant check on prot_sg_cnt Date: Mon, 09 Oct 2017 13:12:31 -0400 Message-ID: <1507569151.46071.48.camel@redhat.com> References: <20171009161200.4465-1-colin.king@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20171009161200.4465-1-colin.king@canonical.com> Sender: linux-kernel-owner@vger.kernel.org To: Colin King , Sean Hefty , Hal Rosenstock , "J . Bruce Fields" , Chuck Lever , linux-rdma@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-rdma@vger.kernel.org On Mon, 2017-10-09 at 17:12 +0100, Colin King wrote: > From: Colin Ian King > > prot_sg_cnt cannot be zero as a previous check on ret (from which > prot_sg_cnt is assigned) returns -ENOMEM if is it zero. Since > it cannot be zero we can simplify the code by removing the non > -zero check on prot_sg_cnt and redundant else statement. > > Detected by CoverityScan, COD#1357188 ("Logically dead code") > > Signed-off-by: Colin Ian King Thanks, applied. -- Doug Ledford GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD