Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1007782iob; Fri, 13 May 2022 19:24:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2t0GqAsoMjQhH+xLZYi6uGsIJ9BisIolaYRJCYfq1s6Fs1Egsy1syMyJVkMKUpMw9JR3w X-Received: by 2002:a7b:cb47:0:b0:393:dd9f:e64a with SMTP id v7-20020a7bcb47000000b00393dd9fe64amr17251345wmj.170.1652495082514; Fri, 13 May 2022 19:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652495082; cv=none; d=google.com; s=arc-20160816; b=IqMiTKOLqHXw2doOzqJxBaflEiPnYyBQ2+kDm60BQqbrP9HbvraQJoTLyEd7sG19ye bpcdWmf2v9Do47+tugbe992IKnpdRRv8tOP/LXEJyW0xBdhm5xF8B2gJIuWWcdqfqztn XrYIhLLw1GsPGnu5wJCD1LdrY8r+UBYbksNXGpO9LthbuWhXl1AwLGiBHJGbN246dXN6 wj0s27iAEIpkq6dfGcFc4mYOugEeKhrvlXMaEFcRj+TIiRp8bkiBwt51Jp+vut5duXs5 CRI7sSmwR/yFfZaUxc6IaN2bebsMzMxnrLzWaQSnjmBT4fwfHZjZlncosV03+hI4K1xT RnPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=EKGhowWyRRV6nPFlDJ1JS9fAb9Qu7X6oHPKRxEN4oMU=; b=eUFa0HKEu+/mnl5WDa51fH/NgzwIUYHoYy/YonSoBCCAEUgwWmV7rrpYJOU1TGitU8 H7d5G6q2g7iCT9kddSMZ0J7aGHNZ8VbfdrcIa6RfvGaRLsE5KwCagiRaxsuJTbu4Exw0 SRWi/6YKtw2JJvq8pDk34XGjnmUOGoNn1COkiwQbqs5PRi3odzkxVnSwFn7OQwecrdHt KOm4Dm47N8+aTRDkVGLtZ2yQBlZWZbFJcoSLvC85uBX0tfYcKaWRYQyT13aT7A/8kSqj Cv8Sak6XwbsUHDlAXqBR8W49qwNT3lLG7/5fngo2yTPbwz8dGDIs7GN6+N9SGKpNT9FS Z2+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BxQKkOFI; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z16-20020a05600c221000b00393727a7920si7314520wml.102.2022.05.13.19.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:24:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BxQKkOFI; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9C0A44C7C5A; Fri, 13 May 2022 17:39:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383806AbiEMTTu (ORCPT + 99 others); Fri, 13 May 2022 15:19:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357966AbiEMTTh (ORCPT ); Fri, 13 May 2022 15:19:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A2F7A3C72A for ; Fri, 13 May 2022 12:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652469498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EKGhowWyRRV6nPFlDJ1JS9fAb9Qu7X6oHPKRxEN4oMU=; b=BxQKkOFItsd3RwDAikSAhhf9nIgzEXiOVwb4YqeDTKQycfR12OIjuogPFfdQ1SgxYd1CRH YyMml1/r1QreJ+F92YGvya/TRUYUC+C/cw+mD40Ud4nlflHvumKtPzLVT7ysHRoQ68Jt3S pongRIWJFEb1IcB/pckOdU49y82vXXM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-115-2Et5rqR9MNedV_c3n0xoVA-1; Fri, 13 May 2022 15:18:17 -0400 X-MC-Unique: 2Et5rqR9MNedV_c3n0xoVA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F56C811E76 for ; Fri, 13 May 2022 19:18:17 +0000 (UTC) Received: from nyarly.redhat.com (ovpn-116-111.gru2.redhat.com [10.97.116.111]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1BA5414DFB85; Fri, 13 May 2022 19:18:14 +0000 (UTC) From: Thiago Becker To: linux-nfs@vger.kernel.org Cc: steved@redhat.com, Thiago Becker Subject: [PATCH] nfsrahead: getopt return type is int Date: Fri, 13 May 2022 16:18:08 -0300 Message-Id: <20220513191808.2930668-1-tbecker@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org While compiling for aarch64, the compiler throws the warning below because char is unsigned for aarch64. main.c: In function ‘main’: main.c:145:48: warning: comparison is always true due to limited range of data type [-Wtype-limits] 145 | while((opt = getopt(argc, argv, "dF")) != -1) { | This makes nfsrahead to run forever. Fix opt type to the same as getopt type. Signed-off-by: Thiago Becker --- tools/nfsrahead/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/nfsrahead/main.c b/tools/nfsrahead/main.c index 5fae941c..c83c6f71 100644 --- a/tools/nfsrahead/main.c +++ b/tools/nfsrahead/main.c @@ -135,10 +135,9 @@ static int conf_get_readahead(const char *kind) { int main(int argc, char **argv) { - int ret = 0, retry; + int ret = 0, retry, opt; struct device_info device; unsigned int readahead = 128, log_level, log_stderr = 0; - char opt; log_level = D_ALL & ~D_GENERAL; -- 2.35.1