From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 D7DDF16DEB1 for ; Fri, 17 Jul 2026 00:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784248068; cv=none; b=KgqikkAN4ZejnTWotf5K6swylZt66cbvINtHM7ifphhc5TYQZj7CUnAqk78QJTfW+71Wd5Mv6U1y97L8u/8AGe1gdt3LhYbd1co0AIzCYJEzT3VZUW8iM6GIvl3VB/Dcogw4z8ER/Q9COEn0/RhUOD36BQp6ViwAHqMf7VhbVXU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784248068; c=relaxed/simple; bh=WuxboMC8gwuYa9IvYfTHmmVyytT8FQoSrk7u1Q1bNM8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tHutuZHSYNTi7x7YM+BovJb979iCrq5UUdgGc1OPT+MO6WE4iJQO3Xh+Scm7PLNedDUMnrc6KNtvtGdyXVCaH6em3VxfmhoEbsq1V/3JLkS3j3r7il8fhYM7BdNHNmEH9PIRNMoeh3bmmg0EXO5HmWGKjGM/zh/UYmqhZivucwI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=amcTjttH; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=J5N12laW; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="amcTjttH"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="J5N12laW" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66GNJETt050150 for ; Fri, 17 Jul 2026 00:27:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= CXMtlO1SDpulkCJC4RwfiN8jyZ4jMbi7pNzjkUsjMVw=; b=amcTjttHrWtguKC5 n++lHJEs5cWDSbrwXvydXhhqunjR7ll8/C0DW8kN9C+hSMohgftQUZLG6krSoG2q AJaR4wmVw3hM2uJI7ByZYhtiKDm5bQUMjaJkqH3cS21J95WK6WmCRyd9ExGRW6L7 v7ZZ4Y/fdnneG7aPBMTFocabwVSjpLBtqbNeehXf9C7Ew8yX5ev2PXS1PkPWDS6Q m7KgVk3VEuAjSIw9fmtKPQdCtx4+GpYw35ECCXAvPyYfvFWwOVQBeOn7Gybpgoe4 ogzAXGzGIzJzBd9v90ay8F8xZt6aghIG/HTOoddLcJ9sN4W7yNDRoO+6EhZV4WzU JZvh+g== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4feve1upyt-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 17 Jul 2026 00:27:45 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-c9d5a5b63c5so10972153a12.1 for ; Thu, 16 Jul 2026 17:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784248065; x=1784852865; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:organization :references:in-reply-to:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to:content-type; bh=CXMtlO1SDpulkCJC4RwfiN8jyZ4jMbi7pNzjkUsjMVw=; b=J5N12laWJ4tlObv15JycFnYxrI3ljqf+5xWw8JwbTnjpAoQtQgS0KBhIIo7uKjALmQ wXLDr6jGpwQqOXMOJwTaOBecd4c8VkkEuQANqm2tVM54oBJExXPLfK2x1pVLK6tTG5DX KCTfhpdZh09tnt9fi9+7OtgX0a060KUWjIpGU6B4UzS0f03LoouEun3NhcQ/G8BX/pLk MWgLoZiMRf1KCBNhzEZFVPRqXUuPtZmGobPMEP/sph0YjpqQjNmAiM0G3Fa35qZiE2V2 Eg4csrNvrLniC5E4Ixj3Pu8jOK3el3iL5dbbTPX/kmDZCQ4AcDMOFqbhIDwqRWpC50KT hsVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784248065; x=1784852865; h=content-transfer-encoding:content-type:mime-version:organization :references:in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=CXMtlO1SDpulkCJC4RwfiN8jyZ4jMbi7pNzjkUsjMVw=; b=ZNz3wqtpf6RTR6okPT532IX6srFBngqe0PTpGtcBLfXuGw1gPhf4eEY68ThZ1Dox0m 0UyrkThBCqgaO+goYjENqGRTC2cDjtLk1AA0VG+XScYDRdzitD0FACn7C093rVWUCzvB zRcNn5Xfqd0NxaSSX5dh15krd0cs9zCk0YFURLbLicQq45kHepBy0Gi+oMG0CQ5/Zo+2 CZReAREmkrnGehquzS5zdgesWow/9WpoP04FOrIsRFw2MhU65RuXgxrKQzl1fN2ANN56 w9bANY+buw2XYZf8gni4O3TLb6iRSZ9GAaJU8Cd85MLR+Xghqa5sXgDUmIH6jbMyoYAs pKiQ== X-Forwarded-Encrypted: i=1; AHgh+RpS6hiqr2FGVzhsyAS/VZd93Pu/Zi+AczfcBu+QsIeQx/Du7j7iIwXrsMDWLwAkQH9yFSwJPnwnaB6IJ8w=@vger.kernel.org X-Gm-Message-State: AOJu0Yzj79Q2vTss2ngj2lGg+T2rTeREgwuYq9inoPEOJMoVgSk4vEvv GhlgVTmlckbxwxcZS+akYYa75L0Z/BA+KLqFB6oeu4b9PzrMacI7kg5diGvRtqt+9m/R8qBpd0J 9FVUYNoWfJF0GKhx0U4U8+ZgPvv3ByHZnyL9RlLUBhFFFo+uvCqZl4lP+xV8aoAlzi/E= X-Gm-Gg: AfdE7cnzECm1iQ9CwrpHlrXVRiQ9O2cDjK3h6Mu8Gi1YlXOoTPeXYFxvHDS9IU6c7dA 0A8EHDKMzrp7KtYU4nW3r3wNuvGjklWPCt1BgkkEExWG+vPeOJcgkiWIcR298tzkuv69iNgfSMA 3dZegKrBAvrAzA5hSPcKXiQ5ISrHMA5fVBHbAn45t7Ig5ZDR+4d+UUoLzpXvtxMECXN9PJOBssy Q0lcLRy90VKwJGGSbF63GsjsjKWAnwnFlLANkK3noHeGOZTLidSMXl60N+VN+PADfpxMTEPhja4 5XPb04PLp+0qm9TLFgRaGbvVDBAYrAz/a415NxuAEjailKyz8RGIy59wzWKdwaRVXe2dm3LYTSd JWCyeQbjjkhjIBX5u1HagZ7EK/g== X-Received: by 2002:a05:6a21:a8b:b0:3c0:9c18:d5a3 with SMTP id adf61e73a8af0-3c3ad97361bmr219830637.64.1784248064696; Thu, 16 Jul 2026 17:27:44 -0700 (PDT) X-Received: by 2002:a05:6a21:a8b:b0:3c0:9c18:d5a3 with SMTP id adf61e73a8af0-3c3ad97361bmr219804637.64.1784248064246; Thu, 16 Jul 2026 17:27:44 -0700 (PDT) Received: from localhost ([50.35.46.84]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3142a20c158sm523718eec.29.2026.07.16.17.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2026 17:27:44 -0700 (PDT) Date: Thu, 16 Jul 2026 17:27:40 -0700 From: Jonathan Cameron To: Andy Shevchenko Cc: Rodrigo Alencar <455.rodrigo.alencar@gmail.com>, Jonathan Cameron , Rodrigo Alencar via B4 Relay , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-hardening@vger.kernel.org, Lars-Peter Clausen , Michael Hennerich , David Lechner , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Jonathan Corbet , Shuah Khan , Kees Cook , "Gustavo A. R. Silva" Subject: Re: [PATCH v7 07/17] iio: test: add kunit tests for channel prefix naming generation Message-ID: <20260716172740.00002b37@oss.qualcomm.com> In-Reply-To: References: <20260707-ad9910-iio-driver-v7-0-a4ec30f63700@analog.com> <20260707-ad9910-iio-driver-v7-7-a4ec30f63700@analog.com> <20260712020928.2c8d1667@jic23-huawei> <20260714180812.000070c4@oss.qualcomm.com> Organization: Qualcomm X-Mailer: Claws Mail 4.4.0 (GTK 3.24.51; x86_64-w64-mingw32) 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=US-ASCII Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE3MDAwMiBTYWx0ZWRfX9YPn2Iv9OUbW Mb+ppdWkpwvK1q48FROz89Ld+YAqFUfOx8WiV6SJHHlAJLvaLREnvO/4NxByHir0UU1lQG8kBF8 L+XLvvc5P6PLf4vlYLWElMhtinnCMgadm9rGAY+fa5JSDTXkG/LNP2whD9NJbRM+d80lbn4e7ym u8cInhcHtcS2MfDw5muYGX6KxgKahxM+4SHne7sTWvgnWeis5JokMjClYUYZkzuyhCv8EVjJ6W0 WDtK/f2x93ctdg5nIYtWgqpinT7zqxNqHfFS80Vw+I0KfOhbS82WriIMEU0mZdtPLrftleyFQNH E47KV5dM4ZrKcp+u8JhKLoILjZ/Vmz1HTgVMTSx1vv+Dz2h8eaRdI2oZg8CJKZc/u9pEGWYCjd9 l3MQqmPcenKEqGpUPYsc+80TxTpX+DtYW7efrs3gyert0jtMH1FRMcgBvkzeArKRY2woogw2p+/ /oaQZ6BPwm3+VfMI5/A== X-Authority-Analysis: v=2.4 cv=DvpmPm/+ c=1 sm=1 tr=0 ts=6a597701 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=qC1CW/w66vtJz1P9yTJxNA==:17 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=QyXUC8HyAAAA:8 a=pGLkceISAAAA:8 a=VwQbUJbxAAAA:8 a=xcsdVRPUYcZtn2NnLoAA:9 a=CjuIK1q_8ugA:10 a=3WC7DwWrALyhR5TkjVHa:22 X-Proofpoint-GUID: aH9sjC35k_DSlQwHous7c65du89kUcWm X-Proofpoint-ORIG-GUID: aH9sjC35k_DSlQwHous7c65du89kUcWm X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE3MDAwMiBTYWx0ZWRfXzLYvqnVUQN6L lXnK3uNEvg4sOYmF2vIrlLvTYZIYo2IGhbRmHkJZL3ZS8UIgdDgJO5XDs2JlUpGdy7F9KEbxTfC MHg7iy0tKRnga6HTRjMAxPEGMarc6lg= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-16_08,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 malwarescore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607170002 On Wed, 15 Jul 2026 09:32:15 +0300 Andy Shevchenko wrote: > On Tue, Jul 14, 2026 at 06:08:12PM -0700, Jonathan Cameron wrote: > > On Mon, 13 Jul 2026 10:52:56 +0100 > > Rodrigo Alencar <455.rodrigo.alencar@gmail.com> wrote: > > > On 12/07/26 02:09, Jonathan Cameron wrote: > > > > On Tue, 07 Jul 2026 15:04:28 +0100 > > > > Rodrigo Alencar via B4 Relay wrote: > > ... > > > > > > Because __iio_chan_prefix_emit() is static, the test translation unit > > > > > is pulled into industrialio-core.c. > > KUnit also has static/non-static automation via a macro (defined in the > kunit/visibility.h) and I see that's used in the below example. > > > > > Isn't there some magic route cases like this that makes it non static > > > > only when self tests are enabled? > > > > Claude tells me to look at include/kunit/visibility.h > > > > > > There is, Although I think that using > > > > > > #if IS_ENABLED(CONFIG_IIO_CHANNEL_PREFIX_KUNIT_TEST) > > > #include "test/iio-test-channel-prefix.c" > > > #endif > > > > > > was more straight forward, less invasive and easier to change than.. > > Maybe, but thanks to this thread, I fixed other modules that use their own > approach to use the standard KUnit infra for this (as below). > > > > /* In "drivers/iio/industrialio-core.c" */ > > > > > > #include > > > ... > > > VISIBLE_IF_KUNIT ssize_t __iio_chan_prefix_emit(...) > > > { > > > ... > > > } > > > EXPORT_SYMBOL_IF_KUNIT(__iio_chan_prefix_emit); > > > > > > /* In "iio_core.h" */ > > > > > > #if IS_ENABLED(CONFIG_KUNIT) > > > ssize_t __iio_chan_prefix_emit(...); > > > #endif > > > > > > /* In "drivers/iio/test/iio-test-channel-prefix.c" */ > > > > > > #include > > > #include > > > ... > > > MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING"); > > > ... > > > // Use __iio_chan_prefix_emit() in tests > > > > I'd rather this wasn't built into the core module. So prefer you jump > > though those hoops. > > Hmm... The above (while being verbose) is the standard way of how we export > symbols for KUnit tests. Do you have a better alternative that everyone can > use? (Not only IIO subsystem.) Ah. I put that comment in an unhelpful place. I meant the include above not this bit. Absolutely fine with the exports being there. Jonathan >