All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Vitor Soares <vitor.soares@synopsys.com>
Cc: linux-i3c@lists.infradead.org, joao.pinto@synopsys.com,
	stable@vger.kernel.org, Boris Brezillon <bbrezillon@kernel.org>
Subject: Re: [PATCH] i3c: Fix the verification of random PID
Date: Wed, 10 Apr 2019 12:37:59 +0200	[thread overview]
Message-ID: <20190410123759.4fbee94f@collabora.com> (raw)
In-Reply-To: <f787c7ac5a4a82624b1711b9eba2a2a1d4cf5b58.1554828338.git.vitor.soares@synopsys.com>

On Tue,  9 Apr 2019 18:59:59 +0200
Vitor Soares <vitor.soares@synopsys.com> wrote:

> The validation of random PID should be done by checking the
> boardinfo->pid instead of info.pid which is empty.
> 
> Doing the change the info struture declaration is no longer necessary.
> 
> Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure")
> Signed-off-by: Vitor Soares <vitor.soares@synopsys.com>
> 
Note for you future contributions: please don't add a blank line
between Cc and SoB/Fixes lines.

> Cc: Boris Brezillon <bbrezillon@kernel.org>
> Cc: <stable@vger.kernel.org>
> ---
>  drivers/i3c/master.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 569ea68..d23a57e 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -2006,7 +2006,6 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master,
>  {
>  	struct i3c_dev_boardinfo *boardinfo;
>  	struct device *dev = &master->dev;
> -	struct i3c_device_info info = { };
>  	enum i3c_addr_slot_status addrstatus;
>  	u32 init_dyn_addr = 0;
>  
> @@ -2038,8 +2037,8 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master,
>  
>  	boardinfo->pid = ((u64)reg[1] << 32) | reg[2];
>  
> -	if ((info.pid & GENMASK_ULL(63, 48)) ||
> -	    I3C_PID_RND_LOWER_32BITS(info.pid))
> +	if ((boardinfo->pid & GENMASK_ULL(63, 48)) ||
> +	    I3C_PID_RND_LOWER_32BITS(boardinfo->pid))
>  		return -EINVAL;
>  
>  	boardinfo->init_dyn_addr = init_dyn_addr;


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

WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Vitor Soares <vitor.soares@synopsys.com>
Cc: linux-i3c@lists.infradead.org, joao.pinto@synopsys.com,
	Boris Brezillon <bbrezillon@kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] i3c: Fix the verification of random PID
Date: Wed, 10 Apr 2019 12:37:59 +0200	[thread overview]
Message-ID: <20190410123759.4fbee94f@collabora.com> (raw)
In-Reply-To: <f787c7ac5a4a82624b1711b9eba2a2a1d4cf5b58.1554828338.git.vitor.soares@synopsys.com>

On Tue,  9 Apr 2019 18:59:59 +0200
Vitor Soares <vitor.soares@synopsys.com> wrote:

> The validation of random PID should be done by checking the
> boardinfo->pid instead of info.pid which is empty.
> 
> Doing the change the info struture declaration is no longer necessary.
> 
> Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure")
> Signed-off-by: Vitor Soares <vitor.soares@synopsys.com>
> 
Note for you future contributions: please don't add a blank line
between Cc and SoB/Fixes lines.

> Cc: Boris Brezillon <bbrezillon@kernel.org>
> Cc: <stable@vger.kernel.org>
> ---
>  drivers/i3c/master.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 569ea68..d23a57e 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -2006,7 +2006,6 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master,
>  {
>  	struct i3c_dev_boardinfo *boardinfo;
>  	struct device *dev = &master->dev;
> -	struct i3c_device_info info = { };
>  	enum i3c_addr_slot_status addrstatus;
>  	u32 init_dyn_addr = 0;
>  
> @@ -2038,8 +2037,8 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master,
>  
>  	boardinfo->pid = ((u64)reg[1] << 32) | reg[2];
>  
> -	if ((info.pid & GENMASK_ULL(63, 48)) ||
> -	    I3C_PID_RND_LOWER_32BITS(info.pid))
> +	if ((boardinfo->pid & GENMASK_ULL(63, 48)) ||
> +	    I3C_PID_RND_LOWER_32BITS(boardinfo->pid))
>  		return -EINVAL;
>  
>  	boardinfo->init_dyn_addr = init_dyn_addr;


  reply	other threads:[~2019-04-10 10:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 16:59 [PATCH] i3c: Fix the verification of random PID Vitor Soares
2019-04-09 16:59 ` Vitor Soares
2019-04-10 10:37 ` Boris Brezillon [this message]
2019-04-10 10:37   ` Boris Brezillon

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=20190410123759.4fbee94f@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=bbrezillon@kernel.org \
    --cc=joao.pinto@synopsys.com \
    --cc=linux-i3c@lists.infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=vitor.soares@synopsys.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.