Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1825322rwl; Mon, 26 Dec 2022 05:23:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXuTjR/MkAZNEzdIo+k5UlZms7rf5KS/UhCEmgf+n14DGpSH3XN3FwDllB8EsShaJzZHb3DD X-Received: by 2002:a17:907:a485:b0:7c0:e23f:17ca with SMTP id vp5-20020a170907a48500b007c0e23f17camr15431741ejc.34.1672061006838; Mon, 26 Dec 2022 05:23:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672061006; cv=none; d=google.com; s=arc-20160816; b=vct7IFvtKEwB5DkWtTUaYzXNvlCF1mKzyqCrWmHbgBFmIDHbaD60gLjMNWi6k7XzX3 FM3ELzMki50bOoOltwYwy7q5WazkfsxX/pNjprAvlZaBhae6zwp4u+eonNxJsqxd1o8U son9nvPzS2evhIg2hx1mjhiHywI7g5gA/peuobosBWUXm3Ojl7EFihjvu6U04XgEw+ZP zc8O6t++DVy66+cnS8o7NueN8GE9ycykCqGbUjeKe9A2wTyNt+EA9dg0G3FovEIy9a0R AhvBCksqOqyJ0EFrZe4hROjcKbfW9zYcIMtHzQVS99hBVgVHdPaTwsY+qFtjZfVdIqOr YpQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zzKvBwGrGZqlmHNrTPVabDsnxi1Vb5DLo53RO5lTTug=; b=WjQ18qoXTijU51yRhcF21VAk+l3Vt+sLn8fkjSmrcNhKc1tXOOtBPnqj4Hm8U1w+Sj XPWOXb1bUGLPWuLxoJ4NUeUVJGPiy6lrPJEigbpQ9tqgg0nSG3vvODpX4Nn2ZOLR25eW egEfM6UtKWCfPN5wVtVxwr6SjXnsMm30lIXXUVohl28QaBjADsaFS5W71EktkBnLr8OA V5u78fe1g1gYygvKlMgBj97yL7zPc6bilfhSp7D4+EOgo9YMHtUsXImL6ahiVI1UjUHl IGr4w0SPbD8Av0c6StvgkcpfkLKccOJPNLNxYuouQjsyWfLdBH+gH+rCC25eOk2mmU3h t2Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lMMnEduG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb13-20020a1709077e8d00b008318885e1f1si9362668ejc.176.2022.12.26.05.23.09; Mon, 26 Dec 2022 05:23:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lMMnEduG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232073AbiLZM55 (ORCPT + 66 others); Mon, 26 Dec 2022 07:57:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232116AbiLZM5y (ORCPT ); Mon, 26 Dec 2022 07:57:54 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 307911F2; Mon, 26 Dec 2022 04:57:53 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id y16so9977306wrm.2; Mon, 26 Dec 2022 04:57:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zzKvBwGrGZqlmHNrTPVabDsnxi1Vb5DLo53RO5lTTug=; b=lMMnEduGp+dJ2rD+CcY9BqL+9PtAlwA/fUaNCiKIyMJRRLFlSgqgAoH/t5Rd0ijAnH UbF7rX5HVxghhGlIasFnphAJ/fzeU0lzxInlsGE3wIAX9RAmU3DxkGxwiaZ/uKbDRgQJ wd7Zjv7LDmylirRXQd+/YtcZuturhmjjJlWzoBS7XGF1UTvbosOvaLzXvtbyOqxuR5xk 8TUvxae+CEhcSRqX9QXBM3wOmq6kQpTU+Rudy4R60zI69ogD9pEJhRDyMNADYth3kjkz ch1tmM8baMr4MrRbSHyMxH1SiuLPH6xLpE5uxw8KsU97AZnvT7gM9vk7pbcJqvmtrnbz yFHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zzKvBwGrGZqlmHNrTPVabDsnxi1Vb5DLo53RO5lTTug=; b=ntb3krUrOaSsO7kDOcKX56LqINR8SzZ+SaFcYtk7p+BntUcYWL1YdItFy7igNedguP 7ekoLoXjVdTqU/DNhI81SC4zxDUnUXC1EaUWvzQ9C46xsvDR1Ae/J3xJNbEerTgcxwjf FZhgSGjCjR287R8XT3Lha9iKxpmlWR7m4Jv4d8q7BwuGFX5J0vCefgJ1FvwpuRBBeW2Z /tIMtq/RoM8frKhVUPKM+yqiRUuuqKykCJ3j4+L3GHeICVbJr8q05qp62I+QHhbapBB3 OouVvNQv64Seyarx0RgqQvTDWO+27SXoPFKi9kiliZilD+tXnB1Y2t7HZLiZPrgj3OGS gE8w== X-Gm-Message-State: AFqh2krmlydPod3um+KTCh6aJ4eRJ/embKVPsZDv+RtMGP/vTsCGbN+0 4oGrjHb6/Zgod+s86iawrEc= X-Received: by 2002:adf:e5ce:0:b0:27e:520f:1093 with SMTP id a14-20020adfe5ce000000b0027e520f1093mr1778753wrn.37.1672059471722; Mon, 26 Dec 2022 04:57:51 -0800 (PST) Received: from localhost.localdomain ([94.73.32.212]) by smtp.gmail.com with ESMTPSA id l7-20020adfc787000000b002238ea5750csm12406285wrg.72.2022.12.26.04.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 04:57:51 -0800 (PST) From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, mcanal@igalia.com, mairacanal@riseup.net, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Subject: [PATCH] HID: uclogic: Use KUNIT_EXPECT_MEMEQ Date: Mon, 26 Dec 2022 13:57:36 +0100 Message-Id: <20221226125736.18053-1-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit b8a926bea8b1 ("kunit: Introduce KUNIT_EXPECT_MEMEQ and KUNIT_EXPECT_MEMNEQ macros") introduced a new macro to compare blocks of memory and, if the test fails, print the result in a human friendly format. For example, this is the output of a test failure: Expected res == params->expected, but res == 01 02 aa 00 00 00 03 bb 00 <00> 00 04 05 params->expected == 01 02 aa 00 00 00 03 bb 00 <01> 00 04 05 Use this new macro to replace KUNIT_EXPECT_EQ + memcmp. Signed-off-by: José Expósito --- drivers/hid/hid-uclogic-rdesc-test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/hid/hid-uclogic-rdesc-test.c b/drivers/hid/hid-uclogic-rdesc-test.c index b429c541bf2f..90bf4e586e01 100644 --- a/drivers/hid/hid-uclogic-rdesc-test.c +++ b/drivers/hid/hid-uclogic-rdesc-test.c @@ -197,8 +197,7 @@ static void hid_test_uclogic_template(struct kunit *test) params->param_list, params->param_num); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, res); - KUNIT_EXPECT_EQ(test, 0, - memcmp(res, params->expected, params->template_size)); + KUNIT_EXPECT_MEMEQ(test, res, params->expected, params->template_size); kfree(res); } -- 2.38.1