Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9439258imu; Wed, 5 Dec 2018 04:59:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/WD4PvogyHIvVSO/2pVohddg0BoZ36C9eoWBGWzAI+Aio2y6ms6YFuHOqDc3ZFa00cnTbhR X-Received: by 2002:a63:b4c:: with SMTP id a12mr20713697pgl.131.1544014747070; Wed, 05 Dec 2018 04:59:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544014747; cv=none; d=google.com; s=arc-20160816; b=DcLNzsiX3H76UO/afVaphlH2ptejf5E3A7vZaGwesQqwrKvIfblSM9rDE/OoN49qjq KOz3Hl++gL0WFXVHVDPcL8/cfoTd+hXGmOHv8L3AEBQMiMeJVM+C7KNj1MN/FqMkyxDa PA6eZR6qhzgDfYwUDY6lYIz/WIMZ2zP+EzsG7v+pi+2krkL4jbIBw/E8C5ssJUfK7yJJ r7KjtUfWQXH8Krrk7bEaDobC4m/DYsJ5cAEGM4f0lpaU+lPez3qqWuF1D65EFQE4fwxE 72OLpKokccjoerg3McH2in80oh9zgncBoJ3SzjBhwolj4m75SGvt09rQvkrSqQzOCzMd B6OQ== 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=8UdnAtR9/yN+nJuk+GNTk+gAMGkrxfRiYdrHzN1jSK0=; b=k4ZXSMK6d63cMjZKbc9/+CZxaAdzTHWartWJ2qPPvSzZMV9Dff79GujXrQ/N4BLLZz DKJs9kLy6FDwhYOZIa0FcuKOd+7I28uYaHDZvGqWOa+ucoTF+xpbA90SwlE1WdfmXtC9 /yaUPm0xjugIxoxVmGVjHgcNyeu4Dhl0Ojp8+grpDjenBDn/WUGRXP/RZRIXpUEgmzM1 bh0mBomadjnIwAHMH6vFhPNYAO3hYwx+yGXj4MO2+dKW/otTEbn2rxO+GrD/I4u6ojN7 bbT0iGL6P15DZqOUSpXkgkOtpIbnDgSveIJuYsip0CGgKb1CzTBwQ31x5UBjVGbYqtXh WIYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Gqcb0ivL; 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 o192si18110104pgo.129.2018.12.05.04.58.51; Wed, 05 Dec 2018 04:59:07 -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=Gqcb0ivL; 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 S1728075AbeLEM5x (ORCPT + 99 others); Wed, 5 Dec 2018 07:57:53 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33945 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727796AbeLEM5v (ORCPT ); Wed, 5 Dec 2018 07:57:51 -0500 Received: by mail-wr1-f68.google.com with SMTP id j2so19606576wrw.1; Wed, 05 Dec 2018 04:57:49 -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=8UdnAtR9/yN+nJuk+GNTk+gAMGkrxfRiYdrHzN1jSK0=; b=Gqcb0ivLu5iAdcHJeK0b2eJn21/zO+GpQGUIGrHv652QMqsQcc+NO+5P6TvReLF8QN R73YTopLYrCpvjJn6fQiWWV/Qm3MnYb0iqUGESk1ZlS/pkothd+/6nW58k5eNXeycxpz Tu+Y7A9lY82zTOKEfqAs+N04eSmGao1HxaDjxqKgsnxZ8t1vd4C/oW3tSnSAQXkzbhVd yxZbz4l5EG9T9lyrAtG5293juc1nRNGRhUX24ZkCVBOFQd53IQTDvqnuNK1P3xq8BJaK 4IoStV3htSqXryaQQSzUf6hIJB7db0oR/8avfCBwlwyls9xAlqFJDPnHzMQwKYS8c92o omOw== 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=8UdnAtR9/yN+nJuk+GNTk+gAMGkrxfRiYdrHzN1jSK0=; b=Cn1Xkcr7MJNP3O5toVBSeOlm0sDK0cq5krTgwgNqhhLfeJTrl4vJi6rd4/F6th35/S lZOve9PMoCGEVms9kjTGgPUo6Z+IVlpzhq0tnonRCdMC0fqAidMlI3iMSdMOXF+k8b+G oa6e0srdNjPAElxxtoKzXsFxfFEyS30y7IFgzhQwejmBNDtAUzuURzemE4syzXNmQqsf lPoiKDkYfcLrSTuUq/IC+GdvaLyS8YdgI+TqXFzWA/em0bhd3rWNE/rGxOnTEUQRlQuE 1fMBOn38LGD8OWZh+MPyAULmZoUS12J4DT2LSqhOPew+Ce5Br1/xK+jFu9xi9rjjvkNV JuAQ== X-Gm-Message-State: AA+aEWZsaRlARpL8Vyxn732EQFxgc8YrvP+HSfZA8EcNBmbwAIFa7us6 6yzJpKoLpi90inDEiceyXlJrTdL9 X-Received: by 2002:adf:f848:: with SMTP id d8mr4837771wrq.178.1544014668402; Wed, 05 Dec 2018 04:57:48 -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 s3sm12460200wmj.23.2018.12.05.04.57.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 04:57:47 -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> From: Marek Vasut Message-ID: <4b06ed22-8711-6700-056b-c66799d0e616@gmail.com> Date: Wed, 5 Dec 2018 13:35:34 +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: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/05/2018 10:11 AM, Geert Uytterhoeven wrote: > Hi Mason, > > On Wed, Dec 5, 2018 at 8:44 AM wrote: >>> "Marek Vasut" >>> 2018/12/05 上午 10:04 >>> 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 > >>>> +static u8 rpc_bits_xfer(u32 nbytes) >>>> +{ >>>> + if (nbytes > 4) >>>> + nbytes = 4; >>> >>> Use clamp() ? >>> >> >> nbytes = clamp(nbytes, 1, 4); >> >> got many warnings, something like, >> ./include/linux/kernel.h:845:29: warning: comparison of distinct pointer types lacks a cast > > You can either make the constants unsigned (1U and 4U), or > use clamp_t(u32, ...). > >>>> + rpc->smenr |= RPC_SMENR_SPIDE(rpc_bits_xfer >>>> + (op->data.nbytes)) | RPC_SMENR_SPIDB >>>> + (fls(op->data.buswidth >> 1)); >>> >>> Drop parenthesis around fls() >> >> ? >> no way. > > Please split the line before RPC_SMENR_SPIDB, and join the next line > with the parameters, so it becomes obvious the parentheses are needed > because RPC_SMENR_SPIDB() is a macro taking parameters. Oh, I didn't notice that, right. -- Best regards, Marek Vasut