2020-12-07 19:33:00

by Philipp Gerlesberger

[permalink] [raw]
Subject: [PATCH 01/12] media: atomsip: Convert comments to C99 initializers

The struct initalizers have been changed as recommended on
https://kernelnewbies.org/KernelJanitors/Todo

Co-developed-by: Andrey Khlopkov <[email protected]>
Signed-off-by: Andrey Khlopkov <[email protected]>
Signed-off-by: Philipp Gerlesberger <[email protected]>
---
.../atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c | 30 +++++++++----------
1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
index b4f53be18e7f..af61d05e88d3 100644
--- a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
+++ b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
@@ -31,33 +31,33 @@ static struct ia_css_rmgr_vbuf_handle handle_table[NUM_HANDLES];
* @brief VBUF resource pool - refpool
*/
static struct ia_css_rmgr_vbuf_pool refpool = {
- false, /* copy_on_write */
- false, /* recycle */
- 0, /* size */
- 0, /* index */
- NULL, /* handles */
+ .copy_on_write = false,
+ .recycle = false,
+ .size = 0,
+ .index = 0,
+ .handles = NULL,
};

/*
* @brief VBUF resource pool - writepool
*/
static struct ia_css_rmgr_vbuf_pool writepool = {
- true, /* copy_on_write */
- false, /* recycle */
- 0, /* size */
- 0, /* index */
- NULL, /* handles */
+ .copy_on_write = true,
+ .recycle = false,
+ .size = 0,
+ .index = 0,
+ .handles = NULL,
};

/*
* @brief VBUF resource pool - hmmbufferpool
*/
static struct ia_css_rmgr_vbuf_pool hmmbufferpool = {
- true, /* copy_on_write */
- true, /* recycle */
- 32, /* size */
- 0, /* index */
- NULL, /* handles */
+ .copy_on_write = true,
+ .recycle = true,
+ .size = 32,
+ .index = 0,
+ .handles = NULL,
};

struct ia_css_rmgr_vbuf_pool *vbuf_ref = &refpool;
--
2.20.1


2020-12-09 00:57:15

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 01/12] media: atomsip: Convert comments to C99 initializers

On Mon, Dec 07, 2020 at 08:26:27PM +0100, Philipp Gerlesberger wrote:
> The struct initalizers have been changed as recommended on
> https://kernelnewbies.org/KernelJanitors/Todo
>
> Co-developed-by: Andrey Khlopkov <[email protected]>
> Signed-off-by: Andrey Khlopkov <[email protected]>
> Signed-off-by: Philipp Gerlesberger <[email protected]>
> ---
> .../atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c | 30 +++++++++----------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
> index b4f53be18e7f..af61d05e88d3 100644
> --- a/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
> +++ b/drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
> @@ -31,33 +31,33 @@ static struct ia_css_rmgr_vbuf_handle handle_table[NUM_HANDLES];
> * @brief VBUF resource pool - refpool
> */
> static struct ia_css_rmgr_vbuf_pool refpool = {
> - false, /* copy_on_write */
> - false, /* recycle */
> - 0, /* size */
> - 0, /* index */
> - NULL, /* handles */
> + .copy_on_write = false,
> + .recycle = false,
> + .size = 0,
> + .index = 0,
> + .handles = NULL,

If you're using C99 initializers then you can remove all the false, 0
and NULL members.

regards,
dan carpenter