linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6]fpga: fix for coding style and kernel-doc issues
@ 2022-03-08  9:45 Nava kishore Manne
  2022-03-08  9:45 ` [PATCH 1/6] fpga: zynq: Fix incorrect variable type Nava kishore Manne
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Nava kishore Manne @ 2022-03-08  9:45 UTC (permalink / raw)
  To: mdf, hao.wu, yilun.xu, trix, michal.simek, linux-fpga,
	linux-kernel, linux-arm-kernel
  Cc: Nava kishore Manne

This patch series fixes the coding style and kernel-doc issues
exists in the fpga framework, zynq and ZynqMP drivers.

Nava kishore Manne (6):
  fpga: zynq: Fix incorrect variable type
  fpga: zynqmp: Initialized variables before using it
  fpga: fpga-mgr: fix for coding style issues
  fpga: fpga-mgr: Add missing kernel-doc description
  fpga: Use tab instead of spaces for indentation
  fpga: fpga-region: Add missing kernel-doc description

 drivers/fpga/Makefile         |  6 +++---
 drivers/fpga/fpga-mgr.c       |  8 ++++++--
 drivers/fpga/of-fpga-region.c | 18 ++++++++++--------
 drivers/fpga/zynq-fpga.c      |  2 +-
 drivers/fpga/zynqmp-fpga.c    |  2 +-
 5 files changed, 21 insertions(+), 15 deletions(-)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/6] fpga: zynq: Fix incorrect variable type
  2022-03-08  9:45 [PATCH 0/6]fpga: fix for coding style and kernel-doc issues Nava kishore Manne
@ 2022-03-08  9:45 ` Nava kishore Manne
  2022-03-08  9:45 ` [PATCH 2/6] fpga: zynqmp: Initialized variables before using it Nava kishore Manne
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Nava kishore Manne @ 2022-03-08  9:45 UTC (permalink / raw)
  To: mdf, hao.wu, yilun.xu, trix, michal.simek, linux-fpga,
	linux-kernel, linux-arm-kernel
  Cc: Nava kishore Manne

zynq_fpga_has_sync () API is expecting "u8 *" but the
formal parameter that was passed is of type "const char *".
To fix this issue cast the const char pointer to u8 pointer.

Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
---
 drivers/fpga/zynq-fpga.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c
index 426aa34c6a0d..12f644e79e91 100644
--- a/drivers/fpga/zynq-fpga.c
+++ b/drivers/fpga/zynq-fpga.c
@@ -275,7 +275,7 @@ static int zynq_fpga_ops_write_init(struct fpga_manager *mgr,
 
 	/* don't globally reset PL if we're doing partial reconfig */
 	if (!(info->flags & FPGA_MGR_PARTIAL_RECONFIG)) {
-		if (!zynq_fpga_has_sync(buf, count)) {
+		if (!zynq_fpga_has_sync((u8 *)buf, count)) {
 			dev_err(&mgr->dev,
 				"Invalid bitstream, could not find a sync word. Bitstream must be a byte swapped .bin file\n");
 			err = -EINVAL;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/6] fpga: zynqmp: Initialized variables before using it
  2022-03-08  9:45 [PATCH 0/6]fpga: fix for coding style and kernel-doc issues Nava kishore Manne
  2022-03-08  9:45 ` [PATCH 1/6] fpga: zynq: Fix incorrect variable type Nava kishore Manne
@ 2022-03-08  9:45 ` Nava kishore Manne
  2022-03-11 14:28   ` Xu Yilun
  2022-03-08  9:45 ` [PATCH 3/6] fpga: fpga-mgr: fix for coding style issues Nava kishore Manne
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Nava kishore Manne @ 2022-03-08  9:45 UTC (permalink / raw)
  To: mdf, hao.wu, yilun.xu, trix, michal.simek, linux-fpga,
	linux-kernel, linux-arm-kernel
  Cc: Nava kishore Manne

This patch initialized variables with the proper value.
Addresses-Coverity: "uninit_use: Using uninitialized value"

Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
---
 drivers/fpga/zynqmp-fpga.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fpga/zynqmp-fpga.c b/drivers/fpga/zynqmp-fpga.c
index c60f20949c47..e931d69819a7 100644
--- a/drivers/fpga/zynqmp-fpga.c
+++ b/drivers/fpga/zynqmp-fpga.c
@@ -41,7 +41,7 @@ static int zynqmp_fpga_ops_write(struct fpga_manager *mgr,
 				 const char *buf, size_t size)
 {
 	struct zynqmp_fpga_priv *priv;
-	dma_addr_t dma_addr;
+	dma_addr_t dma_addr = 0;
 	u32 eemi_flags = 0;
 	char *kbuf;
 	int ret;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/6] fpga: fpga-mgr: fix for coding style issues
  2022-03-08  9:45 [PATCH 0/6]fpga: fix for coding style and kernel-doc issues Nava kishore Manne
  2022-03-08  9:45 ` [PATCH 1/6] fpga: zynq: Fix incorrect variable type Nava kishore Manne
  2022-03-08  9:45 ` [PATCH 2/6] fpga: zynqmp: Initialized variables before using it Nava kishore Manne
@ 2022-03-08  9:45 ` Nava kishore Manne
  2022-03-08  9:45 ` [PATCH 4/6] fpga: fpga-mgr: Add missing kernel-doc description Nava kishore Manne
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Nava kishore Manne @ 2022-03-08  9:45 UTC (permalink / raw)
  To: mdf, hao.wu, yilun.xu, trix, michal.simek, linux-fpga,
	linux-kernel, linux-arm-kernel
  Cc: Nava kishore Manne

fixes the below checks reported by checkpatch.pl
Lines should not end with a '('
Alignment should match open parenthesis

Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
---
 drivers/fpga/fpga-mgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
index d49a9ce34568..a699cc8e2fa6 100644
--- a/drivers/fpga/fpga-mgr.c
+++ b/drivers/fpga/fpga-mgr.c
@@ -151,8 +151,8 @@ static int fpga_mgr_write_init_buf(struct fpga_manager *mgr,
 	if (!mgr->mops->initial_header_size)
 		ret = fpga_mgr_write_init(mgr, info, NULL, 0);
 	else
-		ret = fpga_mgr_write_init(
-		    mgr, info, buf, min(mgr->mops->initial_header_size, count));
+		ret = fpga_mgr_write_init(mgr, info, buf,
+					  min(mgr->mops->initial_header_size, count));
 
 	if (ret) {
 		dev_err(&mgr->dev, "Error preparing FPGA for writing\n");
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/6] fpga: fpga-mgr: Add missing kernel-doc description
  2022-03-08  9:45 [PATCH 0/6]fpga: fix for coding style and kernel-doc issues Nava kishore Manne
                   ` (2 preceding siblings ...)
  2022-03-08  9:45 ` [PATCH 3/6] fpga: fpga-mgr: fix for coding style issues Nava kishore Manne
@ 2022-03-08  9:45 ` Nava kishore Manne
  2022-03-08 21:38   ` Randy Dunlap
  2022-03-08  9:45 ` [PATCH 5/6] fpga: Use tab instead of spaces for indentation Nava kishore Manne
  2022-03-08  9:45 ` [PATCH 6/6] fpga: fpga-region: Add missing kernel-doc description Nava kishore Manne
  5 siblings, 1 reply; 14+ messages in thread
From: Nava kishore Manne @ 2022-03-08  9:45 UTC (permalink / raw)
  To: mdf, hao.wu, yilun.xu, trix, michal.simek, linux-fpga,
	linux-kernel, linux-arm-kernel
  Cc: Nava kishore Manne

Fixed the warnings: Function parameter or member 'xxx' not
described.

Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
---
 drivers/fpga/fpga-mgr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
index a699cc8e2fa6..354789740529 100644
--- a/drivers/fpga/fpga-mgr.c
+++ b/drivers/fpga/fpga-mgr.c
@@ -730,6 +730,8 @@ static void devm_fpga_mgr_unregister(struct device *dev, void *res)
  * @parent:	fpga manager device from pdev
  * @info:	parameters for fpga manager
  *
+ * @return:  fpga manager pointer on success, negative error code otherwise.
+ *
  * This is the devres variant of fpga_mgr_register_full() for which the unregister
  * function will be called automatically when the managing device is detached.
  */
@@ -763,6 +765,8 @@ EXPORT_SYMBOL_GPL(devm_fpga_mgr_register_full);
  * @mops:	pointer to structure of fpga manager ops
  * @priv:	fpga manager private data
  *
+ * @return:  fpga manager pointer on success, negative error code otherwise.
+ *
  * This is the devres variant of fpga_mgr_register() for which the
  * unregister function will be called automatically when the managing
  * device is detached.
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/6] fpga: Use tab instead of spaces for indentation
  2022-03-08  9:45 [PATCH 0/6]fpga: fix for coding style and kernel-doc issues Nava kishore Manne
                   ` (3 preceding siblings ...)
  2022-03-08  9:45 ` [PATCH 4/6] fpga: fpga-mgr: Add missing kernel-doc description Nava kishore Manne
@ 2022-03-08  9:45 ` Nava kishore Manne
  2022-03-08  9:45 ` [PATCH 6/6] fpga: fpga-region: Add missing kernel-doc description Nava kishore Manne
  5 siblings, 0 replies; 14+ messages in thread
From: Nava kishore Manne @ 2022-03-08  9:45 UTC (permalink / raw)
  To: mdf, hao.wu, yilun.xu, trix, michal.simek, linux-fpga,
	linux-kernel, linux-arm-kernel
  Cc: Nava kishore Manne

Trivial fix.

Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
---
 drivers/fpga/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile
index 0bff783d1b61..5935b3d0abd5 100644
--- a/drivers/fpga/Makefile
+++ b/drivers/fpga/Makefile
@@ -18,9 +18,9 @@ obj-$(CONFIG_FPGA_MGR_TS73XX)		+= ts73xx-fpga.o
 obj-$(CONFIG_FPGA_MGR_XILINX_SPI)	+= xilinx-spi.o
 obj-$(CONFIG_FPGA_MGR_ZYNQ_FPGA)	+= zynq-fpga.o
 obj-$(CONFIG_FPGA_MGR_ZYNQMP_FPGA)	+= zynqmp-fpga.o
-obj-$(CONFIG_FPGA_MGR_VERSAL_FPGA)      += versal-fpga.o
-obj-$(CONFIG_ALTERA_PR_IP_CORE)         += altera-pr-ip-core.o
-obj-$(CONFIG_ALTERA_PR_IP_CORE_PLAT)    += altera-pr-ip-core-plat.o
+obj-$(CONFIG_FPGA_MGR_VERSAL_FPGA)	+= versal-fpga.o
+obj-$(CONFIG_ALTERA_PR_IP_CORE)		+= altera-pr-ip-core.o
+obj-$(CONFIG_ALTERA_PR_IP_CORE_PLAT)	+= altera-pr-ip-core-plat.o
 
 # FPGA Bridge Drivers
 obj-$(CONFIG_FPGA_BRIDGE)		+= fpga-bridge.o
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/6] fpga: fpga-region: Add missing kernel-doc description
  2022-03-08  9:45 [PATCH 0/6]fpga: fix for coding style and kernel-doc issues Nava kishore Manne
                   ` (4 preceding siblings ...)
  2022-03-08  9:45 ` [PATCH 5/6] fpga: Use tab instead of spaces for indentation Nava kishore Manne
@ 2022-03-08  9:45 ` Nava kishore Manne
  2022-03-08 21:40   ` Randy Dunlap
  5 siblings, 1 reply; 14+ messages in thread
From: Nava kishore Manne @ 2022-03-08  9:45 UTC (permalink / raw)
  To: mdf, hao.wu, yilun.xu, trix, michal.simek, linux-fpga,
	linux-kernel, linux-arm-kernel
  Cc: Nava kishore Manne

Fixed the warnings: Function parameter or member 'xxx' not
described.

Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
---
 drivers/fpga/of-fpga-region.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
index 50b83057c048..61ce257c47f3 100644
--- a/drivers/fpga/of-fpga-region.c
+++ b/drivers/fpga/of-fpga-region.c
@@ -28,7 +28,7 @@ MODULE_DEVICE_TABLE(of, fpga_region_of_match);
  *
  * Caller will need to put_device(&region->dev) when done.
  *
- * Returns FPGA Region struct or NULL
+ * @return: FPGA Region struct or NULL
  */
 static struct fpga_region *of_fpga_region_find(struct device_node *np)
 {
@@ -43,7 +43,7 @@ static struct fpga_region *of_fpga_region_find(struct device_node *np)
  *
  * Caller should call fpga_mgr_put() when done with manager.
  *
- * Return: fpga manager struct or IS_ERR() condition containing error code.
+ * @return: fpga manager struct or IS_ERR() condition containing error code.
  */
 static struct fpga_manager *of_fpga_region_get_mgr(struct device_node *np)
 {
@@ -80,7 +80,7 @@ static struct fpga_manager *of_fpga_region_get_mgr(struct device_node *np)
  * Caller should call fpga_bridges_put(&region->bridge_list) when
  * done with the bridges.
  *
- * Return 0 for success (even if there are no bridges specified)
+ * @return: 0 for success (even if there are no bridges specified)
  * or -EBUSY if any of the bridges are in use.
  */
 static int of_fpga_region_get_bridges(struct fpga_region *region)
@@ -139,13 +139,13 @@ static int of_fpga_region_get_bridges(struct fpga_region *region)
 }
 
 /**
- * child_regions_with_firmware
+ * child_regions_with_firmware - Used to check the child region info.
  * @overlay: device node of the overlay
  *
  * If the overlay adds child FPGA regions, they are not allowed to have
  * firmware-name property.
  *
- * Return 0 for OK or -EINVAL if child FPGA region adds firmware-name.
+ * @return: 0 for OK or -EINVAL if child FPGA region adds firmware-name.
  */
 static int child_regions_with_firmware(struct device_node *overlay)
 {
@@ -184,7 +184,7 @@ static int child_regions_with_firmware(struct device_node *overlay)
  * Given an overlay applied to an FPGA region, parse the FPGA image specific
  * info in the overlay and do some checking.
  *
- * Returns:
+ * @return:
  *   NULL if overlay doesn't direct us to program the FPGA.
  *   fpga_image_info struct if there is an image to program.
  *   error code for invalid overlay.
@@ -279,7 +279,7 @@ static struct fpga_image_info *of_fpga_region_parse_ov(
  * If the checks fail, overlay is rejected and does not get added to the
  * live tree.
  *
- * Returns 0 for success or negative error code for failure.
+ * @return: 0 for success or negative error code for failure.
  */
 static int of_fpga_region_notify_pre_apply(struct fpga_region *region,
 					   struct of_overlay_notify_data *nd)
@@ -339,7 +339,7 @@ static void of_fpga_region_notify_post_remove(struct fpga_region *region,
  * This notifier handles programming an FPGA when a "firmware-name" property is
  * added to an fpga-region.
  *
- * Returns NOTIFY_OK or error if FPGA programming fails.
+ * @return: NOTIFY_OK or error if FPGA programming fails.
  */
 static int of_fpga_region_notify(struct notifier_block *nb,
 				 unsigned long action, void *arg)
@@ -446,6 +446,8 @@ static struct platform_driver of_fpga_region_driver = {
 /**
  * of_fpga_region_init - init function for fpga_region class
  * Creates the fpga_region class and registers a reconfig notifier.
+ *
+ * @return: 0 on success, negative error code otherwise.
  */
 static int __init of_fpga_region_init(void)
 {
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/6] fpga: fpga-mgr: Add missing kernel-doc description
  2022-03-08  9:45 ` [PATCH 4/6] fpga: fpga-mgr: Add missing kernel-doc description Nava kishore Manne
@ 2022-03-08 21:38   ` Randy Dunlap
  2022-03-15 11:51     ` Nava kishore Manne
  0 siblings, 1 reply; 14+ messages in thread
From: Randy Dunlap @ 2022-03-08 21:38 UTC (permalink / raw)
  To: Nava kishore Manne, mdf, hao.wu, yilun.xu, trix, michal.simek,
	linux-fpga, linux-kernel, linux-arm-kernel

Hi--

On 3/8/22 01:45, Nava kishore Manne wrote:
> Fixed the warnings: Function parameter or member 'xxx' not
> described.
> 
> Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
> ---
>  drivers/fpga/fpga-mgr.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
> index a699cc8e2fa6..354789740529 100644
> --- a/drivers/fpga/fpga-mgr.c
> +++ b/drivers/fpga/fpga-mgr.c
> @@ -730,6 +730,8 @@ static void devm_fpga_mgr_unregister(struct device *dev, void *res)
>   * @parent:	fpga manager device from pdev
>   * @info:	parameters for fpga manager
>   *
> + * @return:  fpga manager pointer on success, negative error code otherwise.

Not quite. Should be:

 * Return: foo bar blah

> + *
>   * This is the devres variant of fpga_mgr_register_full() for which the unregister
>   * function will be called automatically when the managing device is detached.
>   */
> @@ -763,6 +765,8 @@ EXPORT_SYMBOL_GPL(devm_fpga_mgr_register_full);
>   * @mops:	pointer to structure of fpga manager ops
>   * @priv:	fpga manager private data
>   *
> + * @return:  fpga manager pointer on success, negative error code otherwise.

ditto.

> + *
>   * This is the devres variant of fpga_mgr_register() for which the
>   * unregister function will be called automatically when the managing
>   * device is detached.

thanks.
-- 
~Randy

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 6/6] fpga: fpga-region: Add missing kernel-doc description
  2022-03-08  9:45 ` [PATCH 6/6] fpga: fpga-region: Add missing kernel-doc description Nava kishore Manne
@ 2022-03-08 21:40   ` Randy Dunlap
  0 siblings, 0 replies; 14+ messages in thread
From: Randy Dunlap @ 2022-03-08 21:40 UTC (permalink / raw)
  To: Nava kishore Manne, mdf, hao.wu, yilun.xu, trix, michal.simek,
	linux-fpga, linux-kernel, linux-arm-kernel

Hi,

For all function return results,

s/@return:/Return:/

thanks.

On 3/8/22 01:45, Nava kishore Manne wrote:
> Fixed the warnings: Function parameter or member 'xxx' not
> described.
> 
> Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
> ---
>  drivers/fpga/of-fpga-region.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
> index 50b83057c048..61ce257c47f3 100644
> --- a/drivers/fpga/of-fpga-region.c
> +++ b/drivers/fpga/of-fpga-region.c
> @@ -28,7 +28,7 @@ MODULE_DEVICE_TABLE(of, fpga_region_of_match);
>   *
>   * Caller will need to put_device(&region->dev) when done.
>   *
> - * Returns FPGA Region struct or NULL
> + * @return: FPGA Region struct or NULL
>   */
>  static struct fpga_region *of_fpga_region_find(struct device_node *np)
>  {
> @@ -43,7 +43,7 @@ static struct fpga_region *of_fpga_region_find(struct device_node *np)
>   *
>   * Caller should call fpga_mgr_put() when done with manager.
>   *
> - * Return: fpga manager struct or IS_ERR() condition containing error code.
> + * @return: fpga manager struct or IS_ERR() condition containing error code.
>   */
>  static struct fpga_manager *of_fpga_region_get_mgr(struct device_node *np)
>  {
> @@ -80,7 +80,7 @@ static struct fpga_manager *of_fpga_region_get_mgr(struct device_node *np)
>   * Caller should call fpga_bridges_put(&region->bridge_list) when
>   * done with the bridges.
>   *
> - * Return 0 for success (even if there are no bridges specified)
> + * @return: 0 for success (even if there are no bridges specified)
>   * or -EBUSY if any of the bridges are in use.
>   */
>  static int of_fpga_region_get_bridges(struct fpga_region *region)
> @@ -139,13 +139,13 @@ static int of_fpga_region_get_bridges(struct fpga_region *region)
>  }
>  
>  /**
> - * child_regions_with_firmware
> + * child_regions_with_firmware - Used to check the child region info.
>   * @overlay: device node of the overlay
>   *
>   * If the overlay adds child FPGA regions, they are not allowed to have
>   * firmware-name property.
>   *
> - * Return 0 for OK or -EINVAL if child FPGA region adds firmware-name.
> + * @return: 0 for OK or -EINVAL if child FPGA region adds firmware-name.
>   */
>  static int child_regions_with_firmware(struct device_node *overlay)
>  {
> @@ -184,7 +184,7 @@ static int child_regions_with_firmware(struct device_node *overlay)
>   * Given an overlay applied to an FPGA region, parse the FPGA image specific
>   * info in the overlay and do some checking.
>   *
> - * Returns:
> + * @return:
>   *   NULL if overlay doesn't direct us to program the FPGA.
>   *   fpga_image_info struct if there is an image to program.
>   *   error code for invalid overlay.
> @@ -279,7 +279,7 @@ static struct fpga_image_info *of_fpga_region_parse_ov(
>   * If the checks fail, overlay is rejected and does not get added to the
>   * live tree.
>   *
> - * Returns 0 for success or negative error code for failure.
> + * @return: 0 for success or negative error code for failure.
>   */
>  static int of_fpga_region_notify_pre_apply(struct fpga_region *region,
>  					   struct of_overlay_notify_data *nd)
> @@ -339,7 +339,7 @@ static void of_fpga_region_notify_post_remove(struct fpga_region *region,
>   * This notifier handles programming an FPGA when a "firmware-name" property is
>   * added to an fpga-region.
>   *
> - * Returns NOTIFY_OK or error if FPGA programming fails.
> + * @return: NOTIFY_OK or error if FPGA programming fails.
>   */
>  static int of_fpga_region_notify(struct notifier_block *nb,
>  				 unsigned long action, void *arg)
> @@ -446,6 +446,8 @@ static struct platform_driver of_fpga_region_driver = {
>  /**
>   * of_fpga_region_init - init function for fpga_region class
>   * Creates the fpga_region class and registers a reconfig notifier.
> + *
> + * @return: 0 on success, negative error code otherwise.
>   */
>  static int __init of_fpga_region_init(void)
>  {

-- 
~Randy

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/6] fpga: zynqmp: Initialized variables before using it
  2022-03-08  9:45 ` [PATCH 2/6] fpga: zynqmp: Initialized variables before using it Nava kishore Manne
@ 2022-03-11 14:28   ` Xu Yilun
  2022-03-15 11:48     ` Nava kishore Manne
  0 siblings, 1 reply; 14+ messages in thread
From: Xu Yilun @ 2022-03-11 14:28 UTC (permalink / raw)
  To: Nava kishore Manne
  Cc: mdf, hao.wu, trix, michal.simek, linux-fpga, linux-kernel,
	linux-arm-kernel

On Tue, Mar 08, 2022 at 03:15:15PM +0530, Nava kishore Manne wrote:
> This patch initialized variables with the proper value.
> Addresses-Coverity: "uninit_use: Using uninitialized value"
> 
> Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
> ---
>  drivers/fpga/zynqmp-fpga.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/fpga/zynqmp-fpga.c b/drivers/fpga/zynqmp-fpga.c
> index c60f20949c47..e931d69819a7 100644
> --- a/drivers/fpga/zynqmp-fpga.c
> +++ b/drivers/fpga/zynqmp-fpga.c
> @@ -41,7 +41,7 @@ static int zynqmp_fpga_ops_write(struct fpga_manager *mgr,
>  				 const char *buf, size_t size)
>  {
>  	struct zynqmp_fpga_priv *priv;
> -	dma_addr_t dma_addr;
> +	dma_addr_t dma_addr = 0;

The first use of this variable is as an output parameter:

	kbuf = dma_alloc_coherent(priv->dev, size, &dma_addr, GFP_KERNEL);

So I don't think it needs to be initialized as 0.

Thanks,
Yilun

>  	u32 eemi_flags = 0;
>  	char *kbuf;
>  	int ret;
> -- 
> 2.25.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH 2/6] fpga: zynqmp: Initialized variables before using it
  2022-03-11 14:28   ` Xu Yilun
@ 2022-03-15 11:48     ` Nava kishore Manne
  2022-03-15 16:08       ` Xu Yilun
  0 siblings, 1 reply; 14+ messages in thread
From: Nava kishore Manne @ 2022-03-15 11:48 UTC (permalink / raw)
  To: Xu Yilun
  Cc: mdf, hao.wu, trix, Michal Simek, linux-fpga, linux-kernel,
	linux-arm-kernel

Hi Yilun,

	Thanks for providing the review comments.
Please find my response inline.

> -----Original Message-----
> From: Xu Yilun <yilun.xu@intel.com>
> Sent: Friday, March 11, 2022 7:58 PM
> To: Nava kishore Manne <navam@xilinx.com>
> Cc: mdf@kernel.org; hao.wu@intel.com; trix@redhat.com; Michal Simek
> <michals@xilinx.com>; linux-fpga@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH 2/6] fpga: zynqmp: Initialized variables before using it
> 
> On Tue, Mar 08, 2022 at 03:15:15PM +0530, Nava kishore Manne wrote:
> > This patch initialized variables with the proper value.
> > Addresses-Coverity: "uninit_use: Using uninitialized value"
> >
> > Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
> > ---
> >  drivers/fpga/zynqmp-fpga.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/fpga/zynqmp-fpga.c b/drivers/fpga/zynqmp-fpga.c
> > index c60f20949c47..e931d69819a7 100644
> > --- a/drivers/fpga/zynqmp-fpga.c
> > +++ b/drivers/fpga/zynqmp-fpga.c
> > @@ -41,7 +41,7 @@ static int zynqmp_fpga_ops_write(struct
> fpga_manager *mgr,
> >  				 const char *buf, size_t size)
> >  {
> >  	struct zynqmp_fpga_priv *priv;
> > -	dma_addr_t dma_addr;
> > +	dma_addr_t dma_addr = 0;
> 
> The first use of this variable is as an output parameter:
> 
> 	kbuf = dma_alloc_coherent(priv->dev, size, &dma_addr,
> GFP_KERNEL);
> 
> So I don't think it needs to be initialized as 0.
> 

This issue is found by Coverity Scan, Whether this param is input/output this fix will not impact the actual functionality.
In order to fix the issues reported by the Coverity tool, this fix is needed.

Regards,
Navakishore.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH 4/6] fpga: fpga-mgr: Add missing kernel-doc description
  2022-03-08 21:38   ` Randy Dunlap
@ 2022-03-15 11:51     ` Nava kishore Manne
  0 siblings, 0 replies; 14+ messages in thread
From: Nava kishore Manne @ 2022-03-15 11:51 UTC (permalink / raw)
  To: Randy Dunlap, mdf, hao.wu, yilun.xu, trix, Michal Simek,
	linux-fpga, linux-kernel, linux-arm-kernel

Hi Randy,

	Thanks for providing the review comments.
Please find response inline.

> -----Original Message-----
> From: Randy Dunlap <rdunlap@infradead.org>
> Sent: Wednesday, March 9, 2022 3:09 AM
> To: Nava kishore Manne <navam@xilinx.com>; mdf@kernel.org;
> hao.wu@intel.com; yilun.xu@intel.com; trix@redhat.com; Michal Simek
> <michals@xilinx.com>; linux-fpga@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH 4/6] fpga: fpga-mgr: Add missing kernel-doc description
> 
> Hi--
> 
> On 3/8/22 01:45, Nava kishore Manne wrote:
> > Fixed the warnings: Function parameter or member 'xxx' not described.
> >
> > Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
> > ---
> >  drivers/fpga/fpga-mgr.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c index
> > a699cc8e2fa6..354789740529 100644
> > --- a/drivers/fpga/fpga-mgr.c
> > +++ b/drivers/fpga/fpga-mgr.c
> > @@ -730,6 +730,8 @@ static void devm_fpga_mgr_unregister(struct
> device *dev, void *res)
> >   * @parent:	fpga manager device from pdev
> >   * @info:	parameters for fpga manager
> >   *
> > + * @return:  fpga manager pointer on success, negative error code
> otherwise.
> 
> Not quite. Should be:
> 
>  * Return: foo bar blah
> 

Will fix in v2

> > + *
> >   * This is the devres variant of fpga_mgr_register_full() for which the
> unregister
> >   * function will be called automatically when the managing device is
> detached.
> >   */
> > @@ -763,6 +765,8 @@
> EXPORT_SYMBOL_GPL(devm_fpga_mgr_register_full);
> >   * @mops:	pointer to structure of fpga manager ops
> >   * @priv:	fpga manager private data
> >   *
> > + * @return:  fpga manager pointer on success, negative error code
> otherwise.
> 
> ditto.
> 

Will fix in v2.

Regards,
Navakishore.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/6] fpga: zynqmp: Initialized variables before using it
  2022-03-15 11:48     ` Nava kishore Manne
@ 2022-03-15 16:08       ` Xu Yilun
  2022-03-22  6:55         ` Nava kishore Manne
  0 siblings, 1 reply; 14+ messages in thread
From: Xu Yilun @ 2022-03-15 16:08 UTC (permalink / raw)
  To: Nava kishore Manne
  Cc: mdf, hao.wu, trix, Michal Simek, linux-fpga, linux-kernel,
	linux-arm-kernel

On Tue, Mar 15, 2022 at 11:48:11AM +0000, Nava kishore Manne wrote:
> Hi Yilun,
> 
> 	Thanks for providing the review comments.
> Please find my response inline.
> 
> > -----Original Message-----
> > From: Xu Yilun <yilun.xu@intel.com>
> > Sent: Friday, March 11, 2022 7:58 PM
> > To: Nava kishore Manne <navam@xilinx.com>
> > Cc: mdf@kernel.org; hao.wu@intel.com; trix@redhat.com; Michal Simek
> > <michals@xilinx.com>; linux-fpga@vger.kernel.org; linux-
> > kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> > Subject: Re: [PATCH 2/6] fpga: zynqmp: Initialized variables before using it
> > 
> > On Tue, Mar 08, 2022 at 03:15:15PM +0530, Nava kishore Manne wrote:
> > > This patch initialized variables with the proper value.
> > > Addresses-Coverity: "uninit_use: Using uninitialized value"
> > >
> > > Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
> > > ---
> > >  drivers/fpga/zynqmp-fpga.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/fpga/zynqmp-fpga.c b/drivers/fpga/zynqmp-fpga.c
> > > index c60f20949c47..e931d69819a7 100644
> > > --- a/drivers/fpga/zynqmp-fpga.c
> > > +++ b/drivers/fpga/zynqmp-fpga.c
> > > @@ -41,7 +41,7 @@ static int zynqmp_fpga_ops_write(struct
> > fpga_manager *mgr,
> > >  				 const char *buf, size_t size)
> > >  {
> > >  	struct zynqmp_fpga_priv *priv;
> > > -	dma_addr_t dma_addr;
> > > +	dma_addr_t dma_addr = 0;
> > 
> > The first use of this variable is as an output parameter:
> > 
> > 	kbuf = dma_alloc_coherent(priv->dev, size, &dma_addr,
> > GFP_KERNEL);
> > 
> > So I don't think it needs to be initialized as 0.
> > 
> 
> This issue is found by Coverity Scan, Whether this param is input/output this fix will not impact the actual functionality.
> In order to fix the issues reported by the Coverity tool, this fix is needed.

I didn't see issues about this piece of code, so I don't think we need
the fix just to make the tool happy. Maybe the tool could be improved to
help us better.

Thanks,
Yilun

> 
> Regards,
> Navakishore.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH 2/6] fpga: zynqmp: Initialized variables before using it
  2022-03-15 16:08       ` Xu Yilun
@ 2022-03-22  6:55         ` Nava kishore Manne
  0 siblings, 0 replies; 14+ messages in thread
From: Nava kishore Manne @ 2022-03-22  6:55 UTC (permalink / raw)
  To: Xu Yilun
  Cc: mdf, hao.wu, trix, Michal Simek, linux-fpga, linux-kernel,
	linux-arm-kernel

Hi Yilun,

	Please find my response inline.

> -----Original Message-----
> From: Xu Yilun <yilun.xu@intel.com>
> Sent: Tuesday, March 15, 2022 9:39 PM
> To: Nava kishore Manne <navam@xilinx.com>
> Cc: mdf@kernel.org; hao.wu@intel.com; trix@redhat.com; Michal Simek
> <michals@xilinx.com>; linux-fpga@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH 2/6] fpga: zynqmp: Initialized variables before using it
> 
> On Tue, Mar 15, 2022 at 11:48:11AM +0000, Nava kishore Manne wrote:
> > Hi Yilun,
> >
> > 	Thanks for providing the review comments.
> > Please find my response inline.
> >
> > > -----Original Message-----
> > > From: Xu Yilun <yilun.xu@intel.com>
> > > Sent: Friday, March 11, 2022 7:58 PM
> > > To: Nava kishore Manne <navam@xilinx.com>
> > > Cc: mdf@kernel.org; hao.wu@intel.com; trix@redhat.com; Michal Simek
> > > <michals@xilinx.com>; linux-fpga@vger.kernel.org; linux-
> > > kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> > > Subject: Re: [PATCH 2/6] fpga: zynqmp: Initialized variables before
> > > using it
> > >
> > > On Tue, Mar 08, 2022 at 03:15:15PM +0530, Nava kishore Manne wrote:
> > > > This patch initialized variables with the proper value.
> > > > Addresses-Coverity: "uninit_use: Using uninitialized value"
> > > >
> > > > Signed-off-by: Nava kishore Manne <nava.manne@xilinx.com>
> > > > ---
> > > >  drivers/fpga/zynqmp-fpga.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/fpga/zynqmp-fpga.c
> > > > b/drivers/fpga/zynqmp-fpga.c index c60f20949c47..e931d69819a7
> > > > 100644
> > > > --- a/drivers/fpga/zynqmp-fpga.c
> > > > +++ b/drivers/fpga/zynqmp-fpga.c
> > > > @@ -41,7 +41,7 @@ static int zynqmp_fpga_ops_write(struct
> > > fpga_manager *mgr,
> > > >  				 const char *buf, size_t size)  {
> > > >  	struct zynqmp_fpga_priv *priv;
> > > > -	dma_addr_t dma_addr;
> > > > +	dma_addr_t dma_addr = 0;
> > >
> > > The first use of this variable is as an output parameter:
> > >
> > > 	kbuf = dma_alloc_coherent(priv->dev, size, &dma_addr,
> GFP_KERNEL);
> > >
> > > So I don't think it needs to be initialized as 0.
> > >
> >
> > This issue is found by Coverity Scan, Whether this param is input/output
> this fix will not impact the actual functionality.
> > In order to fix the issues reported by the Coverity tool, this fix is needed.
> 
> I didn't see issues about this piece of code, so I don't think we need the fix
> just to make the tool happy. Maybe the tool could be improved to help us
> better.
> 

Agreed, I will drop this patch in v2.

Regards,
Navakishore.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-03-22  6:57 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08  9:45 [PATCH 0/6]fpga: fix for coding style and kernel-doc issues Nava kishore Manne
2022-03-08  9:45 ` [PATCH 1/6] fpga: zynq: Fix incorrect variable type Nava kishore Manne
2022-03-08  9:45 ` [PATCH 2/6] fpga: zynqmp: Initialized variables before using it Nava kishore Manne
2022-03-11 14:28   ` Xu Yilun
2022-03-15 11:48     ` Nava kishore Manne
2022-03-15 16:08       ` Xu Yilun
2022-03-22  6:55         ` Nava kishore Manne
2022-03-08  9:45 ` [PATCH 3/6] fpga: fpga-mgr: fix for coding style issues Nava kishore Manne
2022-03-08  9:45 ` [PATCH 4/6] fpga: fpga-mgr: Add missing kernel-doc description Nava kishore Manne
2022-03-08 21:38   ` Randy Dunlap
2022-03-15 11:51     ` Nava kishore Manne
2022-03-08  9:45 ` [PATCH 5/6] fpga: Use tab instead of spaces for indentation Nava kishore Manne
2022-03-08  9:45 ` [PATCH 6/6] fpga: fpga-region: Add missing kernel-doc description Nava kishore Manne
2022-03-08 21:40   ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).