From patchwork Sat Jul 7 23:22:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10512967 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 916AA600CA for ; Sat, 7 Jul 2018 23:22:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 829D2288E8 for ; Sat, 7 Jul 2018 23:22:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77239288ED; Sat, 7 Jul 2018 23:22:41 +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=-5.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4261C288E8 for ; Sat, 7 Jul 2018 23:22:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5CCB6E34F; Sat, 7 Jul 2018 23:22:30 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED2166E34D; Sat, 7 Jul 2018 23:22:28 +0000 (UTC) Received: by mail-qt0-x241.google.com with SMTP id z6-v6so12813654qti.2; Sat, 07 Jul 2018 16:22:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ToeGzD4J7rryrHfst6PL2kA0PoIacKur9fPPa6JJO80=; b=TpRdmhGppaoreGm4j+f6oKrLQwgd1ey6keudujq3O4IMDF7hlgDrzRlAh7KrX2YxT2 yTDqZSErMk5j/K2QhrMxmFZZCDwVt2yLnAVU08QAdDZOUfN0q/18BBOORi/z9+PT57fz o9iqe0yVhU3qBpXsLZ65Vms0q3K3kkih5rwtrqJmOl51VqtyiHLEfNINgcWzZB+iyBcp D1boQuG4Y7pW+ORKvpBRgRqMSiKsHh6djClJ7MUVwdPk5AQFWaDZyzdZki0/I397hDRE 2/EGwWxiGZfriwmafEB8ZWGxVyuetKPca3M0d62TPg4OrEttx+qPSzehIzV3KfR5xJh/ NyQw== X-Gm-Message-State: APt69E0gvDYYsAfbmeg5ZPA+NalGipJ0fDuFtmTSQ/xQg0/ghCFDG4NY ihK1e0Ta54HkFTwpk6o2DUA= X-Google-Smtp-Source: AAOMgpeTmP3+slaAjeO3AohWj4zHrrSS4uHcJPgwwT5oDbLoO0ykrXF2TJMaH4BXjsydDPfIqjwXnA== X-Received: by 2002:aed:3d2d:: with SMTP id g42-v6mr14096626qtf.195.1531005748144; Sat, 07 Jul 2018 16:22:28 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id b3-v6sm4857311qtg.20.2018.07.07.16.22.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jul 2018 16:22:27 -0700 (PDT) Date: Sat, 7 Jul 2018 20:22:25 -0300 From: Rodrigo Siqueira To: Petri Latvala , Arkadiusz Hiler Message-ID: <1fdd00077524f8c4703095a67caa3d0f920e3c05.1531005542.git.rodrigosiqueiramelo@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180622 Subject: [Intel-gfx] [PATCH i-g-t 1/7] Remove parameter aliases with another argument X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This commit fixes the following GCC warning: warning: passing argument 2 to restrict-qualified parameter aliases with argument 1 [-Wrestrict] return (readlink (buf, buf, sizeof (buf)) != -1 && This commit fixes the GCC warning by creating a second buffer only to keep the path. Signed-off-by: Rodrigo Siqueira --- lib/igt_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 3313050c..fa22f12d 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1169,10 +1169,10 @@ bool igt_can_fail(void) static bool run_under_gdb(void) { - char buf[1024]; + char pathname[1024], buf[1024]; - sprintf(buf, "/proc/%d/exe", getppid()); - return (readlink (buf, buf, sizeof (buf)) != -1 && + sprintf(pathname, "/proc/%d/exe", getppid()); + return (readlink (pathname, buf, sizeof (buf)) != -1 && strncmp(basename(buf), "gdb", 3) == 0); }