diff mbox series

mm: remove dead code totalram_pages_set()

Message ID 20191217064401.18047-1-richardw.yang@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series mm: remove dead code totalram_pages_set() | expand

Commit Message

Wei Yang Dec. 17, 2019, 6:44 a.m. UTC
No one use totalram_pages_set(), just remote it.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 include/linux/mm.h | 5 -----
 1 file changed, 5 deletions(-)

Comments

David Hildenbrand Dec. 17, 2019, 11:01 a.m. UTC | #1
On 17.12.19 07:44, Wei Yang wrote:
> No one use totalram_pages_set(), just remote it.

s/use/uses/
s/remote/remove/

> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> ---
>  include/linux/mm.h | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 74232b28949b..4cf023c4c6b3 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -70,11 +70,6 @@ static inline void totalram_pages_add(long count)
>  	atomic_long_add(count, &_totalram_pages);
>  }
>  
> -static inline void totalram_pages_set(long val)
> -{
> -	atomic_long_set(&_totalram_pages, val);
> -}
> -
>  extern void * high_memory;
>  extern int page_cluster;
>  
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
Qian Cai Dec. 17, 2019, 12:48 p.m. UTC | #2
> On Dec 17, 2019, at 1:44 AM, Wei Yang <richardw.yang@linux.intel.com> wrote:
> 
> No one use totalram_pages_set(), just remote it.

It is unlikely that this is unintentional, but can you figure out which commit removed the last caller just in case?
Wei Yang Dec. 18, 2019, 12:48 a.m. UTC | #3
On Tue, Dec 17, 2019 at 12:01:11PM +0100, David Hildenbrand wrote:
>On 17.12.19 07:44, Wei Yang wrote:
>> No one use totalram_pages_set(), just remote it.
>
>s/use/uses/
>s/remote/remove/
>

Thanks, my bad.

>> 
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> ---
>>  include/linux/mm.h | 5 -----
>>  1 file changed, 5 deletions(-)
>> 
>> diff --git a/include/linux/mm.h b/include/linux/mm.h
>> index 74232b28949b..4cf023c4c6b3 100644
>> --- a/include/linux/mm.h
>> +++ b/include/linux/mm.h
>> @@ -70,11 +70,6 @@ static inline void totalram_pages_add(long count)
>>  	atomic_long_add(count, &_totalram_pages);
>>  }
>>  
>> -static inline void totalram_pages_set(long val)
>> -{
>> -	atomic_long_set(&_totalram_pages, val);
>> -}
>> -
>>  extern void * high_memory;
>>  extern int page_cluster;
>>  
>> 
>
>Reviewed-by: David Hildenbrand <david@redhat.com>
>
>-- 
>Thanks,
>
>David / dhildenb
Wei Yang Dec. 18, 2019, 12:50 a.m. UTC | #4
On Tue, Dec 17, 2019 at 07:48:09AM -0500, Qian Cai wrote:
>
>
>> On Dec 17, 2019, at 1:44 AM, Wei Yang <richardw.yang@linux.intel.com> wrote:
>> 
>> No one use totalram_pages_set(), just remote it.
>
>It is unlikely that this is unintentional, but can you figure out which commit removed the last caller just in case?

Took a look into the history. This function is introduced in 

commit 'ca79b0c211af' (mm: convert totalram_pages and totalhigh_pages
variables to atomic)

Even in this commit, no one use this function.

Will include this in next version.
Qian Cai Dec. 18, 2019, 1:04 a.m. UTC | #5
> On Dec 17, 2019, at 7:50 PM, Wei Yang <richardw.yang@linux.intel.com> wrote:
> 
> Took a look into the history. This function is introduced in 
> 
> commit 'ca79b0c211af' (mm: convert totalram_pages and totalhigh_pages
> variables to atomic)
> 
> Even in this commit, no one use this function.

It occurs to me that function was a part of API design as a placeholder which might be used in the future.
diff mbox series

Patch

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 74232b28949b..4cf023c4c6b3 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -70,11 +70,6 @@  static inline void totalram_pages_add(long count)
 	atomic_long_add(count, &_totalram_pages);
 }
 
-static inline void totalram_pages_set(long val)
-{
-	atomic_long_set(&_totalram_pages, val);
-}
-
 extern void * high_memory;
 extern int page_cluster;