Skip to content

Commit

Permalink
tty: Remove private constant from global namespace
Browse files Browse the repository at this point in the history
TTY_BUFFER_PAGE is only used within drivers/tty/tty_buffer.c;
relocate to that file scope.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Hurley authored and Greg Kroah-Hartman committed Jul 23, 2013
1 parent a7c8d58 commit 9114fe8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
10 changes: 10 additions & 0 deletions drivers/tty/tty_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
*/
#define TTYB_MEM_LIMIT 65536

/*
* We default to dicing tty buffer allocations to this many characters
* in order to avoid multiple page allocations. We know the size of
* tty_buffer itself but it must also be taken into account that the
* the buffer is 256 byte aligned. See tty_buffer_find for the allocation
* logic this must match
*/

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


/**
* tty_buffer_lock_exclusive - gain exclusive access to buffer
Expand Down
11 changes: 0 additions & 11 deletions include/linux/tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,6 @@ static inline char *flag_buf_ptr(struct tty_buffer *b, int ofs)
return (char *)char_buf_ptr(b, ofs) + b->size;
}

/*
* We default to dicing tty buffer allocations to this many characters
* in order to avoid multiple page allocations. We know the size of
* tty_buffer itself but it must also be taken into account that the
* the buffer is 256 byte aligned. See tty_buffer_find for the allocation
* logic this must match
*/

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


struct tty_bufhead {
struct tty_buffer *head; /* Queue head */
struct work_struct work;
Expand Down

0 comments on commit 9114fe8

Please sign in to comment.