All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	nv@vosn.de
Subject: Re: [PATCH 2/2] drivers/usb/typec/tps6598x.c: fix 4CC cmd write
Date: Fri, 28 Jun 2019 12:59:42 +0300	[thread overview]
Message-ID: <20190628095942.GC21701@kuha.fi.intel.com> (raw)
In-Reply-To: <47a0d3b0b725c58bf7f422261a7c5d3accafea57.1561712364.git.nikolaus.voss@loewensteinmedical.de>

On Fri, Jun 28, 2019 at 11:01:09AM +0200, Nikolaus Voss wrote:
> Writing 4CC commands with tps6598x_write_4cc() already has
> a pointer arg, don't reference it when using as arg to
> tps6598x_block_write(). Correcting this enforces the constness
> of the pointer to propagate to tps6598x_block_write(), so add
> the const qualifier there to avoid the warning.
> 
> Fixes: 0a4c005bd171 ("usb: typec: driver for TI TPS6598x USB Power Delivery controllers")
> Signed-off-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>

Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/tps6598x.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c
> index a170c49c2542..a38d1409f15b 100644
> --- a/drivers/usb/typec/tps6598x.c
> +++ b/drivers/usb/typec/tps6598x.c
> @@ -127,7 +127,7 @@ tps6598x_block_read(struct tps6598x *tps, u8 reg, void *val, size_t len)
>  }
>  
>  static int tps6598x_block_write(struct tps6598x *tps, u8 reg,
> -				void *val, size_t len)
> +				const void *val, size_t len)
>  {
>  	u8 data[TPS_MAX_LEN + 1];
>  
> @@ -173,7 +173,7 @@ static inline int tps6598x_write64(struct tps6598x *tps, u8 reg, u64 val)
>  static inline int
>  tps6598x_write_4cc(struct tps6598x *tps, u8 reg, const char *val)
>  {
> -	return tps6598x_block_write(tps, reg, &val, sizeof(u32));
> +	return tps6598x_block_write(tps, reg, val, 4);
>  }
>  
>  static int tps6598x_read_partner_identity(struct tps6598x *tps)
> -- 
> 2.17.1

thanks,

-- 
heikki

      reply	other threads:[~2019-06-28  9:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28  8:12 [PATCH] drivers/usb/typec/tps6598x.c: fix two bugs Nikolaus Voss
2019-06-28  8:18 ` Greg Kroah-Hartman
2019-06-28  8:34 ` Heikki Krogerus
2019-06-28  9:01   ` [PATCH 1/2] drivers/usb/typec/tps6598x.c: fix portinfo width Nikolaus Voss
2019-06-28  9:58     ` Heikki Krogerus
2019-06-28 10:10       ` Nikolaus Voss
2019-07-03 16:39         ` Greg Kroah-Hartman
2019-07-03 17:25           ` Nikolaus Voss
2019-07-03 17:37             ` Greg Kroah-Hartman
2019-06-28  9:01   ` [PATCH 2/2] drivers/usb/typec/tps6598x.c: fix 4CC cmd write Nikolaus Voss
2019-06-28  9:59     ` Heikki Krogerus [this message]

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=20190628095942.GC21701@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nikolaus.voss@loewensteinmedical.de \
    --cc=nv@vosn.de \
    /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.