Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6763679rwd; Tue, 6 Jun 2023 01:17:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6B5NgxsyLqD9WUGBPVsTHaa+WKW+x3O4wYXH1+2ZLWFcLvFg67iRxUS/hbhZTbAQamdtcx X-Received: by 2002:a05:620a:460a:b0:75d:8e6c:6c0c with SMTP id br10-20020a05620a460a00b0075d8e6c6c0cmr1268352qkb.48.1686039468730; Tue, 06 Jun 2023 01:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686039468; cv=none; d=google.com; s=arc-20160816; b=Gxodaq11x2zaOXjTXSAwLNTNH62EilaTIkvaKC7H5UHcGOW7tBTF4fKYy3bFYnSLj5 55M/SXfFqCXMjPpn02vkRlwrhMAgGs1dWTXnbplFUhsTzSXoD3uEdy5q/flGaWAH5h2f oiXb5O9RnmVYiXvj7/2MjnvJpNRdijd+HTGuSu3UgeKITfFs9VCQq0gF/wP2jdMYOapm cAH+dIpbwuT5eRYw+6SK4+V8tRnzmx1xriP3jNmRPw1zwvB9ZNyif+pH9U1u5o1rZKyd G3e6CIgyAkZk7LgGQZMUGXIh2vUQgADq5X1dKAhSJ0gxngHwKpYXgU07aHCCbj8GmgNK rk8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=FuFtE7fWqs8GCjK/UChIKy8AptXWBdO6L9m9SFFFySc=; b=OeYm86YZvw6sS1FslU8iUr6fvDDcbPxpOwZtc74JhWHqQMKo4EYNE2cVp5pIY+TfvW 5j27LU+jAK3LnfJ1+PNkx+RC/RGwPRtZrtE76MfpgLK5kvgsDgrzOKP5FfNO8+CuAbUY 89PutkTlACzMfo92ZsCK6kwgeab7G0a3hHUNDzuTzOCmFynxAD1O7Yj9jtrUYGKBtORz QOSiuSY1qlFvP1vKPVhrqvoeTnRTIL6NFhkforpTpYuYSUU/ayt6ysGHyoO37brs4Yty xPDRMj3qXi/bd66QAy/ak8C03G1BPdgUVEQNp5DUBZkRoSIVVWnY9wWbZ2ABpu/TkKjq OSrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AfuYw65r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020ac87f84000000b003f9ac32406fsi1361356qtj.86.2023.06.06.01.17.34; Tue, 06 Jun 2023 01:17:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AfuYw65r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233748AbjFFHyM (ORCPT + 99 others); Tue, 6 Jun 2023 03:54:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbjFFHx2 (ORCPT ); Tue, 6 Jun 2023 03:53:28 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FB8910DE; Tue, 6 Jun 2023 00:49:57 -0700 (PDT) Received: from [192.168.10.48] (unknown [119.152.150.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id E9FA46602242; Tue, 6 Jun 2023 08:49:53 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686037796; bh=usPMufmDzuBOCEzo23gPEz247KJx0Gj7Q/7CWBmyGBg=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=AfuYw65rewPWEzEcE2cn1a8WpAnJngEFkPjO/j2Z2N19zqvHa5LXIyBhg+ORY3Mfr P3OXJuPYtlpS7QSs0+l6Gyw6ndruGDu2bfwLwm27JatkLAacYx1J0dQCuDvX1lE1pZ VU5Tkq4GFhoOiMAk/5/hwuAjPxEwXdIiaqF1IPEiqymjLzLlOFfYucky1MxklhJdiN b6XHGNnOEtCWkjvV9esaPWT9eldKyo2DA/YzjJhGOfrCPco5OVluLHDS7osFvNUF7q 6fQpaSynIgl6BKsMoGPPEbTxpN35wDxvXi2Vh5lM0Nnjxng9O/r3Sm4tcHR7xiW9tY ND61zjbCfQ9qw== Message-ID: <08bf8e05-3c64-1f1b-d6d7-f542a7026c6f@collabora.com> Date: Tue, 6 Jun 2023 12:49:49 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cc: Muhammad Usama Anjum , David Hildenbrand , Peter Xu , Shuah Khan , Nathan Chancellor , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, LKML Subject: Re: [PATCH v3 03/11] selftests/mm: fix "warning: expression which evaluates to zero..." in mlock2-tests.c Content-Language: en-US To: John Hubbard , Andrew Morton References: <20230606071637.267103-1-jhubbard@nvidia.com> <20230606071637.267103-4-jhubbard@nvidia.com> From: Muhammad Usama Anjum In-Reply-To: <20230606071637.267103-4-jhubbard@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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-kernel@vger.kernel.org On 6/6/23 12:16 PM, John Hubbard wrote: > The stop variable is a char*, and the code was assigning a char value to > it. This was generating a warning when compiling with clang. > > However, as both David and Peter pointed out, stop is not even used > after the problematic assignment to a char type. So just delete that > line entirely. > > Reviewed-by: David Hildenbrand > Reviewed-by: Peter Xu > Signed-off-by: John Hubbard Tested-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/mlock2-tests.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/tools/testing/selftests/mm/mlock2-tests.c b/tools/testing/selftests/mm/mlock2-tests.c > index 11b2301f3aa3..80cddc0de206 100644 > --- a/tools/testing/selftests/mm/mlock2-tests.c > +++ b/tools/testing/selftests/mm/mlock2-tests.c > @@ -50,7 +50,6 @@ static int get_vm_area(unsigned long addr, struct vm_boundaries *area) > printf("cannot parse /proc/self/maps\n"); > goto out; > } > - stop = '\0'; > > sscanf(line, "%lx", &start); > sscanf(end_addr, "%lx", &end); -- BR, Muhammad Usama Anjum