mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] x86/intel_rdt: remove redundant ternary operator on return
@ 2017-08-08  9:28 Colin King
  2017-08-16 14:24 ` [tip:x86/cache] x86/intel_rdt: Remove " tip-bot for Colin Ian King
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-08-08  9:28 UTC (permalink / raw)
  To: Fenghua Yu, Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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 <colin.king@canonical.com>
---
 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:x86/cache] x86/intel_rdt: Remove redundant ternary operator on return
  2017-08-08  9:28 [PATCH][next] x86/intel_rdt: remove redundant ternary operator on return Colin King
@ 2017-08-16 14:24 ` tip-bot for Colin Ian King
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Colin Ian King @ 2017-08-16 14:24 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: colin.king, linux-kernel, vikas.shivappa, hpa, tglx, mingo, fenghua.yu

Commit-ID:  5707b46a4206be2068444eb6b514a1ee070651c8
Gitweb:     http://git.kernel.org/tip/5707b46a4206be2068444eb6b514a1ee070651c8
Author:     Colin Ian King <colin.king@canonical.com>
AuthorDate: Tue, 8 Aug 2017 10:28:59 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 16 Aug 2017 16:20:55 +0200

x86/intel_rdt: Remove redundant ternary operator on return

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 <colin.king@canonical.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Vikas Shivappa <vikas.shivappa@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: kernel-janitors@vger.kernel.org
Link: http://lkml.kernel.org/r/20170808092859.13021-1-colin.king@canonical.com
---
 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 b529f93..a869d4a 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. */

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-16 14:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08  9:28 [PATCH][next] x86/intel_rdt: remove redundant ternary operator on return Colin King
2017-08-16 14:24 ` [tip:x86/cache] x86/intel_rdt: Remove " tip-bot for Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome