diff mbox series

selftests: timers: Remove unneeded semicolon

Message ID 20241010073707.4038081-1-nichen@iscas.ac.cn (mailing list archive)
State Accepted
Commit 876c3f3d93dacc1cb6695392f1a96ff94ec65195
Headers show
Series selftests: timers: Remove unneeded semicolon | expand

Commit Message

Chen Ni Oct. 10, 2024, 7:37 a.m. UTC
Remove unnecessary semicolons reported by Coccinelle/coccicheck and the
semantic patch at scripts/coccinelle/misc/semicolon.cocci.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 tools/testing/selftests/timers/set-timer-lat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Shuah Khan Oct. 11, 2024, 11 p.m. UTC | #1
On 10/10/24 01:37, Chen Ni wrote:
> Remove unnecessary semicolons reported by Coccinelle/coccicheck and the
> semantic patch at scripts/coccinelle/misc/semicolon.cocci.
> 
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> ---
>   tools/testing/selftests/timers/set-timer-lat.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/timers/set-timer-lat.c b/tools/testing/selftests/timers/set-timer-lat.c
> index 5365e9ae61c3..7a1a2382538c 100644
> --- a/tools/testing/selftests/timers/set-timer-lat.c
> +++ b/tools/testing/selftests/timers/set-timer-lat.c
> @@ -79,7 +79,7 @@ char *clockstring(int clockid)
>   		return "CLOCK_BOOTTIME_ALARM";
>   	case CLOCK_TAI:
>   		return "CLOCK_TAI";
> -	};
> +	}
>   	return "UNKNOWN_CLOCKID";
>   }
>   

Looks good to me.

John, I will apply this for next of you are okay with it.

Also I noticed clockstring() is defined in multiple tests.
Any thoughts on removing the duplicates and adding it to
a header file? This will add a dependency on another source
file, but might be good to remove the duplicate code.

thanks,
-- Shuah
John Stultz Oct. 12, 2024, 12:47 a.m. UTC | #2
On Fri, Oct 11, 2024 at 4:00 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> On 10/10/24 01:37, Chen Ni wrote:
> > Remove unnecessary semicolons reported by Coccinelle/coccicheck and the
> > semantic patch at scripts/coccinelle/misc/semicolon.cocci.
> >
> > Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> > ---
> >   tools/testing/selftests/timers/set-timer-lat.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/timers/set-timer-lat.c b/tools/testing/selftests/timers/set-timer-lat.c
> > index 5365e9ae61c3..7a1a2382538c 100644
> > --- a/tools/testing/selftests/timers/set-timer-lat.c
> > +++ b/tools/testing/selftests/timers/set-timer-lat.c
> > @@ -79,7 +79,7 @@ char *clockstring(int clockid)
> >               return "CLOCK_BOOTTIME_ALARM";
> >       case CLOCK_TAI:
> >               return "CLOCK_TAI";
> > -     };
> > +     }
> >       return "UNKNOWN_CLOCKID";
> >   }
> >
>
> Looks good to me.
>
> John, I will apply this for next of you are okay with it.

Acked-by: John Stultz <jstultz@google.com>

> Also I noticed clockstring() is defined in multiple tests.
> Any thoughts on removing the duplicates and adding it to
> a header file? This will add a dependency on another source
> file, but might be good to remove the duplicate code.

Sure, no objections.
-john
Shuah Khan Oct. 14, 2024, 10:08 p.m. UTC | #3
On 10/11/24 18:47, John Stultz wrote:
> On Fri, Oct 11, 2024 at 4:00 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>>
>> On 10/10/24 01:37, Chen Ni wrote:
>>> Remove unnecessary semicolons reported by Coccinelle/coccicheck and the
>>> semantic patch at scripts/coccinelle/misc/semicolon.cocci.
>>>
>>> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
>>> ---
>>>    tools/testing/selftests/timers/set-timer-lat.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tools/testing/selftests/timers/set-timer-lat.c b/tools/testing/selftests/timers/set-timer-lat.c
>>> index 5365e9ae61c3..7a1a2382538c 100644
>>> --- a/tools/testing/selftests/timers/set-timer-lat.c
>>> +++ b/tools/testing/selftests/timers/set-timer-lat.c
>>> @@ -79,7 +79,7 @@ char *clockstring(int clockid)
>>>                return "CLOCK_BOOTTIME_ALARM";
>>>        case CLOCK_TAI:
>>>                return "CLOCK_TAI";
>>> -     };
>>> +     }
>>>        return "UNKNOWN_CLOCKID";
>>>    }
>>>
>>
>> Looks good to me.
>>
>> John, I will apply this for next of you are okay with it.
> 
> Acked-by: John Stultz <jstultz@google.com>

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

> 
>> Also I noticed clockstring() is defined in multiple tests.
>> Any thoughts on removing the duplicates and adding it to
>> a header file? This will add a dependency on another source
>> file, but might be good to remove the duplicate code.
> 
> Sure, no objections.

Thanks. I will send patch in soon.

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/testing/selftests/timers/set-timer-lat.c b/tools/testing/selftests/timers/set-timer-lat.c
index 5365e9ae61c3..7a1a2382538c 100644
--- a/tools/testing/selftests/timers/set-timer-lat.c
+++ b/tools/testing/selftests/timers/set-timer-lat.c
@@ -79,7 +79,7 @@  char *clockstring(int clockid)
 		return "CLOCK_BOOTTIME_ALARM";
 	case CLOCK_TAI:
 		return "CLOCK_TAI";
-	};
+	}
 	return "UNKNOWN_CLOCKID";
 }