lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e13a07f6-d251-4510-aa3a-3a90583bd404@linuxfoundation.org>
Date:   Thu, 30 Nov 2023 16:46:35 -0700
From:   Shuah Khan <skhan@...uxfoundation.org>
To:     Atul Kumar Pant <atulpant.linux@...il.com>, tj@...nel.org,
        lizefan.x@...edance.com, hannes@...xchg.org, shuah@...nel.org
Cc:     cgroups@...r.kernel.org, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH v1] selftests: cgroup: Fixes code style errors

On 11/6/23 11:11, Atul Kumar Pant wrote:
> Fixes following checkpatch.pl issues:
> ERROR: do not use assignment in if condition
> ERROR: Macros starting with if should be enclosed by a do - while
> 
> Signed-off-by: Atul Kumar Pant <atulpant.linux@...il.com>
> ---
>   tools/testing/selftests/cgroup/cgroup_util.c | 14 ++++++++------
>   tools/testing/selftests/cgroup/test_core.c   |  3 ++-
>   2 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c
> index 0340d4ca8f51..e165c4a703a6 100644
> --- a/tools/testing/selftests/cgroup/cgroup_util.c
> +++ b/tools/testing/selftests/cgroup/cgroup_util.c
> @@ -411,12 +411,14 @@ int dirfd_open_opath(const char *dir)
>   	return open(dir, O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW | O_PATH);
>   }
>   
> -#define close_prot_errno(fd)                                                   \
> -	if (fd >= 0) {                                                         \
> -		int _e_ = errno;                                               \
> -		close(fd);                                                     \
> -		errno = _e_;                                                   \
> -	}
> +#define close_prot_errno(fd)				\
> +	do {						\
> +		if (fd >= 0) {                          \
> +			int _e_ = errno;                \
> +			close(fd);                      \
> +			errno = _e_;                    \
> +		}					\
> +	} while (0);

Did you run checkpatch on this patch? You are fixing
checkpatch errors - :)

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ