diff mbox series

[-next] apparmor: remove unneeded #ifdef in decompress_zstd()

Message ID 20230809100244.342530-1-xiujianfeng@huaweicloud.com (mailing list archive)
State Handled Elsewhere
Headers show
Series [-next] apparmor: remove unneeded #ifdef in decompress_zstd() | expand

Commit Message

Xiu Jianfeng Aug. 9, 2023, 10:02 a.m. UTC
From: Xiu Jianfeng <xiujianfeng@huawei.com>

The whole function is guarded by CONFIG_SECURITY_APPARMOR_EXPORT_BINARY,
so the #ifdef here is redundant, remove it.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 security/apparmor/apparmorfs.c | 2 --
 1 file changed, 2 deletions(-)

Comments

John Johansen Aug. 9, 2023, 4:22 a.m. UTC | #1
On 8/9/23 03:02, Xiu Jianfeng wrote:
> From: Xiu Jianfeng <xiujianfeng@huawei.com>
> 
> The whole function is guarded by CONFIG_SECURITY_APPARMOR_EXPORT_BINARY,
> so the #ifdef here is redundant, remove it.
> 

indeed

> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Acked-by: John Johansen <john.johansen@canonical.com>

I have pulled this into apparmor-next


> ---
>   security/apparmor/apparmorfs.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
> index c198a8a2047b..7ee8f4bb7733 100644
> --- a/security/apparmor/apparmorfs.c
> +++ b/security/apparmor/apparmorfs.c
> @@ -1314,7 +1314,6 @@ SEQ_RAWDATA_FOPS(compressed_size);
>   
>   static int decompress_zstd(char *src, size_t slen, char *dst, size_t dlen)
>   {
> -#ifdef CONFIG_SECURITY_APPARMOR_EXPORT_BINARY
>   	if (slen < dlen) {
>   		const size_t wksp_len = zstd_dctx_workspace_bound();
>   		zstd_dctx *ctx;
> @@ -1341,7 +1340,6 @@ static int decompress_zstd(char *src, size_t slen, char *dst, size_t dlen)
>   		kvfree(wksp);
>   		return ret;
>   	}
> -#endif
>   
>   	if (dlen < slen)
>   		return -EINVAL;
diff mbox series

Patch

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index c198a8a2047b..7ee8f4bb7733 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -1314,7 +1314,6 @@  SEQ_RAWDATA_FOPS(compressed_size);
 
 static int decompress_zstd(char *src, size_t slen, char *dst, size_t dlen)
 {
-#ifdef CONFIG_SECURITY_APPARMOR_EXPORT_BINARY
 	if (slen < dlen) {
 		const size_t wksp_len = zstd_dctx_workspace_bound();
 		zstd_dctx *ctx;
@@ -1341,7 +1340,6 @@  static int decompress_zstd(char *src, size_t slen, char *dst, size_t dlen)
 		kvfree(wksp);
 		return ret;
 	}
-#endif
 
 	if (dlen < slen)
 		return -EINVAL;