Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp812361ybl; Fri, 24 Jan 2020 09:59:35 -0800 (PST) X-Google-Smtp-Source: APXvYqwysnlp5bG4raxLeEGVX1mFLgh7rCgVGDg5DoOZEeM5GcLpVFKg/fX6NVWqVwH1rEjURHNL X-Received: by 2002:a9d:6251:: with SMTP id i17mr3741647otk.14.1579888775666; Fri, 24 Jan 2020 09:59:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579888775; cv=none; d=google.com; s=arc-20160816; b=RcuFYzWe9TOE5qiVSOLKRJVbZCg9dkNSVeNVnyKpbbDceMKy66HmfnHtcV1Cga5Owf jKMJ1Zg+e9P0K2VDqvHkjVfVfEYObA2gY/KzNniR7kp+1f343pTZzmDHalkcRNp5R8kn iV88b0NfFrklTp3nxhKLXxnOB7JO9HYi/JrHS/zkhLFiHDkJ2UxNolWTDW57IPm7anhj Q0HdENZF2Ix1Sd8OpyF6wKu/Kol9P8hy25G9o5gtBmQo7Vy+3ZmsRp9rsElbRsgkogEJ 9ScfgPIiG0SMCNjrZcGdLm9dicvaXCNdiF0mLtmBBYxbqI6o6xn0+oM9dIUfNKoMntEk VUXg== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M5k31YNmM/tGCyhtCZIn1V5cOqR429IWX0MSqbx+eZk=; b=rwui4xwOSID7nELRNcUVOjl1V3sg7wbAvz+7s8LTiRvR7bDeZegIdaU5vLZ2Yg6Pf/ NLEmZytzY0elr3vkFIPrd0fKEh16/ZKLzG31DZTfWfstKJY/9xQxbAkb/cAPANM2rHil bejmI3p6OllWf0bva/JTkJUg7NSSyxBGRC7IZEt+LRqOeOPuM52s/bi+haJdJlGHqXqz bUISZIG7klcCud4Ep0qfpiGKnoR0XW9xm/7Q+hCzeD9u9LcJteqDjCcPmjw1RC7GaVck mL/Th/qFg6XGKARE6FLtBtsGqN0oAJlzbl2Qv1DY6KsgBVB7ZBNdo2lILI6WKZgWMqzc XLpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pdgWyYEB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18si2994632otr.265.2020.01.24.09.59.20; Fri, 24 Jan 2020 09:59:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pdgWyYEB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390556AbgAXLRt (ORCPT + 99 others); Fri, 24 Jan 2020 06:17:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:54740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390540AbgAXLRn (ORCPT ); Fri, 24 Jan 2020 06:17:43 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4D5C820708; Fri, 24 Jan 2020 11:17:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864663; bh=V2ObQklqtp/hzvya5V7dIGtcFzFghzczuY3iesGWcG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pdgWyYEBhDESH3DMN/EcnX2yu7a1fxFLbneNz9RV7oHwfo8rxm3BArmEVRTQ4ko8y fHGqZz+2LvU2H1uLyPCLT3xAinBR7041ueGJgNG8rpg2iePVad9Wa8XW0sixEPlxvD Hz1xMOmv7aCvKIhf1PLGGWKFtBYqosNUQuLKD5c4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Shuah Khan , Sasha Levin Subject: [PATCH 4.19 317/639] selftests/ipc: Fix msgque compiler warnings Date: Fri, 24 Jan 2020 10:28:07 +0100 Message-Id: <20200124093126.737890373@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kees Cook [ Upstream commit a147faa96f832f76e772b1e448e94ea84c774081 ] This fixes the various compiler warnings when building the msgque selftest. The primary change is using sys/msg.h instead of linux/msg.h directly to gain the API declarations. Fixes: 3a665531a3b7 ("selftests: IPC message queue copy feature test") Signed-off-by: Kees Cook Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/ipc/msgque.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c index dac927e823363..4c156aeab6b80 100644 --- a/tools/testing/selftests/ipc/msgque.c +++ b/tools/testing/selftests/ipc/msgque.c @@ -1,9 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 +#define _GNU_SOURCE #include #include #include #include -#include +#include #include #include "../kselftest.h" @@ -73,7 +74,7 @@ int restore_queue(struct msgque_data *msgque) return 0; destroy: - if (msgctl(id, IPC_RMID, 0)) + if (msgctl(id, IPC_RMID, NULL)) printf("Failed to destroy queue: %d\n", -errno); return ret; } @@ -120,7 +121,7 @@ int check_and_destroy_queue(struct msgque_data *msgque) ret = 0; err: - if (msgctl(msgque->msq_id, IPC_RMID, 0)) { + if (msgctl(msgque->msq_id, IPC_RMID, NULL)) { printf("Failed to destroy queue: %d\n", -errno); return -errno; } @@ -129,7 +130,7 @@ err: int dump_queue(struct msgque_data *msgque) { - struct msqid64_ds ds; + struct msqid_ds ds; int kern_id; int i, ret; @@ -245,7 +246,7 @@ int main(int argc, char **argv) return ksft_exit_pass(); err_destroy: - if (msgctl(msgque.msq_id, IPC_RMID, 0)) { + if (msgctl(msgque.msq_id, IPC_RMID, NULL)) { printf("Failed to destroy queue: %d\n", -errno); return ksft_exit_fail(); } -- 2.20.1