All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>, masonccyang@mxic.com.tw
Cc: Boris Brezillon <boris.brezillon@bootlin.com>,
	Mark Brown <broonie@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Simon Horman <horms@verge.net.au>,
	juliensu@mxic.com.tw,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	zhengxunli@mxic.com.tw
Subject: Re: [PATCH v2 1/2] spi: Add Renesas R-Car Gen3 RPC SPI controller driver
Date: Thu, 6 Dec 2018 10:14:17 +0100	[thread overview]
Message-ID: <915d772b-616b-9f2e-8f4e-16d9d349e0cf@gmail.com> (raw)
In-Reply-To: <CAMuHMdWspyRq_K2Vd6Xk2tqft-oUoMvVhj-zKS-fuhv_edXb8Q@mail.gmail.com>

On 12/06/2018 10:12 AM, Geert Uytterhoeven wrote:
> Hi Mason,
> 
> On Thu, Dec 6, 2018 at 8:31 AM <masonccyang@mxic.com.tw> wrote:
>>>>> Re: [PATCH v2 1/2] spi: Add Renesas R-Car Gen3 RPC SPI controller driver
>>>>>
>>>>> On 12/03/2018 10:18 AM, Mason Yang wrote:
>>>>>> Add a driver for Renesas R-Car Gen3 RPC SPI controller.
>>>>>>
>>>>>> Signed-off-by: Mason Yang <masonccyang@mxic.com.tw>
> 
>>>>>> +   xfercnt = xferpos;
>>>>>> +   rpc->xferlen = xfer[--xferpos].len;
>>>>>> +   rpc->cmd = RPC_SMCMR_CMD(((u8 *)xfer[0].tx_buf)[0]);
>>>>>
>>>>> Is the cast needed ?
>>>>
>>>> yes!
>>>
>>> Why ?
>>
>> Get a compiler warning due to tx_bug is void *, as Geert replied.
>>
>> Using get_unaligned(), patched code would be
>> ---------------------------------------------------------------
>>  rpc->cmd = RPC_SMCMR_CMD(get_unaligned((u8 *)xfer[0].tx_buf));
>> ----------------------------------------------------------------
> 
> Using get_unaligned(0 is a bit strange for accessing a single byte quantity.
> Please keep the normal pointer dereference (including the cast).

Oh, right, for single bytes this is OK.

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2018-12-06  9:14 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03  9:18 [PATCH v2 0/2] spi: Add Renesas R-Car Gen3 RPC SPI driver Mason Yang
2018-12-03  9:18 ` [PATCH v2 1/2] spi: Add Renesas R-Car Gen3 RPC SPI controller driver Mason Yang
2018-12-04 18:43   ` Marek Vasut
2018-12-05  7:44     ` masonccyang
2018-12-05  9:11       ` Geert Uytterhoeven
2018-12-05 12:35         ` Marek Vasut
2018-12-05 12:49       ` Marek Vasut
2018-12-05 13:15         ` Geert Uytterhoeven
2018-12-05 13:24           ` Marek Vasut
2018-12-05 13:31             ` Geert Uytterhoeven
2018-12-05 13:34               ` Marek Vasut
2018-12-06  7:30         ` masonccyang
2018-12-06  9:02           ` Marek Vasut
2018-12-06  9:02             ` Marek Vasut
2018-12-07  7:24             ` masonccyang
2018-12-07 12:01               ` Marek Vasut
2018-12-07 12:01                 ` Marek Vasut
2018-12-06  9:12           ` Geert Uytterhoeven
2018-12-06  9:14             ` Marek Vasut [this message]
2018-12-05  9:06   ` Geert Uytterhoeven
2018-12-06  5:56     ` masonccyang
2018-12-06  8:56       ` Marek Vasut
2018-12-06  9:17         ` masonccyang
2018-12-06  9:19           ` Marek Vasut
2018-12-06  9:19             ` Marek Vasut
2018-12-07 18:17   ` Sergei Shtylyov
2018-12-07 18:23     ` Marek Vasut
2018-12-11  9:26     ` masonccyang
2018-12-11 16:46       ` Sergei Shtylyov
     [not found]         ` <OF719DFBAE.D0F9F117-ON4825836A.0039EEA3-4825836A.003B28D8@mxic.com.tw>
2018-12-22 14:20           ` Sergei Shtylyov
2018-12-03  9:18 ` [PATCH v2 2/2] dt-binding: spi: Document Renesas R-Car Gen3 RPC controller bindings Mason Yang
2018-12-04 18:19   ` Marek Vasut
2018-12-05  8:39     ` masonccyang
2018-12-05 12:53       ` Marek Vasut
2018-12-05 12:53         ` Marek Vasut
2018-12-05 18:56     ` Sergei Shtylyov
2018-12-05 21:55       ` Marek Vasut

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=915d772b-616b-9f2e-8f4e-16d9d349e0cf@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=horms@verge.net.au \
    --cc=juliensu@mxic.com.tw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=masonccyang@mxic.com.tw \
    --cc=zhengxunli@mxic.com.tw \
    /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.