Re: [PATCH v3] mru: Replace mru.[ch] with list.h implementation
- From
Gargi Sharma <gs051095@gmail.com>
- Date
- Jan 20, 2018, 22:24 UTC
- Message-ID
- <CAOCi2DGKkLnY_=-7pMr9VyP7TVsj0b8w-msdNn9ZtXKK8g7u9g@mail.gmail.com>
- In-Reply-To
- <20180120010228.hhyvirqp44taf3cz@dcvr.yhbt.net>
On Sat, Jan 20, 2018 at 1:02 AM, Eric Wong <e@80x24.org> wrote:
Show 21 quoted lines
> Gargi Sharma <gs051095@gmail.com> wrote:
>> --- a/list.h
>> +++ b/list.h
>> @@ -93,6 +93,13 @@ static inline void list_move(struct list_head *elem, struct list_head *head)
>> list_add(elem, head);
>> }
>>
>> +/* Move to the front of the list. */
>> +static inline void list_move_to_front(struct list_head *elem, struct list_head *head)
>> +{
>> + list_del(elem);
>> + list_add(elem, head);
>> +}
>> +
>
> Since we already have list_move and it does the same thing,
> I don't think we need a new function, here.
>
> Hackers coming from other projects (glibc/urcu/Linux kernel)
> might appreciate having fewer differences from what they're used
> to.I think the idea behind this function was that it is already being used in two places in the code and might be used in other places in the future. I agree with your stance, but a list_move_to_front is pretty self explanatory and not too different, so it should be alright.
> > Anyways thanks for working on this!