mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Rix <trix@redhat.com>
To: Nava kishore Manne <nava.manne@xilinx.com>,
	mdf@kernel.org, hao.wu@intel.com, yilun.xu@intel.com,
	michal.simek@xilinx.com, linux-fpga@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, git@xilinx.com
Subject: Re: [PATCH v2 1/5] fpga: zynq: Fix incorrect variable type
Date: Sat, 26 Mar 2022 09:54:04 -0700	[thread overview]
Message-ID: <aa99b73f-0169-0d16-0bce-ac3f3dfffa68@redhat.com> (raw)
In-Reply-To: <20220322082202.2007321-2-nava.manne@xilinx.com>


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 <nava.manne@xilinx.com>
> ---
> 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;


  reply	other threads:[~2022-03-26 16:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22  8:21 [PATCH v2 0/5] fpga: fix for coding style and kernel-doc issues Nava kishore Manne
2022-03-22  8:21 ` [PATCH v2 1/5] fpga: zynq: Fix incorrect variable type Nava kishore Manne
2022-03-26 16:54   ` Tom Rix [this message]
2022-04-01 15:45     ` Nava kishore Manne
2022-03-22  8:21 ` [PATCH v2 2/5] fpga: fpga-mgr: fix for coding style issues Nava kishore Manne
2022-03-26 17:03   ` Tom Rix
2022-04-01 15:47     ` Nava kishore Manne
2022-03-22  8:22 ` [PATCH v2 3/5] fpga: fpga-mgr: Add missing kernel-doc description Nava kishore Manne
2022-03-26 17:06   ` Tom Rix
2022-04-01 15:50     ` Nava kishore Manne
2022-03-22  8:22 ` [PATCH v2 4/5] fpga: Use tab instead of spaces for indentation Nava kishore Manne
2022-03-26 17:08   ` Tom Rix
2022-04-01 15:51     ` Nava kishore Manne
2022-03-22  8:22 ` [PATCH v2 5/5] fpga: fpga-region: Add missing kernel-doc description Nava kishore Manne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa99b73f-0169-0d16-0bce-ac3f3dfffa68@redhat.com \
    --to=trix@redhat.com \
    --cc=git@xilinx.com \
    --cc=hao.wu@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=nava.manne@xilinx.com \
    --cc=yilun.xu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®