From patchwork Wed Oct 12 14:54:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9373361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6448860487 for ; Wed, 12 Oct 2016 14:57:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53DA0295A4 for ; Wed, 12 Oct 2016 14:57:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4693729B7D; Wed, 12 Oct 2016 14:57:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C5FA0295A4 for ; Wed, 12 Oct 2016 14:57:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buKvk-0004Ym-8T; Wed, 12 Oct 2016 14:54:52 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buKvj-0004Yg-4W for xen-devel@lists.xenproject.org; Wed, 12 Oct 2016 14:54:51 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id F1/21-27267-ABE4EF75; Wed, 12 Oct 2016 14:54:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDLMWRWlGSWpSXmKPExsVy5bEgl+5Ov3/ hBnP/W1t83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmrZ3ezFkzhqnh35CdTA+NDji5GLg4hgRWM Ep/f3mLuYuTkYBNQlnh9dAoriC0i4CXRNW89C0gRs8BZRolnrfOAEhwcwgLmEjdXCIHUsAioS vy+ewisl1fAROLG081sILaEgJxEw/n7zCC9EgKfGSW+TFrEBOFsY5O4duU86wRGrgWMDKsYNY pTi8pSi3SNDPSSijLTM0pyEzNzdA0NjPVyU4uLE9NTcxKTivWS83M3MQJ9Wc/AwLiDsfmE3yF GSQ4mJVHeXL6/4UJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeN18/4ULCRalpqdWpGXmAIMKJi3B waMkwrsZJM1bXJCYW5yZDpE6xagoJc5rB5IQAElklObBtcEC+RKjrJQwLyMDA4MQT0FqUW5mC ar8K0ZxDkYlYd4wkCk8mXklcNNfAS1mAlpsM+kPyOKSRISUVANj4sIpD+fufbomxv3/klAL1U UMRzfNzNC58/bKQeH8N7LHTyntc+oPt5Z9ndY3IfXuyX5zMfeJcZP2+6ZvXXnwiUjvUkHD2xx STBcubvT6lehQ83579YevT76/qWn4+tHdvvKO7wbLpcttGdknywRejm4TK9o4R2mmzXrt72ar NeXnLXextFnUqcRSnJFoqMVcVJwIAA7osyxfAgAA X-Env-Sender: arnd@arndb.de X-Msg-Ref: server-3.tower-31.messagelabs.com!1476284089!65776369!1 X-Originating-IP: [212.227.17.10] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: QmFkIElQOiAyMTIuMjI3LjE3LjEwID0+IDY3OTMx\n,sa_preprocessor: QmFkIElQOiAyMTIuMjI3LjE3LjEwID0+IDY3OTMx\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 47930 invoked from network); 12 Oct 2016 14:54:49 -0000 Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.17.10) by server-3.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 12 Oct 2016 14:54:49 -0000 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0MUo3w-1bMD0V2WXE-00Y9iE; Wed, 12 Oct 2016 16:54:39 +0200 From: Arnd Bergmann To: Wei Liu , Paul Durrant Date: Wed, 12 Oct 2016 16:54:01 +0200 Message-Id: <20161012145434.2493788-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:66dq2BVsVyV/PcypvWTatmhpWjXji8BsZZz+fvrsccdmXG8du36 pnXz2Xvz6eHy6zy1h3++y09IYceYYBO9rcfwa5I7epHtBMA0SMsZrf3YFl4+gqdZZHCV1E+ e7WXmcLgebZhjNr4UrtopadNTObYDWwwo2UAtaNN4KYmw7hTmqefU3XoaaGpvBN1fHAZtyY xzrSuw+MwB/x62JKHdSnQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:HTh5GlKYmm8=:XncnvlHIK+AQY5mFl41/k5 53KLilZWFovUzEZ0rIAE5SI41NyaDTL577peBuITN35B6QGnECVq2LYqulGgAz5YHrfwkpf5S pG1oZbDMfVuONINy8Qrb2gt6pVvssVZYEZghSnnV+Y387gGVkyfTySZgYAAXDqVIjCqHMO7NU vbUXocEtskZJpWzeqQ6hSx2khC7Rw5yhBwj3hHFcaV2TI8p/vCHJ2yhEidhzL8+HPo2nJ+S8n 0236f0ZKIGWV68hrtl4bbOoofXzygicAkIWzF2lZGJmCYeB3RU26yfovQE2DP0Xg+zKd/KaBh LXzx79G6wnB7lQ/VhglHIhY/ArX8JLRwLeDnEJijo4WRe4YwGf8VjaxFMIMEGsaftPi+7XwX+ C9rUSF37xofD8yvsX9rz5Pz47Y9JO0Y7PsUC3YvQhu27P4ulGz+RWghVpLkgLjSYjqyKnQEZi 6dcppHsfVM+ga2OMAnLmZ7Ag818ocib7wK8RQIOIIYIW9zjAm7P9+aeO0XPWWoyOpMD+aKxLX //vzV2jrRf2KcOFUCpUNy3RSQbZ4w3NbgSiVsx2ZRI7gcsT1ah/pWzSXXkFPxbjTckWIhAdbV w0Kjwf7zUlnubgClorAadK/lqvrC4RIqlvLOWgH1P0H7fwlSp9+R/1U4Y0oUESuzsQuGIu/YH 9lDVfviESJOh7CPBJ4n+8eGWf/VDMKGuKw7BhQnUKtnxeyq2VW2GpvStfveofAfrt3OA= Cc: Arnd Bergmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, David Vrabel , xen-devel@lists.xenproject.org, "David S. Miller" Subject: [Xen-devel] [PATCH] xen-netback: fix type mismatch warning X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Wiht the latest rework of the xen-netback driver, we get a warning on ARM about the types passed into min(): drivers/net/xen-netback/rx.c: In function 'xenvif_rx_next_chunk': include/linux/kernel.h:739:16: error: comparison of distinct pointer types lacks a cast [-Werror] The reason is that XEN_PAGE_SIZE is not size_t here. There is no actual bug, and we can easily avoid the warning using the min_t() macro instead of min(). Fixes: eb1723a29b9a ("xen-netback: refactor guest rx") Signed-off-by: Arnd Bergmann Acked-by: Paul Durrant --- drivers/net/xen-netback/rx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c index 8e9ade6ccf18..aeb150258c6c 100644 --- a/drivers/net/xen-netback/rx.c +++ b/drivers/net/xen-netback/rx.c @@ -337,9 +337,9 @@ static void xenvif_rx_next_chunk(struct xenvif_queue *queue, frag_data += pkt->frag_offset; frag_len -= pkt->frag_offset; - chunk_len = min(frag_len, XEN_PAGE_SIZE - offset); - chunk_len = min(chunk_len, - XEN_PAGE_SIZE - xen_offset_in_page(frag_data)); + chunk_len = min_t(size_t, frag_len, XEN_PAGE_SIZE - offset); + chunk_len = min_t(size_t, chunk_len, XEN_PAGE_SIZE - + xen_offset_in_page(frag_data)); pkt->frag_offset += chunk_len;