Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2515865imm; Mon, 24 Sep 2018 05:46:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV63muSg90yKWoJgESvMm/+O7PAnjiA9oNpMY75FHuZKDSpiKlpZk1Ppz1dWpXZ2TpBw/0LpE X-Received: by 2002:a17:902:7803:: with SMTP id p3-v6mr10528187pll.119.1537793217907; Mon, 24 Sep 2018 05:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537793217; cv=none; d=google.com; s=arc-20160816; b=waio0G6AeJ+uPIeVWSlCSLh9LfYY/jPHgH0u5fpzXw+Eo8nLx0E0gLyeG90ahiRxBo psNnWX0KBPzcTUm8428Jfulq42FXd7ycrHpjkow7NOcuLc2BxYxNY8k1ofRiaY5bot6T J2lO89B+nXotX69n6jr8wRjoj+oGs//VpQ4QiJb8QFN4p/0z9BS6ne8j61BdkhQnnXA5 Q2PlDO6Yd3WC4wjY/WnlqZQghVKuexGbT1cd58RUS5WPpmscgN92c/QFH0siJW8fiI5a OcmzrOJb+ITvYhzRoFMRCL/7pnVhXRQ3qlXfSkyT2MK+mfhdE0QfC4Vxjoyz2QTbIXOv +CtQ== 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; bh=/aGCJ9EO+07Jn5oiEimBiVu/e9GLH9gy7STR36MOvqY=; b=GCHcDb3cvJTNfUTdpuE2tq7aZTwl1zNeLMcGhWaUikkYN4m24oYKOgJx3bBu6tG2E5 GJzMVeW9CP2jKf3LvHPaUPAw391qmix31BFQFMqtB18oapXjZhjlAxKDlrF5NFdl+5nQ nLv3kE8hypoLNGCxk/I6xZy1H9z6WWCS2G8QwvdgYtuLe9Aez1YrRgmoPGU1GmOOk9XY Fpp67Da68Uy2q0ilaWsCjkTp05bjc3bazVIuf5meT0rH7kb2OtH8Z574gY+f0wd14Bd/ ohEYyYXkOZHasTvNdpkfuIZHkBDs627LFc0Z/TVERAYNeqdLa/aPbPds6kc9zYo0YWLe iZSA== ARC-Authentication-Results: i=1; mx.google.com; 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 m23-v6si16119133pgn.603.2018.09.24.05.46.42; Mon, 24 Sep 2018 05:46:57 -0700 (PDT) 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; 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 S2389375AbeIXSrv (ORCPT + 99 others); Mon, 24 Sep 2018 14:47:51 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59846 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730401AbeIXSru (ORCPT ); Mon, 24 Sep 2018 14:47:50 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 326C5109A; Mon, 24 Sep 2018 12:45:51 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Shuah Khan (Samsung OSG)" , Sasha Levin Subject: [PATCH 4.18 211/235] selftests: vDSO - fix to return KSFT_SKIP when test couldnt be run Date: Mon, 24 Sep 2018 13:53:17 +0200 Message-Id: <20180924113124.856557195@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Shuah Khan (Samsung OSG)" [ Upstream commit d2d49495b5c0dffee5c4da5ea12ac0da6679bd08 ] Fix to return KSFT_SKIP when test couldn't be run because AT_SYSINFO_EHDR isn't found and gettimeofday isn't defined. Signed-off-by: Shuah Khan (Samsung OSG) Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/vDSO/vdso_test.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/tools/testing/selftests/vDSO/vdso_test.c +++ b/tools/testing/selftests/vDSO/vdso_test.c @@ -15,6 +15,8 @@ #include #include +#include "../kselftest.h" + extern void *vdso_sym(const char *version, const char *name); extern void vdso_init_from_sysinfo_ehdr(uintptr_t base); extern void vdso_init_from_auxv(void *auxv); @@ -37,7 +39,7 @@ int main(int argc, char **argv) unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR); if (!sysinfo_ehdr) { printf("AT_SYSINFO_EHDR is not present!\n"); - return 0; + return KSFT_SKIP; } vdso_init_from_sysinfo_ehdr(getauxval(AT_SYSINFO_EHDR)); @@ -48,7 +50,7 @@ int main(int argc, char **argv) if (!gtod) { printf("Could not find %s\n", name); - return 1; + return KSFT_SKIP; } struct timeval tv; @@ -59,6 +61,7 @@ int main(int argc, char **argv) (long long)tv.tv_sec, (long long)tv.tv_usec); } else { printf("%s failed\n", name); + return KSFT_FAIL; } return 0;