Skip to content

Commit ccc8900

Browse files
akpm00sfrothwell
authored andcommitted
mm-convert-totalram_pages-and-totalhigh_pages-variables-to-atomic-checkpatch-fixes
WARNING: 'lenght' may be misspelled - perhaps 'length'? torvalds#7: things. It was discussed in lenght here, WARNING: line over 80 characters torvalds#252: FILE: drivers/md/dm-crypt.c:2161: + unsigned long pages = (totalram_pages() - totalhigh_pages()) * DM_CRYPT_MEMORY_PERCENT / 100; WARNING: line over 80 characters torvalds#263: FILE: drivers/md/dm-integrity.c:2846: + if (journal_pages >= totalram_pages() - totalhigh_pages() || journal_desc_size > ULONG_MAX) { WARNING: line over 80 characters torvalds#307: FILE: drivers/parisc/ccio-dma.c:1254: + iova_space_size = (u32) (totalram_pages() / count_parisc_driver(&ccio_driver)); WARNING: please, no spaces at the start of a line torvalds#472: FILE: include/linux/highmem.h:47: + atomic_long_inc(&_totalhigh_pages);$ WARNING: please, no spaces at the start of a line torvalds#477: FILE: include/linux/highmem.h:52: + atomic_long_dec(&_totalhigh_pages);$ WARNING: please, no spaces at the start of a line torvalds#482: FILE: include/linux/highmem.h:57: + atomic_long_add(count, &_totalhigh_pages);$ WARNING: please, no spaces at the start of a line torvalds#487: FILE: include/linux/highmem.h:62: + atomic_long_set(&_totalhigh_pages, val);$ WARNING: please, no spaces at the start of a line torvalds#511: FILE: include/linux/mm.h:54: + return (unsigned long)atomic_long_read(&_totalram_pages);$ WARNING: please, no spaces at the start of a line torvalds#516: FILE: include/linux/mm.h:59: + atomic_long_inc(&_totalram_pages);$ WARNING: please, no spaces at the start of a line torvalds#521: FILE: include/linux/mm.h:64: + atomic_long_dec(&_totalram_pages);$ WARNING: please, no spaces at the start of a line torvalds#526: FILE: include/linux/mm.h:69: + atomic_long_add(count, &_totalram_pages);$ WARNING: please, no spaces at the start of a line torvalds#531: FILE: include/linux/mm.h:74: + atomic_long_set(&_totalram_pages, val);$ WARNING: line over 80 characters torvalds#722: FILE: mm/page_alloc.c:7288: + (physpages - totalram_pages() - totalcma_pages) << (PAGE_SHIFT - 10), WARNING: Missing a blank line after declarations torvalds#745: FILE: mm/shmem.c:118: + unsigned long nr_pages = totalram_pages(); + return min(nr_pages - totalhigh_pages(), nr_pages / 2); total: 0 errors, 15 warnings, 656 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. ./patches/mm-convert-totalram_pages-and-totalhigh_pages-variables-to-atomic.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Arun KS <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Stephen Rothwell <[email protected]>
1 parent 1be4cec commit ccc8900

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

include/linux/highmem.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,22 @@ static inline unsigned long totalhigh_pages(void)
4444

4545
static inline void totalhigh_pages_inc(void)
4646
{
47-
atomic_long_inc(&_totalhigh_pages);
47+
atomic_long_inc(&_totalhigh_pages);
4848
}
4949

5050
static inline void totalhigh_pages_dec(void)
5151
{
52-
atomic_long_dec(&_totalhigh_pages);
52+
atomic_long_dec(&_totalhigh_pages);
5353
}
5454

5555
static inline void totalhigh_pages_add(long count)
5656
{
57-
atomic_long_add(count, &_totalhigh_pages);
57+
atomic_long_add(count, &_totalhigh_pages);
5858
}
5959

6060
static inline void totalhigh_pages_set(long val)
6161
{
62-
atomic_long_set(&_totalhigh_pages, val);
62+
atomic_long_set(&_totalhigh_pages, val);
6363
}
6464

6565
void kmap_flush_unused(void);

include/linux/mm.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,27 @@ static inline void set_max_mapnr(unsigned long limit) { }
5151
extern atomic_long_t _totalram_pages;
5252
static inline unsigned long totalram_pages(void)
5353
{
54-
return (unsigned long)atomic_long_read(&_totalram_pages);
54+
return (unsigned long)atomic_long_read(&_totalram_pages);
5555
}
5656

5757
static inline void totalram_pages_inc(void)
5858
{
59-
atomic_long_inc(&_totalram_pages);
59+
atomic_long_inc(&_totalram_pages);
6060
}
6161

6262
static inline void totalram_pages_dec(void)
6363
{
64-
atomic_long_dec(&_totalram_pages);
64+
atomic_long_dec(&_totalram_pages);
6565
}
6666

6767
static inline void totalram_pages_add(long count)
6868
{
69-
atomic_long_add(count, &_totalram_pages);
69+
atomic_long_add(count, &_totalram_pages);
7070
}
7171

7272
static inline void totalram_pages_set(long val)
7373
{
74-
atomic_long_set(&_totalram_pages, val);
74+
atomic_long_set(&_totalram_pages, val);
7575
}
7676

7777
extern void * high_memory;

mm/shmem.c

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ static unsigned long shmem_default_max_blocks(void)
115115
static unsigned long shmem_default_max_inodes(void)
116116
{
117117
unsigned long nr_pages = totalram_pages();
118+
118119
return min(nr_pages - totalhigh_pages(), nr_pages / 2);
119120
}
120121
#endif

0 commit comments

Comments
 (0)