[PATCH v1 1/2] libcamera: Drop file name from header comment blocks in templates

Dan Scally dan.scally at ideasonboard.com
Wed May 8 23:02:18 CEST 2024


On 08/05/2024 21:59, Laurent Pinchart wrote:
> Source files in libcamera start by a comment block header, which
> includes the file name and a one-line description of the file contents.
> While the latter is useful to get a quick overview of the file contents
> at a glance, the former is mostly a source of inconvenience. The name in
> the comments can easily get out of sync with the file name when files
> are renamed, and copy & paste during development have often lead to
> incorrect names being used to start with.
>
> Readers of the source code are expected to know which file they're
> looking it. Drop the file name from the header comment blocks in
> template files and templates embedded in generator scripts.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>


Looks good


Reviewed-by: Daniel Scally <dan.scally at ideasonboard.com>

> ---
>   include/libcamera/control_ids.h.in                              | 2 +-
>   include/libcamera/formats.h.in                                  | 2 +-
>   include/libcamera/internal/tracepoints.h.in                     | 2 +-
>   include/libcamera/property_ids.h.in                             | 2 +-
>   include/libcamera/version.h.in                                  | 2 +-
>   src/libcamera/ipa_pub_key.cpp.in                                | 2 +-
>   src/libcamera/version.cpp.in                                    | 2 +-
>   utils/gen-header.sh                                             | 2 +-
>   utils/ipc/extract-docs.py                                       | 2 +-
>   .../generators/libcamera_templates/core_ipa_interface.h.tmpl    | 2 +-
>   .../generators/libcamera_templates/core_ipa_serializer.h.tmpl   | 2 +-
>   .../generators/libcamera_templates/module_ipa_interface.h.tmpl  | 2 +-
>   .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl    | 2 +-
>   .../ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl  | 2 +-
>   .../libcamera_templates/module_ipa_proxy_worker.cpp.tmpl        | 2 +-
>   .../generators/libcamera_templates/module_ipa_serializer.h.tmpl | 2 +-
>   16 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/include/libcamera/control_ids.h.in b/include/libcamera/control_ids.h.in
> index 58dd48e169c7..293ba966fbc4 100644
> --- a/include/libcamera/control_ids.h.in
> +++ b/include/libcamera/control_ids.h.in
> @@ -2,7 +2,7 @@
>   /*
>    * Copyright (C) 2019, Google Inc.
>    *
> - * control_ids.h - Control ID list
> + * Control ID list
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/include/libcamera/formats.h.in b/include/libcamera/formats.h.in
> index ead5287d8299..6ae7634fed34 100644
> --- a/include/libcamera/formats.h.in
> +++ b/include/libcamera/formats.h.in
> @@ -2,7 +2,7 @@
>   /*
>    * Copyright (C) 2020, Google Inc.
>    *
> - * formats.h - Formats
> + * Formats
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/include/libcamera/internal/tracepoints.h.in b/include/libcamera/internal/tracepoints.h.in
> index d0fc136598b6..f0962091da8f 100644
> --- a/include/libcamera/internal/tracepoints.h.in
> +++ b/include/libcamera/internal/tracepoints.h.in
> @@ -2,7 +2,7 @@
>   /*
>    * Copyright (C) {{year}}, Google Inc.
>    *
> - * tracepoints.h - Tracepoints with lttng
> + * Tracepoints with lttng
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/include/libcamera/property_ids.h.in b/include/libcamera/property_ids.h.in
> index f51ba028bb2e..e6edabca771f 100644
> --- a/include/libcamera/property_ids.h.in
> +++ b/include/libcamera/property_ids.h.in
> @@ -2,7 +2,7 @@
>   /*
>    * Copyright (C) 2019, Google Inc.
>    *
> - * property_ids.h - Property ID list
> + * Property ID list
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/include/libcamera/version.h.in b/include/libcamera/version.h.in
> index 6e24d0a89fcb..50bf1001ec0f 100644
> --- a/include/libcamera/version.h.in
> +++ b/include/libcamera/version.h.in
> @@ -2,7 +2,7 @@
>   /*
>    * Copyright (C) 2019, Google Inc.
>    *
> - * version.h - Library version information
> + * Library version information
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/src/libcamera/ipa_pub_key.cpp.in b/src/libcamera/ipa_pub_key.cpp.in
> index 01e5333b4d30..5d8c92c2c39d 100644
> --- a/src/libcamera/ipa_pub_key.cpp.in
> +++ b/src/libcamera/ipa_pub_key.cpp.in
> @@ -2,7 +2,7 @@
>   /*
>    * Copyright (C) 2020, Laurent Pinchart <laurent.pinchart at ideasonboard.com>
>    *
> - * ipa_pub_key.cpp - IPA module signing public key
> + * IPA module signing public key
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/src/libcamera/version.cpp.in b/src/libcamera/version.cpp.in
> index 5aec08a189f3..bf5a2c309676 100644
> --- a/src/libcamera/version.cpp.in
> +++ b/src/libcamera/version.cpp.in
> @@ -2,7 +2,7 @@
>   /*
>    * Copyright (C) 2019, Google Inc.
>    *
> - * version.cpp - libcamera version
> + * libcamera version
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/utils/gen-header.sh b/utils/gen-header.sh
> index 8b66c5dd0f47..d4692758eeb4 100755
> --- a/utils/gen-header.sh
> +++ b/utils/gen-header.sh
> @@ -9,7 +9,7 @@ cat <<EOF > "$dst_file"
>   /*
>    * Copyright (C) 2018-2019, Google Inc.
>    *
> - * libcamera.h - libcamera public API
> + * libcamera public API
>    */
>   
>   #pragma once
> diff --git a/utils/ipc/extract-docs.py b/utils/ipc/extract-docs.py
> index e7302b9a3798..61f44caef52a 100755
> --- a/utils/ipc/extract-docs.py
> +++ b/utils/ipc/extract-docs.py
> @@ -38,7 +38,7 @@ def main(argv):
>   /*
>    * Copyright (C) 2021, Google Inc.
>    *
> - * {pipeline}_ipa_interface.cpp - Docs file for generated {pipeline}.mojom
> + * Docs file for generated {pipeline}.mojom
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl b/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl
> index c60b99b8e049..7f2d0810823b 100644
> --- a/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl
> +++ b/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl
> @@ -7,7 +7,7 @@
>   /*
>    * Copyright (C) 2020, Google Inc.
>    *
> - * core_ipa_interface.h - libcamera core definitions for Image Processing Algorithms
> + * libcamera core definitions for Image Processing Algorithms
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl b/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl
> index 5738a1aa3405..036518f6cfbd 100644
> --- a/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl
> +++ b/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl
> @@ -8,7 +8,7 @@
>   /*
>    * Copyright (C) 2020, Google Inc.
>    *
> - * core_ipa_serializer.h - Data serializer for core libcamera definitions for IPA
> + * Data serializer for core libcamera definitions for IPA
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl
> index 160601f72348..4d88a3d77d0f 100644
> --- a/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl
> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl
> @@ -7,7 +7,7 @@
>   /*
>    * Copyright (C) 2020, Google Inc.
>    *
> - * {{module_name}}_ipa_interface.h - Image Processing Algorithm interface for {{module_name}}
> + * Image Processing Algorithm interface for {{module_name}}
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> index f64c3c93bfcb..ce3cc5ab62a3 100644
> --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> @@ -8,7 +8,7 @@
>   /*
>    * Copyright (C) 2020, Google Inc.
>    *
> - * {{module_name}}_ipa_proxy.cpp - Image Processing Algorithm proxy for {{module_name}}
> + * Image Processing Algorithm proxy for {{module_name}}
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> index 6e823598930e..e213b18a051f 100644
> --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> @@ -8,7 +8,7 @@
>   /*
>    * Copyright (C) 2020, Google Inc.
>    *
> - * {{module_name}}_ipa_proxy.h - Image Processing Algorithm proxy for {{module_name}}
> + * Image Processing Algorithm proxy for {{module_name}}
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
> index b65dc4cf31c5..1f990d3f9d1c 100644
> --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl
> @@ -8,7 +8,7 @@
>   /*
>    * Copyright (C) 2020, Google Inc.
>    *
> - * {{module_name}}_ipa_proxy_worker.cpp - Image Processing Algorithm proxy worker for {{module_name}}
> + * Image Processing Algorithm proxy worker for {{module_name}}
>    *
>    * This file is auto-generated. Do not edit.
>    */
> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl
> index 8b709705aa32..cd5a65a9200e 100644
> --- a/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl
> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl
> @@ -8,7 +8,7 @@
>   /*
>    * Copyright (C) 2020, Google Inc.
>    *
> - * {{module_name}}_ipa_serializer.h - Image Processing Algorithm data serializer for {{module_name}}
> + * Image Processing Algorithm data serializer for {{module_name}}
>    *
>    * This file is auto-generated. Do not edit.
>    */


More information about the libcamera-devel mailing list