Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9241640imu; Wed, 5 Dec 2018 01:12:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/VGkTgBlt4MxYWw5HRAGp5VPnNXX3i1mGQ8Xue8/wymQUdqN8w9RQX32OD62YRG8rih+ce/ X-Received: by 2002:a63:7556:: with SMTP id f22mr18173421pgn.231.1544001157188; Wed, 05 Dec 2018 01:12:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544001157; cv=none; d=google.com; s=arc-20160816; b=KZgCOdQPUOXZwLDf2LHVmz75zqbU2CSnkM/JYs8pMKBKqkOUC8RrEhsdvzEooHSzTa jfzs1Rzp/0eEH2BqZ1MGiBhqWd9lQ+L800r+MGlDpjHL4nw6qN777O+GPkpwyNMS7n2k c+tDlbIqs5hpW5rlaTcQaOPICkozLKLX4mzQbQSN//YknOfX6aPKFhEP9wmvFirsErgW AYYGpGBK9bivTP+5TbSD69E4WwvjEVMPYvclQNFnOgguwp7mxK8gUF2ZzF6F3NQdyqnm Wihop+g50yxSeRAE4chQuTQLSs8MlqsFe5oXIqZg7MxCJ78PsDzksitOu7WJmrSfhXp1 GAJA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=isw+3Q9IfePuo/2hDeK+hqfz1bCk8/l2K8YoJdi+o6w=; b=cWAeTbR2UMrj9eR0iHBv+HaHZ844E3H5Rc6tgJXG7Z0a44yCvcVKp5H8F1tnlzxBIp hoJxCPNhs7S7XNFsktAsHxF73a42C83NcjXfb7prLe421D5LWP7gQ2qqoR2EDXNnOqKF Jf35y3tAd6FIlWTQL+inVdaUKgU+UOr/zrdqTokD1tj2E0wujRci0LNSws4I2CiuIxVc /AhiUUt8/egRVg68i/zI60El6ipIigAPFA101jTrsFZ0+35rKhhbFDAw4V+MafDQWQD8 AN8EW/Za6L9fin4tOJY1IJ8GqLHZYoqheel+5QLr2T+2Ljl1g2ZHp5Q9s/HZLQF1v9OR +qaA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si21359145plb.103.2018.12.05.01.12.21; Wed, 05 Dec 2018 01:12:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727182AbeLEJLr convert rfc822-to-8bit (ORCPT + 99 others); Wed, 5 Dec 2018 04:11:47 -0500 Received: from mail-vs1-f68.google.com ([209.85.217.68]:44353 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbeLEJLr (ORCPT ); Wed, 5 Dec 2018 04:11:47 -0500 Received: by mail-vs1-f68.google.com with SMTP id g68so11614072vsd.11; Wed, 05 Dec 2018 01:11:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=BGg1+77tU3sD+fgVGBgdcnlBqoPPDehgShNpz79U790=; b=QsrLffzkM8hI1Erbw9oINWZUCnOWqVS5+DnZKYmfglpP3CP1fbicO99qEVfIgafBEd mTjRs+U3gba/uSA/eL4mxfVgapRV/KBQ+Gj8XLGZ6e9/KlAmKAqB8vZg5KYJ/pDutAWd g12F56FX2TSh+YQI+lYUQIvl/RbOm5MYFc9q9EB9drxy/SB2it1PHfh/En8kuTf6ARd9 kIOHYi9ExzCUFlYa+j1Qb+pJIoB2W3AySkITBQorc5YUqUWnG6o1E0ZVDNpiOzYrszd0 pa2lMBtlIpG9tbi5pDnwit/m+5WOWx1SBZC8eqUS3Oq6EURhKRS1d31U64RfXVew7nE5 qc8g== X-Gm-Message-State: AA+aEWYbxPxjupb9eW5DvXk+X+A2DcdhEukvi+7gIXLyeu2lFflgso+1 y3PNbm/sEhCdKGZ9lyhOv6rXPehS/apakdjNdvU= X-Received: by 2002:a67:d119:: with SMTP id u25mr9575026vsi.63.1544001106166; Wed, 05 Dec 2018 01:11:46 -0800 (PST) MIME-Version: 1.0 References: <1543828720-18345-1-git-send-email-masonccyang@mxic.com.tw> <1543828720-18345-2-git-send-email-masonccyang@mxic.com.tw> In-Reply-To: From: Geert Uytterhoeven Date: Wed, 5 Dec 2018 10:11:34 +0100 Message-ID: Subject: Re: [PATCH v2 1/2] spi: Add Renesas R-Car Gen3 RPC SPI controller driver To: masonccyang@mxic.com.tw Cc: Marek Vasut , Boris Brezillon , Mark Brown , Geert Uytterhoeven , Simon Horman , juliensu@mxic.com.tw, Linux Kernel Mailing List , Linux-Renesas , linux-spi , zhengxunli@mxic.com.tw Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds