From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754626AbdJIRMf (ORCPT ); Mon, 9 Oct 2017 13:12:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42970 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754151AbdJIRMd (ORCPT ); Mon, 9 Oct 2017 13:12:33 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AC1484E4C2 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dledford@redhat.com Message-ID: <1507569151.46071.48.camel@redhat.com> Subject: Re: [PATCH] IB/core: remove redundant check on prot_sg_cnt From: Doug Ledford 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 Date: Mon, 09 Oct 2017 13:12:31 -0400 In-Reply-To: <20171009161200.4465-1-colin.king@canonical.com> References: <20171009161200.4465-1-colin.king@canonical.com> Organization: Red Hat, Inc. Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 09 Oct 2017 17:12:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: 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