Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp923483lqs; Fri, 14 Jun 2024 09:20:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjxyYIaPnbIispBz1msiA+g4DCEHTFttOXEksfEWYGdVNx2KbIgPJglRtirdWN4ZDeAfd/S44aLKk1jRJJuMN6SrhBy53d2M6SUuaWBw== X-Google-Smtp-Source: AGHT+IHWslmgiIgN5N5ddNusSRwRnlsdbgoUYzaxmRSOF4F7/TQD6HDDxB9JbZK0juKv2FUQM5RO X-Received: by 2002:a17:906:2695:b0:a6e:f62d:bd02 with SMTP id a640c23a62f3a-a6f60ced49dmr191371666b.7.1718382024784; Fri, 14 Jun 2024 09:20:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718382024; cv=pass; d=google.com; s=arc-20160816; b=hS0xhcsUw7s0hmJVW7EGkytf0GHUPr9nnXRLJo5NaOAQpwiTGMX+leP6qjKlDvvUsV A2mX6i/QJAt/xsMbxs1KdX+3+BGkAKe5vJyikXhE3AS85EMmV5OKyqkxUTbL4QDdm2Wh Rl4atV9E0koA3LryZ14WhJuMbC1vAJi477WUoJeF9eaZc44ZqIa9206uYuGF+k75jxbG zhPqiyT6xOUn1YoFughc0Zyx+ZId38hWuzc3OtAK9RSDxAdtPa+E6XjcZaNljGZ1q+er myFBHUGRSxGmiGOGXv5ov7cZIC03UubmHSF/1coXPU9PkioeGaOU/zM+SRSbgKH82wQK HsXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hx92rTQEBfMt/TWKPgxcRiRauNazbCbxwV3wI4CW7v8=; fh=No9zVpoZoUeYMUeFhvPMS3nDr18dR5rZncEYCaeL2xc=; b=jWpgNGfIlIkAcy3XDLS7XA0+rzGYP32+oA4Az3DsMDG9QStHFshfetmv3VZar/HA+o YXYEzepHUpCV3tB63smVntpykhKt2Tj90+iXlwTb4gSNbx290qI56I/krbzGBp4BKP8b j5FTYWbzpQipCjMpBVU6FfzNOvpY2rLJx39WdPq+r+sX8uG+j2U6cI9wDppd5M4VPo3I Kn6S1Bucvja8l4bJZhEhmFCotQfU3lPzF6gvQyZjxjrHCbhB+DyzxINxbrLU2uWhbLaM Uni2w0HTRfsTI3FmFieryJ6IvVyMZko6lX7pzOKTXcMcwaNNdAth8O8IF3kaDs1jhpL5 ZqjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VjZM7oQe; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-215225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f5b12b907si174050366b.798.2024.06.14.09.20.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 09:20:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VjZM7oQe; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-215225-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215225-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 82D911F239CE for ; Fri, 14 Jun 2024 16:20:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BCBB19752F; Fri, 14 Jun 2024 16:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VjZM7oQe" Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F129D192B7B; Fri, 14 Jun 2024 16:19:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718381984; cv=none; b=MnuTRR7pxf6dIBY0Ou5qBF8B1m6zgWP1t4ToqvpxnuF0beAWWlb9fH58CjxNK60/vkwdWU7eM+AZp3AkcCrJeyZ1VlByoKeWwj4PjuHfL2ibl2BnMDg0jMP8nQQ+rpFmQfN9oIMr992ILlFjNPEvuZ7w7cUrLoGq/rPl4gNdki8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718381984; c=relaxed/simple; bh=A8ti7FkIhPnz4QDYyrWnAxpZlEHI2kD6idXCq/AEJOw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IbigzEAmaKAD7U+jSiZqNDqYJ5xG7aIKjVp84ddOp7/QfpmRxDxUoW4kMGt7FzEpBI5Bw7w4kwkQVeCvc39YWc+98VSSTdlBcmasWkjWCPGnTYNtOe4Aoz+lVC52/1UdKnuVM9s9nWgCUCGbAzTbsLbqCUBZTPJg5UlsXI8u6Qk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VjZM7oQe; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4218314a6c7so21623665e9.0; Fri, 14 Jun 2024 09:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718381981; x=1718986781; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hx92rTQEBfMt/TWKPgxcRiRauNazbCbxwV3wI4CW7v8=; b=VjZM7oQePWox5Ft/HX09S8oMegCcR0LLxNzMCSrV4g8pKMpO5QoL7hoN/UTPxEiuZq 8k3jmlUUePhXTtZ4dhwZcFAjORmZLjsEdoozFLcuLEJtMPYj/jkwo+bysnVl444lUwSY WrjPbkNDVvMjem/Y/+2ISOo8hYPXcS1AmCGxpx3pjEoEKmCxUrFR4Lg/wj7GjaxdyJaW mYQ1951kl9K1LLVL8BcRaHjF8K5da6sawxKptIHXTXwnBk7zGs/Vtp+8TzPPGl0uV5iE 5G/LPGKrQOn1dSmrQxJFars4NpMNzkdiOxvNBLfHWCurnSMIg2BxbGYcbpYZDxNSHIoL XR8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718381981; x=1718986781; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hx92rTQEBfMt/TWKPgxcRiRauNazbCbxwV3wI4CW7v8=; b=Md8jyvBOfpOC/BrlaSbUI5Rhv2f2g/VTlw/R1c8z4fgLiPmTLcaDcG9lTYVN5EQ+yB yr0unY3WC8qjd24Uoe+vv/caIr+DVbIkyY/Kn+vXEKWhhjswu7fGCSqw7dBKQkPlG37Z WD744Do/ImfyaOFpzucqCthE8izAc9MHbwstgwSNPm4ofkKgZFoM9OO9HbtRDwtOIVf0 Ir0Smw/na+24h7YiTOBZBVEz2V9C1RF4wd1pqBbsYySjpGdOEwGIAnmKuQC81e9IFJSb VlmQzq+p5S+ILbzRLEM0HxjOtqcHlX226yKepR8KVEQBkHU1OJSLsaP+FYSRMzTrqb7k JBpQ== X-Forwarded-Encrypted: i=1; AJvYcCVFlWArnWzVc0MJoAV+3qPhjcztuxzvap98kfavfBjzqY+HJPOPdcBURxsHHKohpoKUxiuO3LFVgzToG7yu0jYGnsCRhJH0pPeeSUVtEK0WNpPswDl4rdIUjwyoPbuPyEYqvwxpu4UWYIs= X-Gm-Message-State: AOJu0YwDsCq4cJeZK4pwpWn6sD024FHiQQUIwA0QtZmQuLAzf3/PGRCZ F65bVe0l+LKGmyxknjOLEoKhsKUP3tcCNIQJ4DGZ86ulTpVsg2ju X-Received: by 2002:a05:600c:4588:b0:421:6b83:2a65 with SMTP id 5b1f17b1804b1-4230482fcb4mr29779925e9.17.1718381980994; Fri, 14 Jun 2024 09:19:40 -0700 (PDT) Received: from fedora.. ([213.94.26.172]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42286eefa63sm104638905e9.1.2024.06.14.09.19.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 09:19:40 -0700 (PDT) From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, arnd@arndb.de, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Subject: [PATCH v2 1/2] HID: uclogic: Avoid linking common code into multiple modules Date: Fri, 14 Jun 2024 18:16:05 +0200 Message-ID: <20240614161935.230529-2-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240614161935.230529-1-jose.exposito89@gmail.com> References: <20240614161935.230529-1-jose.exposito89@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hid-uclogic-params.o and hid-uclogic-rdesc.o files are linked into both the driver module and the unit test, which triggers a W=1 warning: scripts/Makefile.build:236: drivers/hid/Makefile: hid-uclogic-rdesc.o is added to multiple modules: hid-uclogic hid-uclogic-test scripts/Makefile.build:236: drivers/hid/Makefile: hid-uclogic-params.o is added to multiple modules: hid-uclogic hid-uclogic-test Avoids this by moving these two files into a separate module that is used by the driver and the unit test. Acked-by: Arnd Bergmann Signed-off-by: José Expósito --- drivers/hid/Makefile | 6 ++---- drivers/hid/hid-uclogic-rdesc-test.c | 2 ++ drivers/hid/hid-uclogic-rdesc.c | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index ce71b53ea6c5..e40f1ddebbb7 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile @@ -154,10 +154,8 @@ obj-$(CONFIG_HID_WINWING) += hid-winwing.o obj-$(CONFIG_HID_SENSOR_HUB) += hid-sensor-hub.o obj-$(CONFIG_HID_SENSOR_CUSTOM_SENSOR) += hid-sensor-custom.o -hid-uclogic-test-objs := hid-uclogic-rdesc.o \ - hid-uclogic-params.o \ - hid-uclogic-rdesc-test.o -obj-$(CONFIG_HID_KUNIT_TEST) += hid-uclogic-test.o +hid-uclogic-test-objs := hid-uclogic-rdesc-test.o +obj-$(CONFIG_HID_KUNIT_TEST) += hid-uclogic.o hid-uclogic-test.o obj-$(CONFIG_USB_HID) += usbhid/ obj-$(CONFIG_USB_MOUSE) += usbhid/ diff --git a/drivers/hid/hid-uclogic-rdesc-test.c b/drivers/hid/hid-uclogic-rdesc-test.c index 90bf4e586e01..d6b18213f45f 100644 --- a/drivers/hid/hid-uclogic-rdesc-test.c +++ b/drivers/hid/hid-uclogic-rdesc-test.c @@ -9,6 +9,8 @@ #include #include "./hid-uclogic-rdesc.h" +MODULE_IMPORT_NS(EXPORTED_FOR_KUNIT_TESTING); + struct uclogic_template_case { const char *name; const __u8 *template; diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c index b6dfdf6356a6..6c7a90417569 100644 --- a/drivers/hid/hid-uclogic-rdesc.c +++ b/drivers/hid/hid-uclogic-rdesc.c @@ -17,6 +17,7 @@ #include "hid-uclogic-rdesc.h" #include #include +#include /* Fixed WP4030U report descriptor */ __u8 uclogic_rdesc_wp4030u_fixed_arr[] = { @@ -1242,3 +1243,4 @@ __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr, return rdesc_ptr; } +EXPORT_SYMBOL_IF_KUNIT(uclogic_rdesc_template_apply); -- 2.45.2