Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10460708imu; Thu, 6 Dec 2018 01:15:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/UgHp0mXrJ7nqHLe8mwUBZxANS0rpoU5nZb0VDZAOg/1lca3Rw8/arxfUZsu6EkOsNnR+Np X-Received: by 2002:a63:e302:: with SMTP id f2mr23794136pgh.320.1544087723718; Thu, 06 Dec 2018 01:15:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544087723; cv=none; d=google.com; s=arc-20160816; b=yxftZYDBTXsuEUgkwIdltx837cDNPV58uAA+/yUtB9q0Rnh+omdZcKpayXeat2zCBX gJw6MHtKVCPzkuky/3JJc3w5DreN3ELpUzsRusYRgJkq/oRsd5E29UeF6GrdgRq1Jdi9 uhqI9ytUoXop4ifwYDlhsghxgZqKx8B8xhKbSHR98ad9dm3zB1rlXJjT4iDRJBJJKPFs dsvipVvg353IounZIr591Ov0p1gACN8V3jYHVxodlix+jvIp1CVfA1NtZZyPn+PAqPaP mY1bE2V6tAxXvsVF1dclA05Ki67Etxw16CJ1LiqPeAPfw4WhbqlDwWorABAawZo6D1Jy eTqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=uK9okPm9Mw/4WyB/RnJmeQNoyXRjooQtzepjAV5zljI=; b=sxmhIwUsu45XyZ9lFI55rw1FjkTiSAJWDqAqPOyYYl/TdynxEnk1MV9aIjq4X6VoUg QtVgu1cGqDOXFaIoL/PJ5vheBTS0gTy8/NJvoHZyFpWc3WZxfnAzLTlQpzdvGKdzr8YK 1QmEgHWmkdxQNcjGvzW2Eo45bgLH8dIXWMasSUgQfdA388yQV18tk1DMGPIP59K17wsU ALNRyK4f8VWjloQ8eu7KrkAilyC8bBJ0zGEtrTU7mnnbrlnVZqE0B+8iuygdzQo/CJ5T A0wmgT8xE4DIdyd1lWvlAn63/7trJD1o6LWA3cBXXIM3nLLwEq4rWGlQqcPxf037uEv8 9zfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sXpBSLPf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j22si21375731pfi.252.2018.12.06.01.15.08; Thu, 06 Dec 2018 01:15:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sXpBSLPf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729362AbeLFJOV (ORCPT + 99 others); Thu, 6 Dec 2018 04:14:21 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36901 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727575AbeLFJOV (ORCPT ); Thu, 6 Dec 2018 04:14:21 -0500 Received: by mail-wm1-f67.google.com with SMTP id g67so206651wmd.2; Thu, 06 Dec 2018 01:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=uK9okPm9Mw/4WyB/RnJmeQNoyXRjooQtzepjAV5zljI=; b=sXpBSLPf7Iz/kCivuKx53TNjj7sJ1CaH3ZLD04etslXvvod2OzydTmNd+4Y0ajIEGA wPaTrpRR8V1i/HOWCU9T5YvvYiIsqtksMfGJV+S6WpMOvQ1z63TMz6Ic5FBSWJhRurOA mJNBrbAxf8Z0cuwvXoa8xKWPcMfIOu5cJCOSErKgLP585xg4EReju9hBjaNAvKEnsYvr TDTv+MIZkswm6V9J9JGC4l8LKntS/Gn1V9xXq9w7J0+mOSDiHeEYVfJ0RlFJuiO8j6Sc Cx/HEyWuylJs+GTnIipUm7xKk/b0FJhEe2ySO9nTg+rgZwkHZ+cUfcFCGwqr4yT07FeT LwEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uK9okPm9Mw/4WyB/RnJmeQNoyXRjooQtzepjAV5zljI=; b=dZBaa6Lbs2jKZ17oK5UUafwM5D6OX4sitYm1UVCfwAuSuJgcpdWoi7CzHvNiXFejii GqtZ6tKzcmj/xWTxI1sG4PpqbClIYkGtxv46O1++za2ZAWNUOH+TobPVUZNUVa6naMoB fH3NIuaYEiDNjjWztcpVAlSdVWu9KEyRg+awIGEjUBXYR+l+BvGMAtEUE3sjdEQ044C6 Rbfe79N8fnge9NJGKxbRyFiW3L2KgcXWKDWg0VjPsK/GY+83gYfinsO1skZE/vpMqKPL aWsWAF2qPlAAKX/sLFHuecrNLNBiWIcZ/Fc9BMGLGfque8vb1kFwQSHwNKNSH/l5Og1X 1tOg== X-Gm-Message-State: AA+aEWakHDHpf0VK4ZCa1ibxwwHpXmlKj5KP1Ia55LqDRs+rSkWQabgW /uF0SdOVQfuqXmadEKEVUuY= X-Received: by 2002:a1c:af89:: with SMTP id y131mr18608376wme.137.1544087658870; Thu, 06 Dec 2018 01:14:18 -0800 (PST) Received: from [192.168.1.4] (ip-86-49-110-70.net.upcbroadband.cz. [86.49.110.70]) by smtp.gmail.com with ESMTPSA id h131sm238636wmd.17.2018.12.06.01.14.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 01:14:18 -0800 (PST) Subject: Re: [PATCH v2 1/2] spi: Add Renesas R-Car Gen3 RPC SPI controller driver To: Geert Uytterhoeven , masonccyang@mxic.com.tw Cc: Boris Brezillon , Mark Brown , Geert Uytterhoeven , Simon Horman , juliensu@mxic.com.tw, Linux Kernel Mailing List , Linux-Renesas , linux-spi , zhengxunli@mxic.com.tw References: <1543828720-18345-1-git-send-email-masonccyang@mxic.com.tw> <1543828720-18345-2-git-send-email-masonccyang@mxic.com.tw> <84e3c55b-687e-28f6-0a7c-1c48c822ef05@gmail.com> From: Marek Vasut Message-ID: <915d772b-616b-9f2e-8f4e-16d9d349e0cf@gmail.com> Date: Thu, 6 Dec 2018 10:14:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/06/2018 10:12 AM, Geert Uytterhoeven wrote: > Hi Mason, > > On Thu, Dec 6, 2018 at 8:31 AM 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 > >>>>>> + 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