diff mbox series

[1/3] link03: Convert docs to docparse

Message ID 1697021709-22916-1-git-send-email-xuyang2018.jy@fujitsu.com
State Changes Requested
Headers show
Series [1/3] link03: Convert docs to docparse | expand

Commit Message

Yang Xu \(Fujitsu\) Oct. 11, 2023, 10:55 a.m. UTC
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/syscalls/link/link03.c | 41 +++++--------------------
 1 file changed, 7 insertions(+), 34 deletions(-)

Comments

Petr Vorel Oct. 12, 2023, 9:55 a.m. UTC | #1
Hi Xu,

first, so far we did these changes during rewrite to the new C API.
Do we really put docparse on these old tests? I would postpone it.

> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
> ---
>  testcases/kernel/syscalls/link/link03.c | 41 +++++--------------------
>  1 file changed, 7 insertions(+), 34 deletions(-)

> diff --git a/testcases/kernel/syscalls/link/link03.c b/testcases/kernel/syscalls/link/link03.c
> index 1f45240ae..27f8a4efe 100644
> --- a/testcases/kernel/syscalls/link/link03.c
> +++ b/testcases/kernel/syscalls/link/link03.c
> @@ -1,42 +1,15 @@
>  /*
>   * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
> - *  AUTHOR		: Richard Logan
> - *  CO-PILOT		: William Roske
> + * AUTHOR		: Richard Logan
> + * CO-PILOT		: William Roske
Although we probably should keep these names, we're not forced to have it in
original ugly form. How about put it as:
* Authors: Richard Logan, William Roske


>   * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
I would also put here:
* Copyright (c) Linux Test Project, 2001-2023

> - *
> - * This program is free software; you can redistribute it and/or modify it
> - * under the terms of version 2 of the GNU General Public License as
> - * published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it would be useful, but
> - * WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> - *
> - * Further, this software is distributed without any warranty that it is
> - * free of the rightful claim of any third person regarding infringement
> - * or the like.  Any license provided herein, whether implied or
> - * otherwise, applies only to this software file.  Patent licenses, if
> - * any, provided herein do not apply to combinations of this program with
> - * other software, or any other product whatsoever.
> - *
> - * You should have received a copy of the GNU General Public License along
> - * with this program; if not, write the Free Software Foundation, Inc.,
> - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> - *
> - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
> - * Mountain View, CA  94043, or:
> - *
> - * http://www.sgi.com
> - *
> - * For further information regarding this notice, see:
> - *
> - * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
> - *
>   */

You removed GPL, but haven't added SPDX on a first line:
// SPDX-License-Identifier: GPL-2.0-only

> - /*
> -  * Tests that link(2) succeds with creating n links.
> -  */
> +/*\
> + * [Description]
> + *
> + * Tests that link(2) succeds with creating n links.
s/succeds/succeeds/g
> + */

Kind regards,
Petr

>  #include <sys/types.h>
>  #include <fcntl.h>
Yang Xu \(Fujitsu\) Oct. 13, 2023, 5:43 a.m. UTC | #2
Hi Petr,
> Hi Xu,
>
> first, so far we did these changes during rewrite to the new C API.
> Do we really put docparse on these old tests? I would postpone it.

I agree with you, I overlooked that this is an old test.

You can postpone it, maybe in the future I will rewrite to the new C API.

>> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
>> ---
>>   testcases/kernel/syscalls/link/link03.c | 41 +++++--------------------
>>   1 file changed, 7 insertions(+), 34 deletions(-)
>> diff --git a/testcases/kernel/syscalls/link/link03.c b/testcases/kernel/syscalls/link/link03.c
>> index 1f45240ae..27f8a4efe 100644
>> --- a/testcases/kernel/syscalls/link/link03.c
>> +++ b/testcases/kernel/syscalls/link/link03.c
>> @@ -1,42 +1,15 @@
>>   /*
>>    * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
>> - *  AUTHOR		: Richard Logan
>> - *  CO-PILOT		: William Roske
>> + * AUTHOR		: Richard Logan
>> + * CO-PILOT		: William Roske
> Although we probably should keep these names, we're not forced to have it in
> original ugly form. How about put it as:
> * Authors: Richard Logan, William Roske
>
ok.
>>    * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
> I would also put here:
> * Copyright (c) Linux Test Project, 2001-2023
ok.
>> - *
>> - * This program is free software; you can redistribute it and/or modify it
>> - * under the terms of version 2 of the GNU General Public License as
>> - * published by the Free Software Foundation.
>> - *
>> - * This program is distributed in the hope that it would be useful, but
>> - * WITHOUT ANY WARRANTY; without even the implied warranty of
>> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>> - *
>> - * Further, this software is distributed without any warranty that it is
>> - * free of the rightful claim of any third person regarding infringement
>> - * or the like.  Any license provided herein, whether implied or
>> - * otherwise, applies only to this software file.  Patent licenses, if
>> - * any, provided herein do not apply to combinations of this program with
>> - * other software, or any other product whatsoever.
>> - *
>> - * You should have received a copy of the GNU General Public License along
>> - * with this program; if not, write the Free Software Foundation, Inc.,
>> - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
>> - *
>> - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
>> - * Mountain View, CA  94043, or:
>> - *
>> - * http://www.sgi.com
>> - *
>> - * For further information regarding this notice, see:
>> - *
>> - * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
>> - *
>>    */
> You removed GPL, but haven't added SPDX on a first line:
> // SPDX-License-Identifier: GPL-2.0-only
Sorry for ignoring this.
>> - /*
>> -  * Tests that link(2) succeds with creating n links.
>> -  */
>> +/*\
>> + * [Description]
>> + *
>> + * Tests that link(2) succeds with creating n links.
> s/succeds/succeeds/g
>> + */
> Kind regards,
> Petr
>
>>   #include <sys/types.h>
>>   #include <fcntl.h>
Petr Vorel Oct. 13, 2023, 6:12 a.m. UTC | #3
Hi Xu,

> Hi Petr,
> > Hi Xu,

> > first, so far we did these changes during rewrite to the new C API.
> > Do we really put docparse on these old tests? I would postpone it.

> I agree with you, I overlooked that this is an old test.

> You can postpone it, maybe in the future I will rewrite to the new C API.

Thank you!

...
> > You removed GPL, but haven't added SPDX on a first line:
> > // SPDX-License-Identifier: GPL-2.0-only
> Sorry for ignoring this.

No problem, it's easy to overlook it.

Kind regards,
Petr
Petr Vorel Oct. 25, 2023, 11:51 p.m. UTC | #4
Hi Xu,

Also, while you are at it, could you please fix these warnings?

$ make link03

link03.c: In function ‘main’:
link03.c:104:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
  104 |    sprintf(lname, "%s%d", fname, i);
      |                      ^~
link03.c:104:19: note: directive argument in the range [1, 2147483646]
  104 |    sprintf(lname, "%s%d", fname, i);
      |                   ^~~~~~
link03.c:104:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
  104 |    sprintf(lname, "%s%d", fname, i);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
link03.c:123:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
  123 |    sprintf(lname, "%s%d", fname, i);
      |                      ^~
link03.c:123:19: note: directive argument in the range [1, 2147483646]
  123 |    sprintf(lname, "%s%d", fname, i);
      |                   ^~~~~~
link03.c:123:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
  123 |    sprintf(lname, "%s%d", fname, i);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
link03.c:138:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
  138 |    sprintf(lname, "%s%d", fname, i);
      |                      ^~
link03.c:138:19: note: directive argument in the range [1, 2147483646]
  138 |    sprintf(lname, "%s%d", fname, i);
      |                   ^~~~~~
link03.c:138:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
  138 |    sprintf(lname, "%s%d", fname, i);

$ make check-link03
CHECK testcases/kernel/syscalls/link/link03.c
link03.c:1: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
link03.c:33: ERROR: do not initialise statics to 0
link03.c:55: ERROR: code indent should use tabs where possible
link03.c:90: ERROR: code indent should use tabs where possible
link03.c:100: ERROR: code indent should use tabs where possible

Thanks!

Kind regards,
Petr
Yang Xu \(Fujitsu\) Oct. 26, 2023, 7:37 a.m. UTC | #5
Hi Petr,

>Hi Xu,

>Also, while you are at it, could you please fix these warnings?

OK. I will pay attention to it.

>$ make link03

>link03.c: In function ‘main’:
>link03.c:104:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
> 104 |    sprintf(lname, "%s%d", fname, i);
>     |                      ^~
>link03.c:104:19: note: directive argument in the range [1, 2147483646]
>  104 |    sprintf(lname, "%s%d", fname, i);
>     |                   ^~~~~~
>link03.c:104:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>  104 |    sprintf(lname, "%s%d", fname, i);
>     |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>link03.c:123:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>  123 |    sprintf(lname, "%s%d", fname, i);
>     |                      ^~
>link03.c:123:19: note: directive argument in the range [1, 2147483646]
>  123 |    sprintf(lname, "%s%d", fname, i);
>      |                   ^~~~~~
>link03.c:123:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>  123 |    sprintf(lname, "%s%d", fname, i);
>      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>link03.c:138:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>  138 |    sprintf(lname, "%s%d", fname, i);
>      |                      ^~
>link03.c:138:19: note: directive argument in the range [1, 2147483646]
>  138 |    sprintf(lname, "%s%d", fname, i);
>      |                   ^~~~~~
>link03.c:138:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>  138 |    sprintf(lname, "%s%d", fname, i);

>$ make check-link03
>CHECK testcases/kernel/syscalls/link/link03.c
>link03.c:1: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
>link03.c:33: ERROR: do not initialise statics to 0
>link03.c:55: ERROR: code indent should use tabs where possible
>link03.c:90: ERROR: code indent should use tabs where possible
>link03.c:100: ERROR: code indent should use tabs where possible

>Thanks!

>Kind regards,
>Petr

Best Regards
Yang Xu
Yang Xu \(Fujitsu\) Oct. 31, 2023, 7:22 a.m. UTC | #6
Hi Petr,

I've noticed that the test objectives of link03 and link05 are very similar, and the description of link05's test has no relevance to the test code.
Therefore, I think we can simply remove link03 and update the test description of link05 to replace link03.
As for your previous suggestions for modifying the link05 code, I don't have a good solution for this.

The specific information is as follows:
LINK: http://patchwork.ozlabs.org/project/ltp/patch/1697021709-22916-2-git-send-email-xuyang2018.jy@fujitsu.com/


Best Regards,
Yang Xu


>Hi Petr,

>>Hi Xu,

>>Also, while you are at it, could you please fix these warnings?

>OK. I will pay attention to it.

>>$ make link03

>>link03.c: In function ‘main’:
>>link03.c:104:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>> 104 |    sprintf(lname, "%s%d", fname, i);
>>     |                      ^~
>>link03.c:104:19: note: directive argument in the range [1, 2147483646]
>>  104 |    sprintf(lname, "%s%d", fname, i);
>>     |                   ^~~~~~
>>link03.c:104:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>>  104 |    sprintf(lname, "%s%d", fname, i);
>>     |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>link03.c:123:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>>  123 |    sprintf(lname, "%s%d", fname, i);
>>     |                      ^~
>>link03.c:123:19: note: directive argument in the range [1, 2147483646]
>>  123 |    sprintf(lname, "%s%d", fname, i);
>>      |                   ^~~~~~
>>link03.c:123:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>>  123 |    sprintf(lname, "%s%d", fname, i);
>>      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>link03.c:138:22: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size between 1 and 255 [-Wformat-overflow=]
>>  138 |    sprintf(lname, "%s%d", fname, i);
>>      |                      ^~
>>link03.c:138:19: note: directive argument in the range [1, 2147483646]
>>  138 |    sprintf(lname, "%s%d", fname, i);
>>      |                   ^~~~~~
>>link03.c:138:4: note: ‘sprintf’ output between 2 and 265 bytes into a destination of size 255
>>  138 |    sprintf(lname, "%s%d", fname, i);

>>$ make check-link03
>>CHECK testcases/kernel/syscalls/link/link03.c
>>link03.c:1: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
>>link03.c:33: ERROR: do not initialise statics to 0
>>link03.c:55: ERROR: code indent should use tabs where possible
>>link03.c:90: ERROR: code indent should use tabs where possible
>>link03.c:100: ERROR: code indent should use tabs where possible

>>Thanks!

>>Kind regards,
>>Petr

>Best Regards
>Yang Xu
Petr Vorel Nov. 3, 2023, 7:32 a.m. UTC | #7
Hi Xu,
> Hi Petr,

> I've noticed that the test objectives of link03 and link05 are very similar, and the description of link05's test has no relevance to the test code.
> Therefore, I think we can simply remove link03 and update the test description of link05 to replace link03.
> As for your previous suggestions for modifying the link05 code, I don't have a good solution for this.

> The specific information is as follows:
> LINK: http://patchwork.ozlabs.org/project/ltp/patch/1697021709-22916-2-git-send-email-xuyang2018.jy@fujitsu.com/

Indeed, test would have to print ouput 1000x, because each test needs to report
result. Therefore let's keep it. I hope it makes sense to run test 1000x.

E.g. feel free to merge (ideally with fixes spaces to tags, but understand if
you do just docparse change).

Kind regards,
Petr

> Best Regards,
> Yang Xu
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/link/link03.c b/testcases/kernel/syscalls/link/link03.c
index 1f45240ae..27f8a4efe 100644
--- a/testcases/kernel/syscalls/link/link03.c
+++ b/testcases/kernel/syscalls/link/link03.c
@@ -1,42 +1,15 @@ 
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *  AUTHOR		: Richard Logan
- *  CO-PILOT		: William Roske
+ * AUTHOR		: Richard Logan
+ * CO-PILOT		: William Roske
  * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
  */
 
- /*
-  * Tests that link(2) succeds with creating n links.
-  */
+/*\
+ * [Description]
+ *
+ * Tests that link(2) succeds with creating n links.
+ */
 
 #include <sys/types.h>
 #include <fcntl.h>