lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/2] tty: Cleanup tty buffer align mask
Date
Don't use decimal for mask. Don't use literal for aligning.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/tty/tty_buffer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index b408d830fcbc..2df86ed90574 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -21,7 +21,7 @@
#include "tty.h"

#define MIN_TTYB_SIZE 256
-#define TTYB_ALIGN_MASK 255
+#define TTYB_ALIGN_MASK 0xff

/*
* Byte threshold to limit memory consumption for flip buffers.
@@ -37,7 +37,7 @@
* logic this must match.
*/

-#define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF)
+#define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~TTYB_ALIGN_MASK)

/**
* tty_buffer_lock_exclusive - gain exclusive access to buffer
--
2.30.2
\
 
 \ /
  Last update: 2022-10-19 13:50    [W:0.083 / U:1.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site