diff mbox series

[v2] selftests/timers: Remove unused NSEC_PER_SEC macro

Message ID 20240906025259.3822-1-zhangjiao2@cmss.chinamobile.com (mailing list archive)
State Accepted
Commit af1ec38c6ccc31ec963ac4bcf8f6a7d8f44d210a
Headers show
Series [v2] selftests/timers: Remove unused NSEC_PER_SEC macro | expand

Commit Message

zhangjiao2 Sept. 6, 2024, 2:52 a.m. UTC
From: zhang jiao <zhangjiao2@cmss.chinamobile.com>

By readind the code, I found the macro NSEC_PER_SEC
is never referenced in the code. Just remove it.

Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
---
v1->v2:
	Put together files with similar problems

 tools/testing/selftests/timers/change_skew.c      | 3 ---
 tools/testing/selftests/timers/skew_consistency.c | 2 --
 2 files changed, 5 deletions(-)

Comments

Shuah Khan Sept. 6, 2024, 2:29 p.m. UTC | #1
On 9/5/24 20:52, zhangjiao2 wrote:
> From: zhang jiao <zhangjiao2@cmss.chinamobile.com>
> 
> By readind the code, I found the macro NSEC_PER_SEC

reading

> is never referenced in the code. Just remove it.
> 
> Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>

Running checkpatch can catch spelling errors.

> ---
> v1->v2:
> 	Put together files with similar problems
> 
>   tools/testing/selftests/timers/change_skew.c      | 3 ---
>   tools/testing/selftests/timers/skew_consistency.c | 2 --
>   2 files changed, 5 deletions(-)
> 
> diff --git a/tools/testing/selftests/timers/change_skew.c b/tools/testing/selftests/timers/change_skew.c
> index 4421cd562c24..18e794a46c23 100644
> --- a/tools/testing/selftests/timers/change_skew.c
> +++ b/tools/testing/selftests/timers/change_skew.c
> @@ -30,9 +30,6 @@
>   #include <time.h>
>   #include "../kselftest.h"
>   
> -#define NSEC_PER_SEC 1000000000LL
> -
> -
>   int change_skew_test(int ppm)
>   {
>   	struct timex tx;
> diff --git a/tools/testing/selftests/timers/skew_consistency.c b/tools/testing/selftests/timers/skew_consistency.c
> index c8e6bffe4e0a..83450145fe65 100644
> --- a/tools/testing/selftests/timers/skew_consistency.c
> +++ b/tools/testing/selftests/timers/skew_consistency.c
> @@ -36,8 +36,6 @@
>   #include <sys/wait.h>
>   #include "../kselftest.h"
>   
> -#define NSEC_PER_SEC 1000000000LL
> -
>   int main(int argc, char **argv)
>   {
>   	struct timex tx;

This looks good to me.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>

John, I can pick this up with if you are okay with this change.

thanks,
-- Shuah
John Stultz Sept. 6, 2024, 5:02 p.m. UTC | #2
On Fri, Sep 6, 2024 at 7:29 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
> On 9/5/24 20:52, zhangjiao2 wrote:
> > diff --git a/tools/testing/selftests/timers/skew_consistency.c b/tools/testing/selftests/timers/skew_consistency.c
> > index c8e6bffe4e0a..83450145fe65 100644
> > --- a/tools/testing/selftests/timers/skew_consistency.c
> > +++ b/tools/testing/selftests/timers/skew_consistency.c
> > @@ -36,8 +36,6 @@
> >   #include <sys/wait.h>
> >   #include "../kselftest.h"
> >
> > -#define NSEC_PER_SEC 1000000000LL
> > -
> >   int main(int argc, char **argv)
> >   {
> >       struct timex tx;
>
> This looks good to me.
>
> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
>
> John, I can pick this up with if you are okay with this change.

No objection from me, if you're ok with the commit.
Acked-by: John Stultz <jstultz@google.com>

thanks
-john
Shuah Khan Sept. 6, 2024, 7:40 p.m. UTC | #3
On 9/6/24 11:02, John Stultz wrote:
> On Fri, Sep 6, 2024 at 7:29 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
>> On 9/5/24 20:52, zhangjiao2 wrote:
>>> diff --git a/tools/testing/selftests/timers/skew_consistency.c b/tools/testing/selftests/timers/skew_consistency.c
>>> index c8e6bffe4e0a..83450145fe65 100644
>>> --- a/tools/testing/selftests/timers/skew_consistency.c
>>> +++ b/tools/testing/selftests/timers/skew_consistency.c
>>> @@ -36,8 +36,6 @@
>>>    #include <sys/wait.h>
>>>    #include "../kselftest.h"
>>>
>>> -#define NSEC_PER_SEC 1000000000LL
>>> -
>>>    int main(int argc, char **argv)
>>>    {
>>>        struct timex tx;
>>
>> This looks good to me.
>>
>> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
>>
>> John, I can pick this up with if you are okay with this change.
> 
> No objection from me, if you're ok with the commit.
> Acked-by: John Stultz <jstultz@google.com>
> 
> thanks
> -john


Thank you. Applied linux-kselftest next for Linux 6.12-rc1.

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/testing/selftests/timers/change_skew.c b/tools/testing/selftests/timers/change_skew.c
index 4421cd562c24..18e794a46c23 100644
--- a/tools/testing/selftests/timers/change_skew.c
+++ b/tools/testing/selftests/timers/change_skew.c
@@ -30,9 +30,6 @@ 
 #include <time.h>
 #include "../kselftest.h"
 
-#define NSEC_PER_SEC 1000000000LL
-
-
 int change_skew_test(int ppm)
 {
 	struct timex tx;
diff --git a/tools/testing/selftests/timers/skew_consistency.c b/tools/testing/selftests/timers/skew_consistency.c
index c8e6bffe4e0a..83450145fe65 100644
--- a/tools/testing/selftests/timers/skew_consistency.c
+++ b/tools/testing/selftests/timers/skew_consistency.c
@@ -36,8 +36,6 @@ 
 #include <sys/wait.h>
 #include "../kselftest.h"
 
-#define NSEC_PER_SEC 1000000000LL
-
 int main(int argc, char **argv)
 {
 	struct timex tx;