From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752123AbdHHJ3S (ORCPT ); Tue, 8 Aug 2017 05:29:18 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44747 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbdHHJ3O (ORCPT ); Tue, 8 Aug 2017 05:29:14 -0400 From: Colin King To: Fenghua Yu , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] x86/intel_rdt: remove redundant ternary operator on return Date: Tue, 8 Aug 2017 10:28:59 +0100 Message-Id: <20170808092859.13021-1-colin.king@canonical.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The use of the ternary operator is redundant as ret can never be non-zero at that point. Instead, just return nbytes. Detected by CoverityScan, CID#1452658 ("Logically dead code") Signed-off-by: Colin Ian King --- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index 2621ae3f07fc..39006f36e695 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -680,7 +680,7 @@ static ssize_t max_threshold_occ_write(struct kernfs_open_file *of, intel_cqm_threshold = bytes / r->mon_scale; - return ret ?: nbytes; + return nbytes; } /* rdtgroup information files for one cache resource. */ -- 2.11.0