From patchwork Mon Oct 24 16:49:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 618529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E0AAECAAA1 for ; Mon, 24 Oct 2022 18:43:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230446AbiJXSnj (ORCPT ); Mon, 24 Oct 2022 14:43:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230025AbiJXSnZ (ORCPT ); Mon, 24 Oct 2022 14:43:25 -0400 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1583108252 for ; Mon, 24 Oct 2022 10:25:30 -0700 (PDT) Received: by mail-pf1-f179.google.com with SMTP id m6so9578556pfb.0 for ; Mon, 24 Oct 2022 10:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=/KDE+ZSByxuwvp2Mh5tqtliS1mJsjNthfkvCjtjqWOc=; b=VR70NOdmonY9xti+I2mftN/fO5MSCOEqOMQdyXu9zkTVzTpBpjogLNZx8Fpy1CX3WG Xof1GvwLdr9TOIwoFww+uPjBElVHHdeQ5J0KVEFNHf6ieSOglmrnNMK8gRzC1vnES/ki WH8UChPriwQx6YjdhH0x4iNga1Qh55tCl5u1k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/KDE+ZSByxuwvp2Mh5tqtliS1mJsjNthfkvCjtjqWOc=; b=wOohf/6Fys/CxuGBvjRzrLFx4PJ2DmNP11W4L04l/u7a+8uIv4BumLlEEfDxSgX5/S rhLeiJi9EMR6ZxES2QUgJYpLvYgXPzARMqAhPwExzjUQBY8ZiiI9/VZ5edpq9X0gsx5y TmdRRLk+4+VNaGV/yUhcE+pH8s5zCQLZUE/FhRXo3HxGIiFNfHzrfs3QLIFwfHMImEKC vBYHYothzFnxUpQ31c1XBrASIFQxFElKcWORVfVLcqeKqyFNGhopr0V52t8s2ZZ0O9+z R3f8mn7U+TEKS/96a1wy80Cmoj+xuom/shROJqDICrPIqnirmPT00coAitQUGS2Ae2Ck PQjA== X-Gm-Message-State: ACrzQf3zvRQcBzac27GYQ2Jqb8EZtYdR2Im5DpMdMfpsPwGYxGN8nIfu aZ8+dCh8IXahfHnhNlf+w477c5266DpKVg== X-Google-Smtp-Source: AMsMyM4s91x+KgOQrSOXBLmvilHsV0EQlDIBoGj6O1GMTz1aa1gRlmyEPkx1kemaKziqOIyLVtlSbg== X-Received: by 2002:a05:6e02:1aab:b0:2fa:80c2:8375 with SMTP id l11-20020a056e021aab00b002fa80c28375mr21505543ilv.72.1666630149909; Mon, 24 Oct 2022 09:49:09 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id h18-20020a056602155200b006bbddd49984sm109429iow.9.2022.10.24.09.49.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Oct 2022 09:49:09 -0700 (PDT) Message-ID: Date: Mon, 24 Oct 2022 10:49:08 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US To: Linus Torvalds Cc: Brendan Higgins , David Gow , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org From: Shuah Khan Subject: [GIT PULL] KUnit fixes update for Linux 6.1-rc3 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Hi Linus, Please pull the following KUnit fixes update for Linux 6.1-rc3. This KUnit fixes update for Linux 6.1-rc3 consists of one single fix to update alloc_string_stream() callers to check for IS_ERR() instead of NULL to be in sync with alloc_string_stream() returning IS_ERR(). diff for this pull request is attached. thanks, -- Shuah ---------------------------------------------------------------- The following changes since commit 9abf2313adc1ca1b6180c508c25f22f9395cc780: Linux 6.1-rc1 (2022-10-16 15:36:24 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-kunit-fixes-6.1-rc3 for you to fetch changes up to 618887768bb71f0a475334fa5a4fba7dc98d7ab5: kunit: update NULL vs IS_ERR() tests (2022-10-18 15:08:42 -0600) ---------------------------------------------------------------- linux-kselftest-kunit-fixes-6.1-rc3 This KUnit fixes update for Linux 6.1-rc3 consists of one single fix to update alloc_string_stream() callers to check for IS_ERR() instead of NULL to be in sync with alloc_string_stream() returning IS_ERR(). ---------------------------------------------------------------- Dan Carpenter (1): kunit: update NULL vs IS_ERR() tests lib/kunit/string-stream.c | 4 ++-- lib/kunit/test.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------- diff --git a/lib/kunit/string-stream.c b/lib/kunit/string-stream.c index f5ae79c37400..a608746020a9 100644 --- a/lib/kunit/string-stream.c +++ b/lib/kunit/string-stream.c @@ -56,8 +56,8 @@ int string_stream_vadd(struct string_stream *stream, frag_container = alloc_string_stream_fragment(stream->test, len, stream->gfp); - if (!frag_container) - return -ENOMEM; + if (IS_ERR(frag_container)) + return PTR_ERR(frag_container); len = vsnprintf(frag_container->fragment, len, fmt, args); spin_lock(&stream->lock); diff --git a/lib/kunit/test.c b/lib/kunit/test.c index 90640a43cf62..2a6992fe7c3e 100644 --- a/lib/kunit/test.c +++ b/lib/kunit/test.c @@ -265,7 +265,7 @@ static void kunit_fail(struct kunit *test, const struct kunit_loc *loc, kunit_set_failure(test); stream = alloc_string_stream(test, GFP_KERNEL); - if (!stream) { + if (IS_ERR(stream)) { WARN(true, "Could not allocate stream to print failed assertion in %s:%d\n", loc->file,