diff mbox series

[rt-tests,v1,01/12] cyclicdeadline: Remove dead code

Message ID 20201118190642.16006-2-dwagner@suse.de
State New
Headers show
Series Add quiet command line option | expand

Commit Message

Daniel Wagner Nov. 18, 2020, 7:06 p.m. UTC
my_sprintf() is not used, remove it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
 compare.py                          | 12 ++++++++++++
 src/sched_deadline/cyclicdeadline.c | 13 -------------
 2 files changed, 12 insertions(+), 13 deletions(-)
 create mode 100644 compare.py

Comments

Punit Agrawal Nov. 19, 2020, 6:54 a.m. UTC | #1
Hi Daniel,

One comment / query below -

Daniel Wagner <dwagner@suse.de> writes:

> my_sprintf() is not used, remove it.

>

> Signed-off-by: Daniel Wagner <dwagner@suse.de>

> ---

>  compare.py                          | 12 ++++++++++++

>  src/sched_deadline/cyclicdeadline.c | 13 -------------

>  2 files changed, 12 insertions(+), 13 deletions(-)

>  create mode 100644 compare.py

>

> diff --git a/compare.py b/compare.py

> new file mode 100644

> index 000000000000..7fb6ae818a00

> --- /dev/null

> +++ b/compare.py

> @@ -0,0 +1,12 @@

> +with open('old', 'r') as old:

> +    with open('new', 'r') as new:

> +        for ol in old.readlines():

> +            new.seek(0)

> +            for nl in new.readlines():

> +                o = ol.split()

> +                n = nl.split()

> +

> +                if o[8] == n[8]:

> +                    d = int(n[4]) - int(o[4])

> +                    p = d/int(o[4]) * 100

> +                    print('{:20} {:>8} {:>8} {:>6} {:>2.2}%'.format(o[8], o[4], n[4], d, p))


This hunk seems to be unrelated and also not mentioned in the commit
log. Perhaps it's accidentally part of this commit?

Thanks,
Punit

[...]
Daniel Wagner Nov. 19, 2020, 8:19 a.m. UTC | #2
Hi Punit,

On 19.11.20 07:54, Punit Agrawal wrote:
> Hi Daniel,

> 

> One comment / query below -

> 

> Daniel Wagner <dwagner@suse.de> writes:

> 

>> my_sprintf() is not used, remove it.

>>

>> Signed-off-by: Daniel Wagner <dwagner@suse.de>

>> ---

>>   compare.py                          | 12 ++++++++++++

>>   src/sched_deadline/cyclicdeadline.c | 13 -------------

>>   2 files changed, 12 insertions(+), 13 deletions(-)

>>   create mode 100644 compare.py

>>

>> diff --git a/compare.py b/compare.py

>> new file mode 100644

>> index 000000000000..7fb6ae818a00

>> --- /dev/null

>> +++ b/compare.py

>> @@ -0,0 +1,12 @@

>> +with open('old', 'r') as old:

>> +    with open('new', 'r') as new:

>> +        for ol in old.readlines():

>> +            new.seek(0)

>> +            for nl in new.readlines():

>> +                o = ol.split()

>> +                n = nl.split()

>> +

>> +                if o[8] == n[8]:

>> +                    d = int(n[4]) - int(o[4])

>> +                    p = d/int(o[4]) * 100

>> +                    print('{:20} {:>8} {:>8} {:>6} {:>2.2}%'.format(o[8], o[4], n[4], d, p))

> 

> This hunk seems to be unrelated and also not mentioned in the commit

> log. Perhaps it's accidentally part of this commit?


Indeed, this sneaked into the commit. Totally unrelated :)

I'll send an update.

Thanks,
Daniel
John Kacur Dec. 1, 2020, 6:30 a.m. UTC | #3
On Wed, 18 Nov 2020, Daniel Wagner wrote:

> my_sprintf() is not used, remove it.

> 

> Signed-off-by: Daniel Wagner <dwagner@suse.de>

> ---

>  compare.py                          | 12 ++++++++++++

>  src/sched_deadline/cyclicdeadline.c | 13 -------------

>  2 files changed, 12 insertions(+), 13 deletions(-)

>  create mode 100644 compare.py

> 

> diff --git a/compare.py b/compare.py

> new file mode 100644

> index 000000000000..7fb6ae818a00

> --- /dev/null

> +++ b/compare.py

> @@ -0,0 +1,12 @@

> +with open('old', 'r') as old:

> +    with open('new', 'r') as new:

> +        for ol in old.readlines():

> +            new.seek(0)

> +            for nl in new.readlines():

> +                o = ol.split()

> +                n = nl.split()

> +

> +                if o[8] == n[8]:

> +                    d = int(n[4]) - int(o[4])

> +                    p = d/int(o[4]) * 100

> +                    print('{:20} {:>8} {:>8} {:>6} {:>2.2}%'.format(o[8], o[4], n[4], d, p))

> diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c

> index a6309ded3c52..e0db9669f676 100644

> --- a/src/sched_deadline/cyclicdeadline.c

> +++ b/src/sched_deadline/cyclicdeadline.c

> @@ -215,19 +215,6 @@ static int my_vsprintf(char *buf, int size, const char *fmt, va_list ap)

>  	return s - buf;

>  }

>  

> -#if 0

> -static int my_sprintf(char *buf, int size, const char *fmt, ...)

> -{

> -	va_list ap;

> -	int n;

> -

> -	va_start(ap, fmt);

> -	n = vsnprintf(buf, size, fmt, ap);

> -	va_end(ap);

> -	return n;

> -}

> -#endif

> -

>  static void ftrace_write(char *buf, const char *fmt, ...)

>  {

>  	va_list ap;

> -- 

> 2.29.2

> 

> 


Well, your git version is okay, but the version you posted here has 
compare.py, which I assume is somekind of internal tooling you created.

My SOB refers to your git version
Signed-off-by: John Kacur <jkacur@redhat.com>
Daniel Wagner Dec. 1, 2020, 8:21 a.m. UTC | #4
On Tue, Dec 01, 2020 at 01:30:04AM -0500, John Kacur wrote:
> Well, your git version is okay, but the version you posted here has 

> compare.py, which I assume is somekind of internal tooling you created.


I've updated the patch and resend it.

> My SOB refers to your git version


Yes, the git version is reflects the latest version (without the
compare.py junk)

> Signed-off-by: John Kacur <jkacur@redhat.com>
diff mbox series

Patch

diff --git a/compare.py b/compare.py
new file mode 100644
index 000000000000..7fb6ae818a00
--- /dev/null
+++ b/compare.py
@@ -0,0 +1,12 @@ 
+with open('old', 'r') as old:
+    with open('new', 'r') as new:
+        for ol in old.readlines():
+            new.seek(0)
+            for nl in new.readlines():
+                o = ol.split()
+                n = nl.split()
+
+                if o[8] == n[8]:
+                    d = int(n[4]) - int(o[4])
+                    p = d/int(o[4]) * 100
+                    print('{:20} {:>8} {:>8} {:>6} {:>2.2}%'.format(o[8], o[4], n[4], d, p))
diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c
index a6309ded3c52..e0db9669f676 100644
--- a/src/sched_deadline/cyclicdeadline.c
+++ b/src/sched_deadline/cyclicdeadline.c
@@ -215,19 +215,6 @@  static int my_vsprintf(char *buf, int size, const char *fmt, va_list ap)
 	return s - buf;
 }
 
-#if 0
-static int my_sprintf(char *buf, int size, const char *fmt, ...)
-{
-	va_list ap;
-	int n;
-
-	va_start(ap, fmt);
-	n = vsnprintf(buf, size, fmt, ap);
-	va_end(ap);
-	return n;
-}
-#endif
-
 static void ftrace_write(char *buf, const char *fmt, ...)
 {
 	va_list ap;