Commit 2f3577d1 authored by Muhammad Usama Anjum's avatar Muhammad Usama Anjum Committed by Andrew Morton
Browse files

selftests/mm: thp_settings: remove const from return type

Patch series "selftest/mm: Remove warnings found by adding compiler flags".

Recently, I reviewed a patch on the mm/kselftest mailing list about a test
which had obvious type mismatch fix in it.  It was strange why that wasn't
caught during development and when patch was accepted.  This led me to
discover that those extra compiler options to catch these warnings aren't
being used.  When I added them, I found tens of warnings in just mm suite.

In this series, I'm fixing those warnings in a few files.  More fixes will
be sent later.


This patch (of 4):

Remove cost from the return type as it is ignored anyways and generates
the warning:

  warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

Link: https://lkml.kernel.org/r/20241209185624.2245158-1-usama.anjum@collabora.com
Link: https://lkml.kernel.org/r/20241209185624.2245158-2-usama.anjum@collabora.com


Signed-off-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent b487c024
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ int write_file(const char *path, const char *buf, size_t buflen)
	return (unsigned int) numwritten;
}

const unsigned long read_num(const char *path)
unsigned long read_num(const char *path)
{
	char buf[21];

@@ -172,7 +172,7 @@ void thp_write_string(const char *name, const char *val)
	}
}

const unsigned long thp_read_num(const char *name)
unsigned long thp_read_num(const char *name)
{
	char path[PATH_MAX];
	int ret;
+2 −2
Original line number Diff line number Diff line
@@ -64,12 +64,12 @@ struct thp_settings {

int read_file(const char *path, char *buf, size_t buflen);
int write_file(const char *path, const char *buf, size_t buflen);
const unsigned long read_num(const char *path);
unsigned long read_num(const char *path);
void write_num(const char *path, unsigned long num);

int thp_read_string(const char *name, const char * const strings[]);
void thp_write_string(const char *name, const char *val);
const unsigned long thp_read_num(const char *name);
unsigned long thp_read_num(const char *name);
void thp_write_num(const char *name, unsigned long num);

void thp_write_settings(struct thp_settings *settings);