lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <a8d9c382-7cdc-4775-b921-251c90819a29@zhaoxin.com>
Date: Thu, 30 May 2024 11:33:39 +0800
From: Hans Hu <HansHu-oc@...oxin.com>
To: <arnd@...nel.org>, <andi.shyti@...nel.org>,
	<wsa+renesas@...g-engineering.com>
CC: <wentong.wu@...el.com>, <linux-i2c@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
	<hanshu@...oxin.com>
Subject: [PATCH] i2c: viai2c: turn common code into a proper module

Hi Arnd,


> From: Arnd Bergmann <arnd@...db.de>
>
> 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 configuration, which results in a warning:
>
> scripts/Makefile.build:236: drivers/i2c/busses/Makefile: i2c-viai2c-common.o is added to multiple modules: i2c-wmt i2c-zhaoxin
>
> The other problems with this include the incorrect use of a __weak function when both are built-in, and the fact that the "common" module is sprinked with 'if (i2c->plat == ...)' checks that have knowledge about the differences between the drivers using it.
>
> 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.
>
> This adds a little more duplication between the two main drivers, but those versions get more readable in the process.
>
> Fixes: a06b80e83011 ("i2c: add zhaoxin i2c controller driver")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>   drivers/i2c/busses/Makefile             |   6 +-
>   drivers/i2c/busses/i2c-viai2c-common.c  |  71 ++-------------
>   drivers/i2c/busses/i2c-viai2c-common.h  |   2 +-
>   drivers/i2c/busses/i2c-viai2c-wmt.c     |  37 ++++++++
>   drivers/i2c/busses/i2c-viai2c-zhaoxin.c | 113 +++++++++++++++++++-----
>   5 files changed, 140 insertions(+), 89 deletions(-)


I tested this patch and it works fine, so I am OK with it.


Hans


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ