From: ritvikfoss@gmail.com
To: shuah@kernel.org
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
skhan@linuxfoundation.org,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: [PATCH] selftests/mount: Explicitly define buffer size
Date: Sat, 22 Feb 2025 13:47:11 +0530 [thread overview]
Message-ID: <20250222081711.48208-1-ritvikfoss@gmail.com> (raw)
From: Ritvik Gupta <ritvikfoss@gmail.com>
Define macro ('MAX_BUF_SIZE') for buffer size
instead of hardcoded value '4096', to improve
readability.
Signed-off-by: Ritvik Gupta <ritvikfoss@gmail.com>
---
tools/testing/selftests/mount/unprivileged-remount-test.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/mount/unprivileged-remount-test.c b/tools/testing/selftests/mount/unprivileged-remount-test.c
index d2917054fe3a..67a550b7c69b 100644
--- a/tools/testing/selftests/mount/unprivileged-remount-test.c
+++ b/tools/testing/selftests/mount/unprivileged-remount-test.c
@@ -45,6 +45,8 @@
# define MS_STRICTATIME (1 << 24)
#endif
+#define MAX_BUF_SIZE 4096
+
static void die(char *fmt, ...)
{
va_list ap;
@@ -56,7 +58,7 @@ static void die(char *fmt, ...)
static void vmaybe_write_file(bool enoent_ok, char *filename, char *fmt, va_list ap)
{
- char buf[4096];
+ char buf[MAX_BUF_SIZE];
int fd;
ssize_t written;
int buf_len;
--
2.48.1
next reply other threads:[~2025-02-22 8:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-22 8:17 ritvikfoss [this message]
2025-02-22 8:36 ` [PATCH] selftests/mount: Explicitly define buffer size Greg KH
2025-02-22 9:30 ` Ritvik Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250222081711.48208-1-ritvikfoss@gmail.com \
--to=ritvikfoss@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.