Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp206197rdg; Thu, 12 Oct 2023 03:24:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHh4+3RI+2evcfAmJx5BBCTSwx/vcaZTkvvL2lDJoXxHRn+3EJJxen+3dEMuR7pAc1fda8B X-Received: by 2002:a05:6a20:7345:b0:167:26c4:256d with SMTP id v5-20020a056a20734500b0016726c4256dmr27221280pzc.21.1697106289345; Thu, 12 Oct 2023 03:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697106289; cv=none; d=google.com; s=arc-20160816; b=rKUqqhJ/erlbgWPlz40FJiJ/jTGBPmLwyiWe+E7rAYfwSXknWhMVSRYNMEh1l7Ylv1 aUmRThrU8wIQtc9LILnW4asYeBj+wnVn4OCoHtHKp9zKlVZhjNpCIqx893ySgZVd2mGj RlhJNRx97VLD42gHQRjmINa/Yt4bJc5m7HTlQ7JMyauQ/W96KXYtLn7QTylWaxVzwW+8 L6mt4EHOWAwvAZrHUtK++ZdiYalSv/Mc2FZsmR8LNsR4xELcw7C5zFso+I64DvPs8SU7 1KHAG2FdCZsIFZJVPc9os1T3LMtumrAS2t7gHq+NpqDQ5uYgxxsBinS4NxHZFOZiKfTy JMDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=EpzQEIzSvLBT+b3/kyQ5OHK9aDN6uF6iBrhSJR17YUI=; fh=xUtS4Ye9bvz4mnbfL9bwsYffunq5fde5WqM/qGGhhDQ=; b=PxHCthF3LaXldJ8r6iaRcBHxFrOcUNG1f6rfDw611DBTY4oOLpCas57PFdoQBRxfk1 EfGi3yq3dYPkLeoVAELRJY5gK2NYFDs9jgmBLmbcLodnhMfi+wDw0Whk7Pj6o1aADqBn 1QkM2x58J58UBH7K5jBa0ZXkU6VxMJB5oT/aoFgZJvQNKt55tUfl3SG6aD+edFnFlALu an3PR98UF9xsvgLW73AaokuY6sgrmeSSaNoaNRu9cC6r9WhQleRjN4O2GnYJM/hTTmK4 h6Vm+iPI+enEk6iV0a0fNt46Ac8gxsLbrI39QXC1ldtVb4+pX2XI2L5652aormn7jLpH WKrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=WSw3ac5i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id dc4-20020a056a0035c400b0068fadbc3169si13886634pfb.254.2023.10.12.03.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 03:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=WSw3ac5i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 12A8D8122886; Thu, 12 Oct 2023 03:24:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377807AbjJLKYX (ORCPT + 99 others); Thu, 12 Oct 2023 06:24:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347126AbjJLKXw (ORCPT ); Thu, 12 Oct 2023 06:23:52 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7E18D6; Thu, 12 Oct 2023 03:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1697106227; bh=YveTPkYULLlyEsdLlGA46f1LzhfC/wP+L0Bg43PHoWM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WSw3ac5i301zeAp93+JgG8P+/dbjE6iJwrFUgvgDOcmbL+ihwU1NJW6dnRY5bSNAT K1XArJ0hoKRw49I+WWAvIFZQzDyvTos6aP7M77giF2PMcLFGCPSKQqtTzga9I7/Jb/ xaSOHAmGmSbCIal7m6S7U9LRsCpXENQoDnQu1+8w= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 12 Oct 2023 12:23:40 +0200 Subject: [PATCH 3/4] HID: multitouch: remove #ifdef CONFIG_PM MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20231012-hid-pm_ptr-v1-3-0a71531ca93b@weissschuh.net> References: <20231012-hid-pm_ptr-v1-0-0a71531ca93b@weissschuh.net> In-Reply-To: <20231012-hid-pm_ptr-v1-0-0a71531ca93b@weissschuh.net> To: Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1697106227; l=1381; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=YveTPkYULLlyEsdLlGA46f1LzhfC/wP+L0Bg43PHoWM=; b=i7mP2224uBTGN/Zh76uFUX2dWrxHLRZqal53sVh/xAs7qvfoXcmHUigUcyaoqKjkusVT48IFQ KzCQUgxJJTbAyUUO8Ltk+LzVUb/rArUYbqPhCDY+vtmLPSRnwwmZG4r X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 12 Oct 2023 03:24:47 -0700 (PDT) Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be compiled, protecting against bitrot. The linker will then garbage-collect the unused function avoiding any overhead. Signed-off-by: Thomas Weißschuh --- drivers/hid/hid-multitouch.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 521b2ffb4244..2cdfc2a70a83 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -1802,7 +1802,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) return 0; } -#ifdef CONFIG_PM static int mt_suspend(struct hid_device *hdev, pm_message_t state) { struct mt_device *td = hid_get_drvdata(hdev); @@ -1836,7 +1835,6 @@ static int mt_resume(struct hid_device *hdev) return 0; } -#endif static void mt_remove(struct hid_device *hdev) { @@ -2255,10 +2253,8 @@ static struct hid_driver mt_driver = { .usage_table = mt_grabbed_usages, .event = mt_event, .report = mt_report, -#ifdef CONFIG_PM - .suspend = mt_suspend, - .reset_resume = mt_reset_resume, - .resume = mt_resume, -#endif + .suspend = pm_ptr(mt_suspend), + .reset_resume = pm_ptr(mt_reset_resume), + .resume = pm_ptr(mt_resume), }; module_hid_driver(mt_driver); -- 2.42.0