Subject: [PATCH 0526/2944] lib: Remove redundant ftrace flag removal

From: Mark Rutland <[email-masked]>
Date: Tue, 6 Aug 2019 17:25:39 +0100

commit 41b57d1bb8a4084e651c1f9a754fca64952666a0 upstream.

Since architectures can implement ftrace using a variety of mechanisms,
generic code should always use CC_FLAGS_FTRACE rather than assuming that
ftrace is built using -pg.

Since commit:

  2464a609ded09420 ("ftrace: do not trace library functions")

... lib/Makefile has removed CC_FLAGS_FTRACE from KBUILD_CFLAGS, so ftrace is
disabled for all files under lib/.

Given that, we shouldn't explicitly remove -pg when building
lib/string.o, as this is redundant and bad form.

Clean things up accordingly.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <[email-masked]>
Signed-off-by: Borislav Petkov <[email-masked]>
Cc: Andrew Morton <[email-masked]>
Cc: Andy Shevchenko <[email-masked]>
Cc: Ard Biesheuvel <[email-masked]>
Cc: Arnd Bergmann <[email-masked]>
Cc: Coly Li <[email-masked]>
Cc: Gary R Hook <[email-masked]>
Cc: Ingo Molnar <[email-masked]>
Cc: Kees Cook <[email-masked]>
Cc: Kent Overstreet <[email-masked]>
Cc: Masahiro Yamada <[email-masked]>
Cc: Matthew Wilcox <[email-masked]>
Link: https://lkml.kernel.org/r/[email-masked]
Signed-off-by: Zou Cao<[email-masked]>
Acked-by: Baoyou Xie <[email-masked]>
---
 lib/Makefile | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/lib/Makefile b/lib/Makefile
index 0ab8083..990fcf9 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -21,10 +21,6 @@ KCOV_INSTRUMENT_dynamic_debug.o := n
 ifdef CONFIG_AMD_MEM_ENCRYPT
 KASAN_SANITIZE_string.o := n
 
-ifdef CONFIG_FUNCTION_TRACER
-CFLAGS_REMOVE_string.o = -pg
-endif
-
 CFLAGS_string.o := $(call cc-option, -fno-stack-protector)
 endif
 
-- 
1.8.3.1