Re: [PATCH] media: staging: tegra-vde: Cleaned uapi.h from checkpatch warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



10.03.2019 4:22, Mateo de Mayo пишет:
> Added SPDX identifier and __packed structs
> 
> Signed-off-by: Mateo de Mayo <mateodemayo@xxxxxxxxx>
> ---
>  drivers/staging/media/tegra-vde/uapi.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/tegra-vde/uapi.h b/drivers/staging/media/tegra-vde/uapi.h
> index 4bce08a7a54c..d32fc97f54b1 100644
> --- a/drivers/staging/media/tegra-vde/uapi.h
> +++ b/drivers/staging/media/tegra-vde/uapi.h
> @@ -1,3 +1,4 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
>  /*
>   * Copyright (C) 2016-2017 Dmitry Osipenko <digetx@xxxxxxxxx>
>   *
> @@ -29,7 +30,7 @@ struct tegra_vde_h264_frame {
>  	__u32 flags;
>  
>  	__u32 reserved;
> -} __attribute__((packed));
> +} __packed;
>  
>  struct tegra_vde_h264_decoder_ctx {
>  	__s32 bitstream_data_fd;
> @@ -61,7 +62,7 @@ struct tegra_vde_h264_decoder_ctx {
>  	__u8  num_ref_idx_l1_active_minus1;
>  
>  	__u32 reserved;
> -} __attribute__((packed));
> +} __packed;
>  
>  #define VDE_IOCTL_BASE			('v' + 0x20)
>  
> 

Hello Mateo,

The license part is good to me. The _packed part not, there was another attempt to use the macro before [https://lkml.org/lkml/2018/11/7/603] and I suggested that it is not a very good idea since that macro isn't a part of UAPI headers. I guess it will be better to just add a definition for the __packed into this header instead of NAK'ing such attempts in the future.

Please add these lines to the patch:

#ifndef __packed
#define __packed		__attribute__((packed))
#endif

I also just noticed that the BIT() macro got into the UAPI header behind my back.. so will be nice if you'll add a macro for that case too, thanks:

#ifndef BIT(nr)
#define BIT(nr)			(1UL << (nr))
#endif



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux