Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1813116pxa; Thu, 6 Aug 2020 17:07:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2h+nQggBk3+f9MSfRZBWTAANfuw26rMVzTEClNp//5Tp84IbpArWeornpG0HzkWKvUULv X-Received: by 2002:a17:906:3e4f:: with SMTP id t15mr7250144eji.368.1596758825831; Thu, 06 Aug 2020 17:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596758825; cv=none; d=google.com; s=arc-20160816; b=x15TtXF1PWkK+8gC75QWy6hICX76e009XqDgbzMRbW9I13QaJjDUTdxBRIgWfKJmcW SzTj185f81rQVJixoQRaDd8GJPd7Rf50CI6RkaRBW+NIB10PiqiB+eNHIG6fp+0lrRLO fr59cOyZhnxz8uAS+cB55U1oOVSkwvb7ISKTYN1P3+27vF89LNF2DI5oZMVIaL0e3QwE 2/dwTu5RGHdB/PLEEA/jveJa57Wth3eHJ1cwZpHRMqC6uOhVCDa6AK6QCeJl4HUmW16a fSnjI/4i9pxDvAf7mzXRsOtFitw/AiaUWa6U+kvybjzwpMNqNo0IEs9gPt3pxTHm/35o tjEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8MCFUFZgGwGAZQzC9WBuVuzz9UQTE9/5HZUMhynMshw=; b=QKj/8Le00mN8Ez8QtQ3eQL+O/ufn4R0lHM6tKyytHoV0dBLygXUtVG7RAlIv5vEIO6 QmE975XRcLrFkipHD/6m00RyI4bnuVyfgcIohp1Y3LaWPI42QyxXQ5JJ5OgGsgqjmJWp Vkqe+VzirRrrBRdnODhE4ygZ8EAhNL0HmIjbtK6/ufDWwd2mfw7t/xv6vbRINU0wRDu1 rhU5lMfDq6cm8JwybuHkaLf3gpC92QF/KvOisEj8vhRFecYB9M0eHVkmAbWyrUdxXZ/a P0rirGQK7kRkjid7Ow0qciVTrIk+0P28ocnandD5QEmGhxEm6s+zDqwhcEqf3EXaQbia Pd8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="uYx/IsSB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oq24si4135490ejb.639.2020.08.06.17.06.41; Thu, 06 Aug 2020 17:07:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="uYx/IsSB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726104AbgHGAGE (ORCPT + 99 others); Thu, 6 Aug 2020 20:06:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbgHGAGE (ORCPT ); Thu, 6 Aug 2020 20:06:04 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E2FBC061574; Thu, 6 Aug 2020 17:06:03 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id 185so265122ljj.7; Thu, 06 Aug 2020 17:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=8MCFUFZgGwGAZQzC9WBuVuzz9UQTE9/5HZUMhynMshw=; b=uYx/IsSBrVkQXQ93EekBgXtiEr46FePoCQutYbVpPluHFg6qvgSpye+blLRp7/UQU8 PDGXV8MLOVO9SaRU1ikfejlDZjvBAJZBk+5mLd2wWsU9GD3HWsE6j6DPSM3lnmdwELaB XJ1dJqR5vwjDJwefYUBVDdunFkeuwyyWdRgqZnYyn5MRSADRNzTXfj5wQxumHjKcDiN5 WQTCxyE0zfL/zejQn0XWQ2tJAuXwnz66OMtFpmjr5A99+zONzbJtQv/hB1H9DXE8yyYT PU1DzLgmT1zxxkdGGloyuFPkbW98d2gzgr6ZxM7Q52RFJVMn2hd3euxxDGajlZ2BYO3B RxeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=8MCFUFZgGwGAZQzC9WBuVuzz9UQTE9/5HZUMhynMshw=; b=L+x+TflFqkKbNNK9gWwbXXWnxX9FbP9meik9Bhj7kc0FrmMieIj6VoIn+5xFPCLTsE 2M/c7uPpHeMrC20wFrhjgoKbFA38q2EQJPqiKj0iCHbGMpD+mVeNP/Reotx9bBwl5y18 c3lRn2NrVKhp0vkABKWYkEFjgSdz65V1vXYRu83MuzJ77yuJKLx+r0rFHVau+IyX30DJ AtvPI/4Y2zc4yh0CWZHPADZ3bBTOZE84ebplTsa4LAO75q3a0CzrDddchHfI7ZNnFyly K1iGTgHEYI+v7BNS5Npn7WVP927EpKzgEzmb4jTtcxy4YGvrV2GJDar4LCjotOtK9Bsh sAPw== X-Gm-Message-State: AOAM5322qNQWeu7zXwaTgFoPBfTzgMz4ek3LCMbqxMSAk5GavaoK1XTg 3kRZtuLITiaBXOl70E4nfu0qY8nKnOscgHH7weA= X-Received: by 2002:a2e:a17b:: with SMTP id u27mr5070801ljl.2.1596758762004; Thu, 06 Aug 2020 17:06:02 -0700 (PDT) MIME-Version: 1.0 References: <20200731061600.18344-1-Jianlin.Lv@arm.com> <20200806104224.95306-1-Jianlin.Lv@arm.com> In-Reply-To: <20200806104224.95306-1-Jianlin.Lv@arm.com> From: Alexei Starovoitov Date: Thu, 6 Aug 2020 17:05:50 -0700 Message-ID: Subject: Re: [PATCH bpf-next v2] bpf: fix compilation warning of selftests To: Jianlin Lv Cc: bpf , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Yonghong Song , Song.Zhu@arm.com, LKML , Network Development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 6, 2020 at 3:46 AM Jianlin Lv wrote: > > Clang compiler version: 12.0.0 > The following warning appears during the selftests/bpf compilation: > > prog_tests/send_signal.c:51:3: warning: ignoring return value of =E2=80= =98write=E2=80=99, > declared with attribute warn_unused_result [-Wunused-result] > 51 | write(pipe_c2p[1], buf, 1); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > prog_tests/send_signal.c:54:3: warning: ignoring return value of =E2=80= =98read=E2=80=99, > declared with attribute warn_unused_result [-Wunused-result] > 54 | read(pipe_p2c[0], buf, 1); > | ^~~~~~~~~~~~~~~~~~~~~~~~~ > ...... > > prog_tests/stacktrace_build_id_nmi.c:13:2: warning: ignoring return value > of =E2=80=98fscanf=E2=80=99,declared with attribute warn_unused_result [-= Wunused-resul] > 13 | fscanf(f, "%llu", &sample_freq); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > test_tcpnotify_user.c:133:2: warning:ignoring return value of =E2=80=98sy= stem=E2=80=99, > declared with attribute warn_unused_result [-Wunused-result] > 133 | system(test_script); > | ^~~~~~~~~~~~~~~~~~~ > test_tcpnotify_user.c:138:2: warning:ignoring return value of =E2=80=98sy= stem=E2=80=99, > declared with attribute warn_unused_result [-Wunused-result] > 138 | system(test_script); > | ^~~~~~~~~~~~~~~~~~~ > test_tcpnotify_user.c:143:2: warning:ignoring return value of =E2=80=98sy= stem=E2=80=99, > declared with attribute warn_unused_result [-Wunused-result] > 143 | system(test_script); > | ^~~~~~~~~~~~~~~~~~~ > > Add code that fix compilation warning about ignoring return value and > handles any errors; Check return value of library`s API make the code > more secure. > > Signed-off-by: Jianlin Lv > --- > v2: > - replease CHECK_FAIL by CHECK > - fix test_tcpnotify_user failed issue Applied. Thanks