diff mbox series

[2/5] lapi/kcmp.h: Replace GPL with SPDX-License-Identifier

Message ID 1645005868-2373-2-git-send-email-xuyang2018.jy@fujitsu.com
State Accepted
Headers show
Series [1/5] kcmp.h: move it to ltp include/lapi directory | expand

Commit Message

Yang Xu Feb. 16, 2022, 10:04 a.m. UTC
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 include/lapi/kcmp.h | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

Comments

Petr Vorel Feb. 16, 2022, 2:05 p.m. UTC | #1
And this one qas well (although there is cleanup of guards and #ifndef).

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr
Petr Vorel Feb. 17, 2022, 6:52 p.m. UTC | #2
Hi Xu,

> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
> ---
>  include/lapi/kcmp.h | 25 ++++++-------------------
>  1 file changed, 6 insertions(+), 19 deletions(-)

> diff --git a/include/lapi/kcmp.h b/include/lapi/kcmp.h
> index 59371fc07..77086191f 100644
> --- a/include/lapi/kcmp.h
> +++ b/include/lapi/kcmp.h
> @@ -1,29 +1,16 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
>  /*
>   * Copyright (c) 2015 Cedric Hnyda <chnyda@suse.com>
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License as
> - * published by the Free Software Foundation; either version 2 of
> - * the License, or (at your option) any later version.
> - *
> - * 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.  See the
> - * GNU General Public License for more details.
> - *
> - * 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 St, Fifth Floor, Boston, MA  02110-1301  USA
>   */

> -#ifndef KCMP_H
> -#define KCMP_H
> +#ifndef LAPI_KCMP_H__
> +#define LAPI_KCMP_H__

>  #include <sys/types.h>
>  #include "config.h"
>  #include "lapi/syscalls.h"

> -#if !defined(HAVE_ENUM_KCMP_TYPE)
> +#ifndef HAVE_ENUM_KCMP_TYPE

>  enum kcmp_type {
>  	KCMP_FILE,
> @@ -42,7 +29,7 @@ enum kcmp_type {

>  #endif

> -#if !defined(HAVE_KCMP)
> +#ifndef HAVE_KCMP

>  int kcmp(int pid1, int pid2, int type, int fd1, int fd2)
$ make check-pidfd_getfd01
../../../../include/lapi/kcmp.h:34:5: warning: Symbol 'kcmp' has no prototype or library ('tst_') prefix. Should it be static?

Could you please mark this as static inline?

Not sure if this should be with the same commit as SPDX.
When doing cleanup it'd be worth to fix it.

Kind regards,
Petr

>  {
> @@ -51,4 +38,4 @@ int kcmp(int pid1, int pid2, int type, int fd1, int fd2)

>  #endif

> -#endif /* KCMP_H */
> +#endif /* LAPI_KCMP_H__ */
Yang Xu Feb. 18, 2022, 2:13 a.m. UTC | #3
Hi Petr
> Hi Xu,
>
>> Signed-off-by: Yang Xu<xuyang2018.jy@fujitsu.com>
>> ---
>>   include/lapi/kcmp.h | 25 ++++++-------------------
>>   1 file changed, 6 insertions(+), 19 deletions(-)
>
>> diff --git a/include/lapi/kcmp.h b/include/lapi/kcmp.h
>> index 59371fc07..77086191f 100644
>> --- a/include/lapi/kcmp.h
>> +++ b/include/lapi/kcmp.h
>> @@ -1,29 +1,16 @@
>> +// SPDX-License-Identifier: GPL-2.0-or-later
>>   /*
>>    * Copyright (c) 2015 Cedric Hnyda<chnyda@suse.com>
>> - *
>> - * This program is free software; you can redistribute it and/or
>> - * modify it under the terms of the GNU General Public License as
>> - * published by the Free Software Foundation; either version 2 of
>> - * the License, or (at your option) any later version.
>> - *
>> - * 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.  See the
>> - * GNU General Public License for more details.
>> - *
>> - * 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 St, Fifth Floor, Boston, MA  02110-1301  USA
>>    */
>
>> -#ifndef KCMP_H
>> -#define KCMP_H
>> +#ifndef LAPI_KCMP_H__
>> +#define LAPI_KCMP_H__
>
>>   #include<sys/types.h>
>>   #include "config.h"
>>   #include "lapi/syscalls.h"
>
>> -#if !defined(HAVE_ENUM_KCMP_TYPE)
>> +#ifndef HAVE_ENUM_KCMP_TYPE
>
>>   enum kcmp_type {
>>   	KCMP_FILE,
>> @@ -42,7 +29,7 @@ enum kcmp_type {
>
>>   #endif
>
>> -#if !defined(HAVE_KCMP)
>> +#ifndef HAVE_KCMP
>
>>   int kcmp(int pid1, int pid2, int type, int fd1, int fd2)
> $ make check-pidfd_getfd01
> ../../../../include/lapi/kcmp.h:34:5: warning: Symbol 'kcmp' has no prototype or library ('tst_') prefix. Should it be static?
>
> Could you please mark this as static inline?
Of course, in fact, I have changed, but forgot to add it into the final 
version.
>
> Not sure if this should be with the same commit as SPDX.
IMO, I will add it into the same commit and mention that we also replace 
GPL with SPDX. Title maybe changed into "lapi/kcmp.h: Simplify code ".

Best Regards
Yang Xu
> When doing cleanup it'd be worth to fix it.
>
> Kind regards,
> Petr
>
>>   {
>> @@ -51,4 +38,4 @@ int kcmp(int pid1, int pid2, int type, int fd1, int fd2)
>
>>   #endif
>
>> -#endif /* KCMP_H */
>> +#endif /* LAPI_KCMP_H__ */
Petr Vorel Feb. 18, 2022, 8:28 a.m. UTC | #4
Hi Xu,

> >>   int kcmp(int pid1, int pid2, int type, int fd1, int fd2)
> > $ make check-pidfd_getfd01
> > ../../../../include/lapi/kcmp.h:34:5: warning: Symbol 'kcmp' has no prototype or library ('tst_') prefix. Should it be static?

> > Could you please mark this as static inline?
> Of course, in fact, I have changed, but forgot to add it into the final 
> version.
+1

> > Not sure if this should be with the same commit as SPDX.
> IMO, I will add it into the same commit and mention that we also replace 
> GPL with SPDX. Title maybe changed into "lapi/kcmp.h: Simplify code ".
+1

Kind regards,
Petr
diff mbox series

Patch

diff --git a/include/lapi/kcmp.h b/include/lapi/kcmp.h
index 59371fc07..77086191f 100644
--- a/include/lapi/kcmp.h
+++ b/include/lapi/kcmp.h
@@ -1,29 +1,16 @@ 
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2015 Cedric Hnyda <chnyda@suse.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * 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.  See the
- * GNU General Public License for more details.
- *
- * 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 St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef KCMP_H
-#define KCMP_H
+#ifndef LAPI_KCMP_H__
+#define LAPI_KCMP_H__
 
 #include <sys/types.h>
 #include "config.h"
 #include "lapi/syscalls.h"
 
-#if !defined(HAVE_ENUM_KCMP_TYPE)
+#ifndef HAVE_ENUM_KCMP_TYPE
 
 enum kcmp_type {
 	KCMP_FILE,
@@ -42,7 +29,7 @@  enum kcmp_type {
 
 #endif
 
-#if !defined(HAVE_KCMP)
+#ifndef HAVE_KCMP
 
 int kcmp(int pid1, int pid2, int type, int fd1, int fd2)
 {
@@ -51,4 +38,4 @@  int kcmp(int pid1, int pid2, int type, int fd1, int fd2)
 
 #endif
 
-#endif /* KCMP_H */
+#endif /* LAPI_KCMP_H__ */