2022-03-22 09:10:09

by Nava kishore Manne

[permalink] [raw]
Subject: [PATCH v2 0/5] fpga: fix for coding style and kernel-doc issues

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

Nava kishore Manne (5):
fpga: zynq: Fix incorrect variable type
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 | 16 +++++++++-------
drivers/fpga/zynq-fpga.c | 2 +-
4 files changed, 19 insertions(+), 13 deletions(-)

--
2.25.1


2022-03-22 09:12:22

by Nava kishore Manne

[permalink] [raw]
Subject: [PATCH v2 1/5] fpga: zynq: Fix incorrect variable type

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 <[email protected]>
---
Changes for v2:
-None.

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

2022-03-22 10:20:08

by Nava kishore Manne

[permalink] [raw]
Subject: [PATCH v2 2/5] fpga: fpga-mgr: fix for coding style issues

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 <[email protected]>
---
Changes for v2:
-None.

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

2022-03-22 13:35:02

by Nava kishore Manne

[permalink] [raw]
Subject: [PATCH v2 3/5] fpga: fpga-mgr: Add missing kernel-doc description

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

Signed-off-by: Nava kishore Manne <[email protected]>
---
Changes for v2:
-Replaced s/@return:/Return:/

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..0f2b28538f17 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

2022-03-27 00:52:02

by Tom Rix

[permalink] [raw]
Subject: Re: [PATCH v2 2/5] fpga: fpga-mgr: fix for coding style issues


On 3/22/22 1:21 AM, Nava kishore Manne wrote:
> fixes the below checks reported by checkpatch.pl
> Lines should not end with a '('
> Alignment should match open parenthesis

There are more than a few similar alignments to clean up in drivers/fpga

Instead of just one, in a separate patchset, clean up all of them.

Tom

>
> Signed-off-by: Nava kishore Manne <[email protected]>
> ---
> Changes for v2:
> -None.
>
> 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");

2022-03-28 04:00:31

by Tom Rix

[permalink] [raw]
Subject: Re: [PATCH v2 3/5] fpga: fpga-mgr: Add missing kernel-doc description


On 3/22/22 1:22 AM, Nava kishore Manne wrote:
> Fixed the warnings: Function parameter or member 'xxx' not
> described.

How were the warnings generated ?

Tom

>
> Signed-off-by: Nava kishore Manne <[email protected]>
> ---
> Changes for v2:
> -Replaced s/@return:/Return:/
>
> 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..0f2b28538f17 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.

2022-03-28 10:50:50

by Tom Rix

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] fpga: zynq: Fix incorrect variable type


On 3/22/22 1:21 AM, Nava kishore Manne wrote:
> 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 <[email protected]>
> ---
> Changes for v2:
> -None.
>
> 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)) {

Instead of casting, change the signature of zynq_fpga_has_sync to use
const char * over const *u8.

Also please review the implementation of zynq_fpga_has_sync.

The comments says 'It must start with .. ' but the loop looks over the
whole buffer

Tom

> dev_err(&mgr->dev,
> "Invalid bitstream, could not find a sync word. Bitstream must be a byte swapped .bin file\n");
> err = -EINVAL;

2022-04-02 14:23:56

by Nava kishore Manne

[permalink] [raw]
Subject: RE: [PATCH v2 2/5] fpga: fpga-mgr: fix for coding style issues

Hi Tom,

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

> -----Original Message-----
> From: Tom Rix <[email protected]>
> Sent: Saturday, March 26, 2022 10:33 PM
> To: Nava kishore Manne <[email protected]>; [email protected];
> [email protected]; [email protected]; Michal Simek
> <[email protected]>; [email protected]; linux-
> [email protected]; [email protected]; git
> <[email protected]>
> Subject: Re: [PATCH v2 2/5] fpga: fpga-mgr: fix for coding style issues
>
>
> On 3/22/22 1:21 AM, Nava kishore Manne wrote:
> > fixes the below checks reported by checkpatch.pl Lines should not end
> > with a '('
> > Alignment should match open parenthesis
>
> There are more than a few similar alignments to clean up in drivers/fpga
>
> Instead of just one, in a separate patchset, clean up all of them.
>
Will fix in v3.

Regards,
Navakishore.

2022-04-04 06:21:51

by Nava kishore Manne

[permalink] [raw]
Subject: RE: [PATCH v2 3/5] fpga: fpga-mgr: Add missing kernel-doc description

Hi Tom,

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

> -----Original Message-----
> From: Tom Rix <[email protected]>
> Sent: Saturday, March 26, 2022 10:36 PM
> To: Nava kishore Manne <[email protected]>; [email protected];
> [email protected]; [email protected]; Michal Simek
> <[email protected]>; [email protected]; linux-
> [email protected]; [email protected]; git
> <[email protected]>
> Subject: Re: [PATCH v2 3/5] fpga: fpga-mgr: Add missing kernel-doc
> description
>
>
> On 3/22/22 1:22 AM, Nava kishore Manne wrote:
> > Fixed the warnings: Function parameter or member 'xxx' not described.
>
> How were the warnings generated ?
>
I Will update the commit message in v3.

Regards,
Navakishore.

2022-04-04 09:14:31

by Nava kishore Manne

[permalink] [raw]
Subject: RE: [PATCH v2 1/5] fpga: zynq: Fix incorrect variable type

Hi Tom,

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

> -----Original Message-----
> From: Tom Rix <[email protected]>
> Sent: Saturday, March 26, 2022 10:24 PM
> To: Nava kishore Manne <[email protected]>; [email protected];
> [email protected]; [email protected]; Michal Simek
> <[email protected]>; [email protected]; linux-
> [email protected]; [email protected]; git
> <[email protected]>
> Subject: Re: [PATCH v2 1/5] fpga: zynq: Fix incorrect variable type
>
>
> On 3/22/22 1:21 AM, Nava kishore Manne wrote:
> > 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 <[email protected]>
> > ---
> > Changes for v2:
> > -None.
> >
> > 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)) {
>
> Instead of casting, change the signature of zynq_fpga_has_sync to use const
> char * over const *u8.
>
> Also please review the implementation of zynq_fpga_has_sync.
>
I agree, will fix in v3.
> The comments says 'It must start with .. ' but the loop looks over the whole
> buffer
>
Will correct the API description in v3.

Regards,
Navakishore.