Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1435120lqj; Tue, 4 Jun 2024 01:03:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+oBryV9En0Gx9oO7FhLgDxPKmFgDz2L+8l2QaOWsjq8p8/X7aPaPV8dqlr1rurG5nqey8uM3M4bhVxzW6G6LGUJMtSWOkbbkTnG1AhA== X-Google-Smtp-Source: AGHT+IEOOYCZuvSdIpvSp13vCYTqwk2/P4Wein0KKC5dhFrsann888CB5vKuxNXuwqEJuJCS4vli X-Received: by 2002:a17:902:7842:b0:1f6:324e:4def with SMTP id d9443c01a7336-1f6370834f9mr94300075ad.50.1717488232029; Tue, 04 Jun 2024 01:03:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717488232; cv=pass; d=google.com; s=arc-20160816; b=xoK+2D79Ex7QYqI7XHcUXWhNFN82D24t4toApgG4yJ7bhcRHT7N8GhBdLjcj0WiEDS 281ZduYdT8hRc9NbaVh354+Cc1Bxx1WkJxcP3g0H7oKTM/2sXE2ImBNYd8oNtIJ9radK ei32d6xa5DFFxGJS7xn87QhIpI7VtloTU+mzeVh0/c1GW3mnGmcovsle/EnUk4ZDxs60 1ebrVMTfXbB22KEV6sIr6K6+G0aFM8zsSTRQ3C+kt2MBqF0+wijlFqToJy+KvedNZA66 HT3s+wL8VWU1GoCB1MyIpv+Dk7PdAmtsQLd2OXeDync4SAEnYLDuesxVWEkC6E8fK6RI X0Kw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=2FwahE66ZXIwspaC/JRsBaR02QEmRxDVlA8r/UgHIEo=; fh=QUKJJYARDNagkF/HGvZeXC0oXnarmUlqrcXQpEa9yCg=; b=fHvUeKrLFwwekmtqRUqoTagejkYId4FUFQENJTT5ENX6p3pqQUg0uCWAiT7bSZLjYE b/1lvk9a+P0v8l1rHjGZNtsSoZT6PeEMukB2q2r/dM8NfLcSM+2xNf/3VCSfUy1BG+hk NIzQAc8sJubDN1nOBzMrSAwclysxNUAPFALQWmYjk01C96RlhQgir2i8thbnrG6kmbFT KVw9shP2u7WDcJb/NfwImHp4pQu/b2YVmfwqEePr7SjJHFYyi/F3txiQWxoMKEAYwqBw Y+ebZfX+m4ZuFpYADbjNPuYYGiqrhzkwHhgrm3/yeLJkG4IedGvnLg2LIRLHjN1MrMt+ A+wQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=K+hP4aPF; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-kernel+bounces-200208-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200208-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f64ba67626si10454975ad.614.2024.06.04.01.03.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 01:03:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200208-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=K+hP4aPF; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-kernel+bounces-200208-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200208-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A6DE5B22471 for ; Tue, 4 Jun 2024 08:00:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D1131419B3; Tue, 4 Jun 2024 08:00:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="K+hP4aPF" Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) (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 CC7EE1384B1 for ; Tue, 4 Jun 2024 08:00:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717488008; cv=none; b=hRZT2nnaDllM93+CDj44mIqOS1tK3WZG5TA8jTe9TJP9sZtJBAmJCEwxEhioiOgSFY0Xkpcf5mZS6QF3gxSK7iEoVZUWn2xBWX2huBs10ZS8IEXYZRvPfbKgo2VdvErxcTOy8ziG/LeAuXfqDtTvfea1LpOpjVJi1vL++bz7Rgc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717488008; c=relaxed/simple; bh=2FwahE66ZXIwspaC/JRsBaR02QEmRxDVlA8r/UgHIEo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BhdqR0H6HAVO7gfBJ0BgXyJiVUPRtPe79epyHQT4szwbMGuPL+/qlaNmo6vuiTs4WOazQuIYdt48kohJt1+q0Ik5ddZuK7y9RCJUF/xaNwqrZ622zEtdar27VDx66eT9nNd0pjMckJ4vk6p/safEmS0bhBYrM96kdEl69lvWw4s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=K+hP4aPF; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=k1; bh=2Fwa hE66ZXIwspaC/JRsBaR02QEmRxDVlA8r/UgHIEo=; b=K+hP4aPFlCRH0h5xXLEU /9kHCA592KKdKg2kYjOpCrj2AGOjxuI4HbrrWY65K8A21X4TsoEzevkLMrIjB72W spvmeNCHEThU1Rv+8ov/Xw2KWy3c5V+V1M2YjUBkwl+L3OmU6844eIIYs/YGdCj9 GqG9VW6VFpUe0gAjGdTv7sXWUOsX7gQ03PwDMiHNmqT+2YbgN3i7PenBiygglTVP OjKhK4Awt5pZpTz55ic35oXH7SjG399geGItpv1GWADy+lf9P13r/IDJxRjOw2tN 6dVyQ8LDjbn7EPHEBtFHGxl313eAl4t4kulHNSkXgcPie33QQiLCU9fjGLt+x2h1 HQ== Received: (qmail 2214748 invoked from network); 4 Jun 2024 10:00:05 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 4 Jun 2024 10:00:05 +0200 X-UD-Smtp-Session: l3s3148p1@Lttt1gsaVscgAwDPXzLGAH1eNELjOc3g Date: Tue, 4 Jun 2024 10:00:04 +0200 From: Wolfram Sang To: Arnd Bergmann Cc: Andi Shyti , Hans Hu , Arnd Bergmann , Wentong Wu , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] i2c: viai2c: turn common code into a proper module Message-ID: Mail-Followup-To: Wolfram Sang , Arnd Bergmann , Andi Shyti , Hans Hu , Arnd Bergmann , Wentong Wu , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240528120710.3433792-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hzrqra7phcm27hy4" Content-Disposition: inline In-Reply-To: <20240528120710.3433792-1-arnd@kernel.org> --hzrqra7phcm27hy4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 28, 2024 at 02:06:30PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann >=20 > The i2c-viai2c-common.c file is used by two drivers, but is not a proper > abstraction and can get linked into both modules in the same configuratio= n, > which results in a warning: >=20 > scripts/Makefile.build:236: drivers/i2c/busses/Makefile: i2c-viai2c-commo= n.o is added to multiple modules: i2c-wmt i2c-zhaoxin >=20 > The other problems with this include the incorrect use of a __weak functi= on > when both are built-in, and the fact that the "common" module is sprinked > with 'if (i2c->plat =3D=3D ...)' checks that have knowledge about the dif= ferences > between the drivers using it. >=20 > Avoid the link time warning by making the common driver a proper module > with MODULE_LICENCE()/MODULE_AUTHOR() tags, and remove the __weak function > by slightly rearranging the code. >=20 > This adds a little more duplication between the two main drivers, but > those versions get more readable in the process. >=20 > Fixes: a06b80e83011 ("i2c: add zhaoxin i2c controller driver") > Signed-off-by: Arnd Bergmann Andi, I am tempted to include this in my for-current pull request this week. Are you okay with this or do you want to review it more closely? --hzrqra7phcm27hy4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmZeyYQACgkQFA3kzBSg KbYxrhAAjGLtahAsSRKZR0KV4UQzJCnGB4IHLqh5jGCTvKMNxQxfdvTSUg23MCi/ 4MmtcLezzjSmCbd6Z6Apk4za6PxzLRyeSw+rpp7imXh6RSII2QkWAodG7wyU7jir szjfA58A2pHdCIFcGcNziygwVx+W8kNcn2GRVNMn2NJP2EuyXS+hkMvYh6CdjOVK VYwkh5jeRjlUt8c2jQ5uMufQvsFF0tuYI87awEiRUSSUU1TjrJDdMfo3+L4wTusi 9y+fNVGfaA4Bsd1bdB3Ex7K/tUCkqh+1QsStMWKiLEr/kfmvTtG7p3wsFZOvU+Rd dvJ5jYJ34j2aN8XsrFlf7huuNd3TFdDbAPjUV2+ty+ZznqsRi+YCmsjWticWCFs3 nna9B05vIHjcM/4ZU2WRR3NbHJAzhtxjnxOg2HVRvE0RRPVhlTy6C86H1bUnaatK 4KKKT7Xeh/Ounx1XenE0PAsWkOYyoLGM/TDJI67SQI3KS1rL7P2I5wycEc26CfOx YzRr8d7UZ0gi0jYXvEFsuNUw/kW59PcBUspGAOfqZ7gmuUafWjsAQeFHBCe6iQ0Z xVR/1O48JqD6neGR8VM6aNhvhSuNzTb5C9APPSAqzut2nJbY29Bj/gtvbodlejUQ neZtHetUCiGwmXiIW0t1xz+w3FPvD1JgwcCVYz4dfznJmZHmz14= =mOV+ -----END PGP SIGNATURE----- --hzrqra7phcm27hy4--