* [PATCH v3] selftests/timers: remove unused irqcount variable
@ 2024-07-04 2:42 John Hubbard
2024-07-04 3:11 ` John Stultz
2024-07-05 8:11 ` Muhammad Usama Anjum
0 siblings, 2 replies; 4+ messages in thread
From: John Hubbard @ 2024-07-04 2:42 UTC (permalink / raw)
To: Shuah Khan
Cc: John Stultz, Thomas Gleixner, Stephen Boyd, Anna-Maria Behnsen,
Frederic Weisbecker, Valentin Obst, linux-kselftest, LKML, llvm,
John Hubbard
When building with clang, via:
make LLVM=1 -C tools/testing/selftest
...clang warns about an unused irqcount variable. clang is correct: the
variable is incremented and then ignored.
Fix this by deleting the irqcount variable.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
Changes since v2:
1) Rebased onto Linux 6.10-rc6+
Changes since the first version:
1) Rebased onto Linux 6.10-rc1
thanks,
John Hubbard
tools/testing/selftests/timers/rtcpie.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/testing/selftests/timers/rtcpie.c b/tools/testing/selftests/timers/rtcpie.c
index 4ef2184f1558..7c07edd0d450 100644
--- a/tools/testing/selftests/timers/rtcpie.c
+++ b/tools/testing/selftests/timers/rtcpie.c
@@ -29,7 +29,7 @@ static const char default_rtc[] = "/dev/rtc0";
int main(int argc, char **argv)
{
- int i, fd, retval, irqcount = 0;
+ int i, fd, retval;
unsigned long tmp, data, old_pie_rate;
const char *rtc = default_rtc;
struct timeval start, end, diff;
@@ -120,7 +120,6 @@ int main(int argc, char **argv)
fprintf(stderr, " %d",i);
fflush(stderr);
- irqcount++;
}
/* Disable periodic interrupts */
base-commit: 8a9c6c40432e265600232b864f97d7c675e8be52
--
2.45.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] selftests/timers: remove unused irqcount variable
2024-07-04 2:42 [PATCH v3] selftests/timers: remove unused irqcount variable John Hubbard
@ 2024-07-04 3:11 ` John Stultz
2024-07-05 16:53 ` Shuah Khan
2024-07-05 8:11 ` Muhammad Usama Anjum
1 sibling, 1 reply; 4+ messages in thread
From: John Stultz @ 2024-07-04 3:11 UTC (permalink / raw)
To: John Hubbard
Cc: Shuah Khan, Thomas Gleixner, Stephen Boyd, Anna-Maria Behnsen,
Frederic Weisbecker, Valentin Obst, linux-kselftest, LKML, llvm
On Wed, Jul 3, 2024 at 7:42 PM John Hubbard <jhubbard@nvidia.com> wrote:
>
> When building with clang, via:
>
> make LLVM=1 -C tools/testing/selftest
>
> ...clang warns about an unused irqcount variable. clang is correct: the
> variable is incremented and then ignored.
>
> Fix this by deleting the irqcount variable.
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Acked-by: John Stultz <jstultz@google.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] selftests/timers: remove unused irqcount variable
2024-07-04 2:42 [PATCH v3] selftests/timers: remove unused irqcount variable John Hubbard
2024-07-04 3:11 ` John Stultz
@ 2024-07-05 8:11 ` Muhammad Usama Anjum
1 sibling, 0 replies; 4+ messages in thread
From: Muhammad Usama Anjum @ 2024-07-05 8:11 UTC (permalink / raw)
To: John Hubbard, Shuah Khan
Cc: Muhammad Usama Anjum, John Stultz, Thomas Gleixner, Stephen Boyd,
Anna-Maria Behnsen, Frederic Weisbecker, Valentin Obst,
linux-kselftest, LKML, llvm
On 7/4/24 7:42 AM, John Hubbard wrote:
> When building with clang, via:
>
> make LLVM=1 -C tools/testing/selftest
>
> ...clang warns about an unused irqcount variable. clang is correct: the
> variable is incremented and then ignored.
>
> Fix this by deleting the irqcount variable.
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
>
> Changes since v2:
>
> 1) Rebased onto Linux 6.10-rc6+
>
> Changes since the first version:
>
> 1) Rebased onto Linux 6.10-rc1
>
> thanks,
> John Hubbard
>
> tools/testing/selftests/timers/rtcpie.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/timers/rtcpie.c b/tools/testing/selftests/timers/rtcpie.c
> index 4ef2184f1558..7c07edd0d450 100644
> --- a/tools/testing/selftests/timers/rtcpie.c
> +++ b/tools/testing/selftests/timers/rtcpie.c
> @@ -29,7 +29,7 @@ static const char default_rtc[] = "/dev/rtc0";
>
> int main(int argc, char **argv)
> {
> - int i, fd, retval, irqcount = 0;
> + int i, fd, retval;
> unsigned long tmp, data, old_pie_rate;
> const char *rtc = default_rtc;
> struct timeval start, end, diff;
> @@ -120,7 +120,6 @@ int main(int argc, char **argv)
>
> fprintf(stderr, " %d",i);
> fflush(stderr);
> - irqcount++;
> }
>
> /* Disable periodic interrupts */
>
> base-commit: 8a9c6c40432e265600232b864f97d7c675e8be52
--
BR,
Muhammad Usama Anjum
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] selftests/timers: remove unused irqcount variable
2024-07-04 3:11 ` John Stultz
@ 2024-07-05 16:53 ` Shuah Khan
0 siblings, 0 replies; 4+ messages in thread
From: Shuah Khan @ 2024-07-05 16:53 UTC (permalink / raw)
To: John Stultz, John Hubbard
Cc: Shuah Khan, Thomas Gleixner, Stephen Boyd, Anna-Maria Behnsen,
Frederic Weisbecker, Valentin Obst, linux-kselftest, LKML, llvm,
Shuah Khan
On 7/3/24 21:11, John Stultz wrote:
> On Wed, Jul 3, 2024 at 7:42 PM John Hubbard <jhubbard@nvidia.com> wrote:
>>
>> When building with clang, via:
>>
>> make LLVM=1 -C tools/testing/selftest
>>
>> ...clang warns about an unused irqcount variable. clang is correct: the
>> variable is incremented and then ignored.
>>
>> Fix this by deleting the irqcount variable.
>>
>> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>
> Acked-by: John Stultz <jstultz@google.com>
Thank you all.
Applied to linux_kselftest next for Linux 6.11-rc1.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-05 16:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-04 2:42 [PATCH v3] selftests/timers: remove unused irqcount variable John Hubbard
2024-07-04 3:11 ` John Stultz
2024-07-05 16:53 ` Shuah Khan
2024-07-05 8:11 ` Muhammad Usama Anjum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®