perf tools: Remove const from thread read accessors
The namespaces and comm fields of a thread are protected by rwsem and require write access for it. So it ended up using a cast to remove the const qualifier. Let's get rid of the const then. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Hari Bathini <hbathini@linux.vnet.ibm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Krister Johansen <kjlx@templeofstupid.com> Link: http://lkml.kernel.org/r/20190527061149.168640-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
a0c0a4ac02
commit
7cb10a08df
@@ -141,13 +141,13 @@ static struct namespaces *__thread__namespaces(const struct thread *thread)
|
||||
return list_first_entry(&thread->namespaces_list, struct namespaces, list);
|
||||
}
|
||||
|
||||
struct namespaces *thread__namespaces(const struct thread *thread)
|
||||
struct namespaces *thread__namespaces(struct thread *thread)
|
||||
{
|
||||
struct namespaces *ns;
|
||||
|
||||
down_read((struct rw_semaphore *)&thread->namespaces_lock);
|
||||
down_read(&thread->namespaces_lock);
|
||||
ns = __thread__namespaces(thread);
|
||||
up_read((struct rw_semaphore *)&thread->namespaces_lock);
|
||||
up_read(&thread->namespaces_lock);
|
||||
|
||||
return ns;
|
||||
}
|
||||
@@ -271,13 +271,13 @@ static const char *__thread__comm_str(const struct thread *thread)
|
||||
return comm__str(comm);
|
||||
}
|
||||
|
||||
const char *thread__comm_str(const struct thread *thread)
|
||||
const char *thread__comm_str(struct thread *thread)
|
||||
{
|
||||
const char *str;
|
||||
|
||||
down_read((struct rw_semaphore *)&thread->comm_lock);
|
||||
down_read(&thread->comm_lock);
|
||||
str = __thread__comm_str(thread);
|
||||
up_read((struct rw_semaphore *)&thread->comm_lock);
|
||||
up_read(&thread->comm_lock);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
Reference in New Issue
Block a user