From patchwork Tue Apr 25 05:49:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 9697539 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 326CC601D3 for ; Tue, 25 Apr 2017 05:50:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 163642844E for ; Tue, 25 Apr 2017 05:50:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09E08284EA; Tue, 25 Apr 2017 05:50:19 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA38C2846C for ; Tue, 25 Apr 2017 05:50:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S980368AbdDYFuR (ORCPT ); Tue, 25 Apr 2017 01:50:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59504 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S980365AbdDYFuQ (ORCPT ); Tue, 25 Apr 2017 01:50:16 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C870BF1283 for ; Tue, 25 Apr 2017 05:50:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C870BF1283 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=honli@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C870BF1283 Received: from dhcp-13-42.nay.redhat.com (unknown [10.66.128.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9E4817179; Tue, 25 Apr 2017 05:50:14 +0000 (UTC) From: Honggang LI To: linux-rdma@vger.kernel.org Cc: Honggang Li Subject: [rdma-core/rdma-ndd] Use integer as getopt_long returns integer Date: Tue, 25 Apr 2017 13:49:52 +0800 Message-Id: <1493099392-1883-1-git-send-email-honli@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 25 Apr 2017 05:50:15 +0000 (UTC) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Honggang Li ARM chars are unsigned by default. getopt_long return 255 instead -1. That will cause an endless loop for aarch64 platform. Signed-off-by: Honggang Li Reviewed-by: Jason Gunthorpe Acked-by: Jonathan Toppins --- rdma-ndd/rdma-ndd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdma-ndd/rdma-ndd.c b/rdma-ndd/rdma-ndd.c index 1579a02..e7be22b 100644 --- a/rdma-ndd/rdma-ndd.c +++ b/rdma-ndd/rdma-ndd.c @@ -297,7 +297,7 @@ int main(int argc, char *argv[]) { } }; - char c = getopt_long(argc, argv, "fh", long_opts, &opt_idx); + int c = getopt_long(argc, argv, "fh", long_opts, &opt_idx); if (c == -1) break;