diff mbox series

[v2,20/37] kasan: rename tags.c to tags_sw.c

Message ID 28d17537bbd029104cf7de4f7ca92246449efa50.1600204505.git.andreyknvl@google.com (mailing list archive)
State New, archived
Headers show
Series kasan: add hardware tag-based mode for arm64 | expand

Commit Message

Andrey Konovalov Sept. 15, 2020, 9:16 p.m. UTC
This is a preparatory commit for the upcoming addition of a new hardware
tag-based (MTE-based) KASAN mode.

Hardware tag-based KASAN will also be using tag-based approach, so rename
tags.c to tags_sw.c and report_tags.c to report_tags_sw.c to avoid
confusion once the new mode is added

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
Change-Id: I922ab246c5903e8ce3dd3766b923aaf250599850
---
 mm/kasan/Makefile                            | 10 +++++-----
 mm/kasan/{report_tags.c => report_tags_sw.c} |  0
 mm/kasan/{tags.c => tags_sw.c}               |  0
 3 files changed, 5 insertions(+), 5 deletions(-)
 rename mm/kasan/{report_tags.c => report_tags_sw.c} (100%)
 rename mm/kasan/{tags.c => tags_sw.c} (100%)

Comments

Alexander Potapenko Sept. 18, 2020, 9:41 a.m. UTC | #1
On Tue, Sep 15, 2020 at 11:17 PM Andrey Konovalov <andreyknvl@google.com> wrote:
>
> This is a preparatory commit for the upcoming addition of a new hardware
> tag-based (MTE-based) KASAN mode.
>
> Hardware tag-based KASAN will also be using tag-based approach, so rename
> tags.c to tags_sw.c and report_tags.c to report_tags_sw.c to avoid
> confusion once the new mode is added

I find it a bit excessive renaming the same file twice in the same
patch series (tags_report.c -> report_tags.c -> report_tags_sw.c)
Alexander Potapenko Sept. 18, 2020, 9:44 a.m. UTC | #2
On Fri, Sep 18, 2020 at 11:41 AM Alexander Potapenko <glider@google.com> wrote:
>
> On Tue, Sep 15, 2020 at 11:17 PM Andrey Konovalov <andreyknvl@google.com> wrote:
> >
> > This is a preparatory commit for the upcoming addition of a new hardware
> > tag-based (MTE-based) KASAN mode.
> >
> > Hardware tag-based KASAN will also be using tag-based approach, so rename
> > tags.c to tags_sw.c and report_tags.c to report_tags_sw.c to avoid
> > confusion once the new mode is added
>
> I find it a bit excessive renaming the same file twice in the same
> patch series (tags_report.c -> report_tags.c -> report_tags_sw.c)

Also, as we are going to have CONFIG_KASAN_{SW,HW}_TAGS, won't it be
better to call the files {report_,}tags_{sw,hw}.c ?
Alexander Potapenko Sept. 18, 2020, 9:46 a.m. UTC | #3
> Also, as we are going to have CONFIG_KASAN_{SW,HW}_TAGS, won't it be
> better to call the files {report_,}tags_{sw,hw}.c ?

Sorry for the typo, I meant "{report_,}{sw,hw}_tags.c, mirroring the
config names.
Andrey Konovalov Sept. 18, 2020, 10:42 a.m. UTC | #4
On Fri, Sep 18, 2020 at 11:46 AM Alexander Potapenko <glider@google.com> wrote:
>
> > Also, as we are going to have CONFIG_KASAN_{SW,HW}_TAGS, won't it be
> > better to call the files {report_,}tags_{sw,hw}.c ?
>
> Sorry for the typo, I meant "{report_,}{sw,hw}_tags.c, mirroring the
> config names.

The idea here was to have common prefixes for similar parts, therefore
I put "tags" first, so "tags_sw.c" comes next to "tags_hw.c" when one
is running "ls". But I can rename them if you think it makes sense.
diff mbox series

Patch

diff --git a/mm/kasan/Makefile b/mm/kasan/Makefile
index b2596512421a..0789f9023884 100644
--- a/mm/kasan/Makefile
+++ b/mm/kasan/Makefile
@@ -10,9 +10,9 @@  CFLAGS_REMOVE_init.o = $(CC_FLAGS_FTRACE)
 CFLAGS_REMOVE_quarantine.o = $(CC_FLAGS_FTRACE)
 CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE)
 CFLAGS_REMOVE_report_generic.o = $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_report_tags.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_report_tags_sw.o = $(CC_FLAGS_FTRACE)
 CFLAGS_REMOVE_shadow.o = $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_tags.o = $(CC_FLAGS_FTRACE)
+CFLAGS_REMOVE_tags_sw.o = $(CC_FLAGS_FTRACE)
 
 # Function splitter causes unnecessary splits in __asan_load1/__asan_store1
 # see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63533
@@ -27,10 +27,10 @@  CFLAGS_init.o := $(CC_FLAGS_KASAN_RUNTIME)
 CFLAGS_quarantine.o := $(CC_FLAGS_KASAN_RUNTIME)
 CFLAGS_report.o := $(CC_FLAGS_KASAN_RUNTIME)
 CFLAGS_report_generic.o := $(CC_FLAGS_KASAN_RUNTIME)
-CFLAGS_report_tags.o := $(CC_FLAGS_KASAN_RUNTIME)
+CFLAGS_report_tags_sw.o := $(CC_FLAGS_KASAN_RUNTIME)
 CFLAGS_shadow.o := $(CC_FLAGS_KASAN_RUNTIME)
-CFLAGS_tags.o := $(CC_FLAGS_KASAN_RUNTIME)
+CFLAGS_tags_sw.o := $(CC_FLAGS_KASAN_RUNTIME)
 
 obj-$(CONFIG_KASAN) := common.o report.o
 obj-$(CONFIG_KASAN_GENERIC) += init.o generic.o report_generic.o shadow.o quarantine.o
-obj-$(CONFIG_KASAN_SW_TAGS) += init.o report_tags.o shadow.o tags.o
+obj-$(CONFIG_KASAN_SW_TAGS) += init.o report_tags_sw.o shadow.o tags_sw.o
diff --git a/mm/kasan/report_tags.c b/mm/kasan/report_tags_sw.c
similarity index 100%
rename from mm/kasan/report_tags.c
rename to mm/kasan/report_tags_sw.c
diff --git a/mm/kasan/tags.c b/mm/kasan/tags_sw.c
similarity index 100%
rename from mm/kasan/tags.c
rename to mm/kasan/tags_sw.c