From patchwork Wed Feb 17 17:42:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 8341751 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A90DA9F399 for ; Wed, 17 Feb 2016 17:42:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C78D220375 for ; Wed, 17 Feb 2016 17:42:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2C5E202F2 for ; Wed, 17 Feb 2016 17:42:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965298AbcBQRmq (ORCPT ); Wed, 17 Feb 2016 12:42:46 -0500 Received: from mail-by2on0094.outbound.protection.outlook.com ([207.46.100.94]:57129 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965077AbcBQRmp (ORCPT ); Wed, 17 Feb 2016 12:42:45 -0500 Received: from BN3PR0301CA0036.namprd03.prod.outlook.com (10.160.180.174) by BN3PR03MB1493.namprd03.prod.outlook.com (10.163.35.144) with Microsoft SMTP Server (TLS) id 15.1.409.15; Wed, 17 Feb 2016 17:42:43 +0000 Received: from BN1BFFO11FD002.protection.gbl (2a01:111:f400:7c10::1:103) by BN3PR0301CA0036.outlook.office365.com (2a01:111:e400:4000::46) with Microsoft SMTP Server (TLS) id 15.1.409.15 via Frontend Transport; Wed, 17 Feb 2016 17:42:44 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD002.mail.protection.outlook.com (10.58.144.65) with Microsoft SMTP Server (TLS) id 15.1.415.6 via Frontend Transport; Wed, 17 Feb 2016 17:42:43 +0000 Received: from fabio-Latitude-E6410.am.freescale.net (fabio-Latitude-E6410.am.freescale.net [10.29.244.206]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u1HHgdZk022870; Wed, 17 Feb 2016 10:42:41 -0700 From: Fabio Estevam To: CC: , , Fabio Estevam Subject: [PATCH v2 2/2] spi: core: Use min_t(size_t,..) Date: Wed, 17 Feb 2016 15:42:28 -0200 Message-ID: <1455730948-24938-2-git-send-email-fabio.estevam@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455730948-24938-1-git-send-email-fabio.estevam@nxp.com> References: <1455730948-24938-1-git-send-email-fabio.estevam@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131002045639118396; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD002; 1:83T6DzlkC26i1eHrDBMKXyyG7ddYcy6NTNIQv9OrlGYyWgNn69YPI4KRo8Kr7fPj/9l4Ncz91gwkND6FLz0Z1hefdo4NZY1l2LBJwhRDgvq2zHhCCMCUw3FqvzF+IyZg+LwkorIMSlWuFXVLTPRbfTHGy/nyMwSiNoBK4Cg28tXTZhs6MXqL1LpR6CSqNwTVeZgh4xPeKbO0Bxx7I+qD+BOd0Zjs0swMcecyeE3toPtplMcoMvDbR+pgCSWWHWU+hqifbjHEpUQxcynt1jVwRsHirxVZFxQEOOJ08WKL6EuGHY0SQyWvYUg+nhwViGMjEWw6xp5hECV0tHfhQ1GNe3P5bTUHv+pj+IJWk7Ym8lPOLkNLJ8hO3kop98/ykTN4cfy1jFFyDq9HXqrv8YFGxS784c8fK95ElG2JJtui40d4jvt89dPPgY5FjV06TC7lT7v2ivwmzZDq3eZDQcOMhfm6uzLK/z066KuOSLVvqDDiPI0xjeCaeN1IcY7kaCLmtUo3Mx6VfjxhCtqSv25CxjePLJYnwRrkLTGKLmIwzaJ3ATSKLzcDvMVhk5EFry3pRD507kWEcBYRmOlTE1/S3g== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(36756003)(48376002)(50986999)(2906002)(5003940100001)(4326007)(5008740100001)(104016004)(85426001)(106466001)(6806005)(76176999)(105606002)(50226001)(33646002)(77096005)(1096002)(47776003)(2351001)(2950100001)(19580405001)(229853001)(1220700001)(19580395003)(110136002)(87936001)(92566002)(5001960100002)(86362001)(586003)(189998001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB1493; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: aa4292a0-b203-4254-ecdb-08d337c1bd9f X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1493; 2:6vnbkc+KmiVhwDsgWgCHNfSKX0GZfg/277OMXvmUrfZG+Q1RQglrYpMvNVxdpMbyNVXEWzYqBYWtPyroG//eW9dt1A9BIasWCAvxFE01Fs0VtjAfTFVWoHKEM89DZi8yK+u5E2MvWEJmRt9bcYlf/n8XMpIEoBYF/ywFWGhAJK7uUSv41i5SLdGyj+m+GIOS; 3:KhtB2Sop24V32s4+5lj3nYuP6Z9wzQGpa57X3gCMVIsXwpe2sLSJ8DZelnudISD5HglgAaCf9etU9Hxk+Yx7zIIKRiRXMUGeHLR7gUKPLC6YaFYbY65iuE+omRry6lKu+B5ORgdgRzMSyyV3TP3MTNJBMY0JTL88fY9HuOGzIetkjOXTW3jUQjwQiLy/tzmKerWCms1gPTJYfTBdMQ7TIrHkrKjVIIgQbDxmYbpDPj8=; 25:AntQOW9pU4471B0lpGpsAUlGXoGX4DSLgOmZIUG3Vj5YPLOuwLOXuk02nIo6eX+DmTAa3sN0Oz3Qcb7ponmyA6bSRxsymeK8Llufe0N4xzxUyUvBD2xxHg4qSMj/SzHjto4VmmjrulqRgkNB6JIvYlnVInpV5N/2l32e7jdq0JtjXNt6X26UJcXRrnjj8yBtUsJLAq0OZaq8k1UZTtBGbKTKySutgTmcAAN1lsrZqUcaKIbRJ5XaAE9YH8WEydz6fFnpic0HyrRNwH5UmBtGfDbzZu5yd/J9CxWBsB/ia1HC336pWyh/hl6BGh7At/BP X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1493; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13024025)(13015025)(5005006)(13018025)(13017025)(13023025)(3002001)(10201501046); SRVR:BN3PR03MB1493; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR03MB1493; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1493; 4:5pHwB/K86rZboYke0fCzvUu1Pr/xSTJ3lEmmeztpZLTnpsZYQiDDFhYROMVVdLM3nNJQl3ITl62kQhx3bHmmjVvXiXcPFXCh9VjcO7J8+CVwLH17bv3nhhdDu00QCr4SaJBszkTb8RKzc30OI2+3DfRz2GjiCP4wLByU6zpYqw12Fij+i9209mG8WIQjFJrcR2CaOVaPmo48VRGN4xCTwCR25Jtt1PTHz5JNopmaxoujzOqWwXXPXeHxvHAZNcwsVUNLoulsICAqCQoNMNMp9GUK8Qbho2M6dM1iO6Jnd6xETn1mSuzp/CnkW5UZB3ZWPzkwlyYJCuqAFBbBpetMKMR9yOA9MDjIL6G+znFrcgLI2x9/r6Y8RJoQq30tNLqVPHSbiVAOBvmfHaPFq1b+fkxoQIIrxobEKA1HFEA/c3qiaXWlnKhTjV7Ilox4mAKegr23DU2T4TlM63UU1JklmJQhaNr76PwcEaIKWoYOZRKv3k6L27x4LAujeyst/HMi X-Forefront-PRVS: 085551F5A8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB1493; 23:aZVuTqZHwHY9dBPAzuflaygeUW6Vy10YaFBYjANks?= =?us-ascii?Q?qBEb65VquTYYW2NnOqDQkOW2b5j5bAqMMT+VBT9jpEUr5eM3jGFzJnvtsYPc?= =?us-ascii?Q?4cG7lFsLuTVgBB9NBnTrSAEWaF58cYofLCX2GC7Cjli8g2k3o3UWq4yTRm3z?= =?us-ascii?Q?g0FU8JCGY8Dyd+G107AYzXWSW2qeO0AYf+JWMpUtOX+P2y5IytyjpTFu/DJH?= =?us-ascii?Q?z8H0Gl7Bv62Z4dBWyh6Jf1z/1x4N8ykxktpnXYb7s1Vt1P/YpQG4PZaOKiSv?= =?us-ascii?Q?4wiIyRZCpvGpLo05eJmcchat+sMwjbU0JfZc7zsamzpIhai/eKabmzrPJhLN?= =?us-ascii?Q?09ShkSxBFsirc72MwjoUvgQrQx1u7becdLn8iSOy5+pGfUXP5ORbROMNY89+?= =?us-ascii?Q?KXAeIUc0jYNNgbrw0bfz8u4NMRZ/AL+Aj/HpxmvqSsrc1g6zYBj/eQ4Tfq3S?= =?us-ascii?Q?5weN3NVq7dNQISc+mxzGWdtZYNhHxApNsUaTQRik2//hOArcbCeBFv58chmv?= =?us-ascii?Q?ZW+uHTcEAO+n/T7UnO3is9oa6p6u3kApTXpoc41ubpWCeqOmDVitYU5l+p1U?= =?us-ascii?Q?DzBgv7yJQPThYDTNbOhBA3nAYHF4dkibUrJ94TLWvyc39YAjPsmC81e2pBRP?= =?us-ascii?Q?ts2jyH86UXLhSOsCZazZjG1tGFd0AF6/dEIDTwg0jAEy6VOKTbUZJITn43tR?= =?us-ascii?Q?oFxsgmetB8bqKXJGKrPAbg7yTeHZZncx996BxVk+mDFR9hzUpisoCe7TrGDi?= =?us-ascii?Q?98rbZ1tRVHyU7d1eneM+FyDz6HzuWFmZJHMjOXAxgIEnnfrRUBQsZa3w9ecd?= =?us-ascii?Q?ip1PWxjx2T5nicyMz540HiJziyxg2zeqpmEpHvdQe33qr5azLDgRiQVqWIvn?= =?us-ascii?Q?/omkp7bb65hL8CPiRxvbHA4eE4P2Tq7E8jXCweAW6foiOoP8t1dSqQCZOTn1?= =?us-ascii?Q?H0Vix1G7Wpf6CGyiCAC2NuGJvaW8sBnWlIKPuUifUDO5lOYnVys7Lf37Hu19?= =?us-ascii?Q?BW+ligTCAA9HuKWBi77U8Zz+yquUG5nPjb0lOhDhTNrKw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1493; 5:VjMWSUo9czsBz3kn+czLXprslD/232uBF2m0SrXONhcKElSxccuz744++wRkfiOA3t+PE9mDkjC1i4lWYFifzCBduYCf0+exujb4TT5dsq6RQNcuHIBDB8bX9XbpiiRESYD/qHFDbPbcbcdw9rVCmEu178beOKDQASFnNJWhtq4=; 24:Y7JznHRxs4HPWisaA6NUp3udt7cYjhG/upC0NWg9085OAwO0mYqeiq4QrO9+wnLgjdkbudMtS49u6h9mLZ6IupGeTZiudtteFXbQuJo6Mrg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2016 17:42:43.6622 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1493 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use min_t(size_t,..) in order to avoid the following build warning on ARM64: include/linux/kernel.h:754:17: warning: comparison of distinct pointer types lacks a cast (void) (&_min1 == &_min2); \ ^ drivers/spi/spi.c:2304:17: note: in expansion of macro 'min' xfers[0].len = min(maxsize, xfer[0].len); Suggested-by: Geert Uytterhoeven Signed-off-by: Fabio Estevam Acked-by: Martin Sperl -- --- Changes since v1: - Use min_t(size_t (Geert). drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 0725ffa..4f42f09 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2301,7 +2301,7 @@ static int __spi_split_transfer_maxsize(struct spi_master *master, /* the first transfer just needs the length modified, so we * run it outside the loop */ - xfers[0].len = min(maxsize, xfer[0].len); + xfers[0].len = min_t(size_t, maxsize, xfer[0].len); /* all the others need rx_buf/tx_buf also set */ for (i = 1, offset = maxsize; i < count; offset += maxsize, i++) {