From patchwork Sun Dec 8 12:01:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13898531 X-Patchwork-Delegate: jikos@jikos.cz Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25A524E1CA; Sun, 8 Dec 2024 12:02:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733659325; cv=none; b=rg8wE4ce7zwxC3Tx4Pbv4wpsu3Cw+oC4Yf5WdfvCT3Q6ebYk3wEtaaDndZuaGd4YGWV13aXkKumFI999oKPb50nco/m4kkUxns5JX920sto2c7lpuqNESE/KXhQ57GMpEUMpOxU55flRCOi0V6NGXwethq844prCULLt2rkzRzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733659325; c=relaxed/simple; bh=2TuFi+ljqxYKujk/z785d3q7u8TD3NVQUriVfeWj/wE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G5SUR6YIbP9CBZn6G37yNUgzVz7F1pQ0v4eKPLEup82hf/OgHBGPwaKVTk80j5q+R7RU79x+VZuMioG1yiq5rKZREu3UFm5X0zeH7hxFbfbajMsRKWb92k0Nm/kngAhBMcfW0u0gDEwWI1fJU27mhR5D821mq5iKmvaINxHW+aM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=nlIUSUNe; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="nlIUSUNe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1733659313; bh=2TuFi+ljqxYKujk/z785d3q7u8TD3NVQUriVfeWj/wE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nlIUSUNe7jn57LUTnlzpNnauOn+zjY1efF31GzjGdZZHTl4p56KB079XJD6EWXuDs +mGvHPKcmkM4vrMu0KYKU1+fMyVvR14KfyWrey3ii7qrf5x2bEnpplk8/hG2fIQ7B2 dUQgWzCO8dOUvpa167wZL+MaueTBDAm/Y1ro9CuM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 08 Dec 2024 13:01:51 +0100 Subject: [PATCH 1/2] HID: input: fix test for CONFIG_HID_KUNIT_TEST=m Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241208-hid-ifdef-kunit-v1-1-cbea6077a233@weissschuh.net> References: <20241208-hid-ifdef-kunit-v1-0-cbea6077a233@weissschuh.net> In-Reply-To: <20241208-hid-ifdef-kunit-v1-0-cbea6077a233@weissschuh.net> To: Jiri Kosina , Benjamin Tissoires , =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733659312; l=811; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=2TuFi+ljqxYKujk/z785d3q7u8TD3NVQUriVfeWj/wE=; b=dRQGWFg3B/+jFQ1FC/sI7AvlWbB5YjUIUkFHVcZL1twtGqYnXQggpaogLaIct8/m+R8w8ZDXl +E6xiv6qW2TA7Zo1TxW/2As06gPB0CTrHoJErEppB3knyrOsGRIzRGc X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= If CONFIG_HID_KUNIT_TEST is set to "m", the #ifdef test does not work. Switch to IS_ENABLED() which works for both "m" and "y". Fixes: a608dc1c0639 ("HID: input: map battery system charging") Signed-off-by: Thomas Weißschuh --- drivers/hid/hid-input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index fda9dce3da99808e04ce66dd7beec6731173e75f..8f065d89979c3577dcc17a6f0d52468d69f16c87 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -2388,6 +2388,6 @@ void hidinput_disconnect(struct hid_device *hid) } EXPORT_SYMBOL_GPL(hidinput_disconnect); -#ifdef CONFIG_HID_KUNIT_TEST +#if IS_ENABLED(CONFIG_HID_KUNIT_TEST) #include "hid-input-test.c" #endif From patchwork Sun Dec 8 12:01:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13898532 X-Patchwork-Delegate: jikos@jikos.cz Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25A161E515; Sun, 8 Dec 2024 12:02:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733659325; cv=none; b=jow8VCZwoPXzze+8OjPBMOqFwYWGwd/JEBKkTHcBlzz3L/bWGxjlETwpCIVw8/yTdv43rOO4ccn1RR8cnD/Zc/EszMwFSYQDX1SylEkxmHWpjuBOe49U0CZ1SiVBSCUqym3w0BDnSWGqCKPUf59ErBSQ4hA9QYUwv2w1FKP/Hkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733659325; c=relaxed/simple; bh=DfE0Lq82U3YoOJS14Z42A57RH5/Ctp8ywYnwx8g1JgE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q5aDdHfMKWVcm0Ib3WSjAUxxH6GSZLIwtNiltstnEC9olqGdPQBms+zxT6MoiCUynQzLV8yTM/eknOwfCpQoIVhgumj/AEqP2C8Q8Ab96SfCgzBQq5w3Jh2UjQR2IyaVtmlP4ofbGgI4tzZ3TZ7QyBm/+akJSlFTWoDx2tbZ4lY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=Pm154T5N; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Pm154T5N" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1733659313; bh=DfE0Lq82U3YoOJS14Z42A57RH5/Ctp8ywYnwx8g1JgE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Pm154T5NLRc01cJCJienk3sw7NhczBNkDJM9U5eJhlgSKHG22QABDj/o8U96edAYP tzQSMqgnOFRjCJqYcLEN7esfDFnA4Yb/vkqPz7RnYtBQKGFR2hBKyrgajTW/iyrG/Z FklILiuzfyYe5S+f+Hn27YSkrViZCbNidsNj1L+E= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 08 Dec 2024 13:01:52 +0100 Subject: [PATCH 2/2] HID: uclogic: fix test for CONFIG_HID_KUNIT_TEST=m Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241208-hid-ifdef-kunit-v1-2-cbea6077a233@weissschuh.net> References: <20241208-hid-ifdef-kunit-v1-0-cbea6077a233@weissschuh.net> In-Reply-To: <20241208-hid-ifdef-kunit-v1-0-cbea6077a233@weissschuh.net> To: Jiri Kosina , Benjamin Tissoires , =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733659312; l=1573; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=DfE0Lq82U3YoOJS14Z42A57RH5/Ctp8ywYnwx8g1JgE=; b=EpWz2U9rW134ujLblN/T/YQYzXosoDKU6JU8Uk1jeZB26/BZsOB59A1g7FqW9OHI342/BouTb 3XUFsJ7ejPVB7q4Z+7OeATt/IxYGYO2Kl5ULAvZuQoPjpDUgZVS48t7 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= If CONFIG_HID_KUNIT_TEST is set to "m", the #ifdef test does not work. Switch to IS_ENABLED() which works for both "m" and "y". Fixes: a251d6576d2a ("HID: uclogic: Handle wireless device reconnection") Fixes: a64cbf3ce631 ("HID: uclogic: Refactor UGEE v2 string descriptor parsing") Signed-off-by: Thomas Weißschuh --- drivers/hid/hid-uclogic-core.c | 2 +- drivers/hid/hid-uclogic-params.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c index d8008933c052f5c9b5df9dadc5bce353f3c5b948..a824df67add9eb1d3dd7776fefd8f6f079bf509b 100644 --- a/drivers/hid/hid-uclogic-core.c +++ b/drivers/hid/hid-uclogic-core.c @@ -571,6 +571,6 @@ MODULE_DESCRIPTION("HID driver for UC-Logic devices not fully compliant with HID MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("HID driver for UC-Logic devices not fully compliant with HID standard"); -#ifdef CONFIG_HID_KUNIT_TEST +#if IS_ENABLED(CONFIG_HID_KUNIT_TEST) #include "hid-uclogic-core-test.c" #endif diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c index ef26c7defcf61ced86b07100002e572780f23305..b5d4bb77c83c7e1ab3051d3b619993bc1b08204d 100644 --- a/drivers/hid/hid-uclogic-params.c +++ b/drivers/hid/hid-uclogic-params.c @@ -1860,6 +1860,6 @@ int uclogic_params_init(struct uclogic_params *params, return rc; } -#ifdef CONFIG_HID_KUNIT_TEST +#if IS_ENABLED(CONFIG_HID_KUNIT_TEST) #include "hid-uclogic-params-test.c" #endif