From patchwork Fri Oct 28 08:33:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9401519 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 9C71B60588 for ; Fri, 28 Oct 2016 08:33:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C69128DAA for ; Fri, 28 Oct 2016 08:33:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FD862A63D; Fri, 28 Oct 2016 08:33:51 +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 0F97028DAA for ; Fri, 28 Oct 2016 08:33:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964782AbcJ1Idu (ORCPT ); Fri, 28 Oct 2016 04:33:50 -0400 Received: from mout.web.de ([212.227.15.14]:50732 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964792AbcJ1Idt (ORCPT ); Fri, 28 Oct 2016 04:33:49 -0400 Received: from [192.168.1.2] ([77.182.172.137]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0LgYRZ-1ceeDD12FJ-00nxzd; Fri, 28 Oct 2016 10:33:42 +0200 Subject: [PATCH 03/10] scripts/basic/fixdep: Use the symbol "MAP_FAILED" in print_deps() To: linux-kbuild@vger.kernel.org, Michal Marek References: <72e07814-56e9-505a-d660-91ff20b6efea@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <682bce8d-61cb-0e50-1a7e-93328e3d8c08@users.sourceforge.net> Date: Fri, 28 Oct 2016 10:33:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <72e07814-56e9-505a-d660-91ff20b6efea@users.sourceforge.net> X-Provags-ID: V03:K0:P4W+dGBCwRz8W/LKhodcQVvSbuyGuQYDKLDxIBGPniXXxCqJ7hp tye/2/u0Da0f37YIYyhLngIsLcMXQe9dPu1EXEnPNTMn3knNPAjn7zRxRWPnpMbpjyIeu6P JBUrxeQziuIPiRnjWzOSSth6hIxCTEuj+2z+7wCprmP1SuLwDK7AEhPn3mzDHvkzJidzL8f /FJn64E9WLIzmQDk+BlZg== X-UI-Out-Filterresults: notjunk:1; V01:K0:4g6/2dDrQzc=:PQnD47KmhJHrVfQSt7P3c0 JvgasgsOVYe4dHqSuSNIj/vDmrrBz93slWdwOoOuZy1/+SP1cI8HpZQnMgzmTPsJgfRVzWE/S 3gecNUzewo/uMgoBA+XRnO20aCGjY7OV6bjjecnn8HN7RstrxMYuzXfurNdVEpZpyXezEhlRx ul7CmHN2BbA0K2n9dGmH5AaGBWnOm8afKHuHJY1h7apak02PsIqsq+0qUCWpZhvc5jUTvSjhd ao9Ms4LUqXqV85PFuGdEqp00WFgBGLB7RsxnzS1AFEqDs+03fIaT+s1Vi8Ma+tnxXbR76KsXH 5hpuETMp8aIF3T8TfJdkMH902pEbemBsvbhzeiGlA4gtn78Q5lx3HU767WYKnnfU1qZ1PTrHg AbZEhCBLNmMwSMu9guen2MLVysyrpd9BEsBwqqPB/K2vZOYBTgUmFhSkUvKGdu1NfRJq83aQ0 P5LY0uachbNwnCUhXgAubZFuKQ11Bz/6RiQqH49yW4ucTVTCi6YKbCcE2lHaA86R1L4bc5kB6 7GHwGC5HSmQfhXOeTZCZjm/jckVmi3PVE9HXlDob5ZQLrdW27rkGSSf6DJp4g/sAs12vCLmu7 cm9BHcG6U1z5BNHRtlnUIWOP0BKu13ZUjC7j2TNt78FA3lT4IlMRAOGc5m4uU125yQ4IBK8Vt MK1HnfswhpVPYNsLkqU+4kmogAShCVHCuOZxxkEc/xkvtIG6UcvNhHLoMYioAz8MnabxeWo2H XZ6wTQxzSsW1DFVSYVRQD9ZOASPxs2icswfiAagxvg+g7woKk3XB47gN8JrkDPcVlQDHfQ0uN l0CPoF4 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 27 Oct 2016 18:18:54 +0200 Check the return value from a call of the function "mmap" by using the preprocessor symbol "MAP_FAILED". Signed-off-by: Markus Elfring --- scripts/basic/fixdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index c9ce3e3..0dcec29 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -417,7 +417,7 @@ static void print_deps(void) goto close_fd; } map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); - if ((long) map == -1) { + if (map == MAP_FAILED) { perror("fixdep: mmap"); goto close_fd; }