Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7654794rwb; Wed, 23 Nov 2022 09:05:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf5tRc8pVPARl/0EYBFWEUuXp8EwTV+VG21uBdiKpbziJ6BXeYkLOR5VG2hovvI7z5o12C/o X-Received: by 2002:a17:90b:1bc3:b0:212:ed58:2825 with SMTP id oa3-20020a17090b1bc300b00212ed582825mr37936020pjb.199.1669223150421; Wed, 23 Nov 2022 09:05:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669223150; cv=none; d=google.com; s=arc-20160816; b=TZS2xkXzWFhhDVYPO/MqwaiplSvq4QF9DNj6OwrW6ZsjPc7LxZGeEpplpb3AfQB3O4 0ef9Ew5ipu6VLtOkP/HeANSNVXR+w22HZ0TpAog3d+yxgsL57FsUBoh5QR4ysJNoIlrU gOwMs3+/Elynr4AyvE1CfG0a5tTrhN2z7daptp5bVTKOst7n+lCSGFqTm2SbHa2pjDPL 0SBGgmRDPphTW6Ps5AezIUOF53e8XK//wPQLw3NdhvjVjBXG0vVh5Et1yLldYv3VBwhz rLmfJb/jyhfiFAN0mB0EE6XT4pRQjNdqos5X/lf5ewLbxrfQdPWY4Yadjv4VpgTEyRNF bItw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=ocNle5svEAfXW7cmp/QTXhOMQIMNm/+sptjua2c54SA=; b=hOXNGoln/R9B5FO0rggmL981HOKi1+lYLw6kU73nJs0vJgJAKiAaxAbeYy9MOjxDLh uZVO1+mYM+Z8Xk4cjvZn54i9MELBnezL4BnCE2MKVfUcW+xPALhlVHWby7QeCj/ivK2n HF9CbLH8XA6s5mh0L2ANlkzTsDOOnb+YMkPKMqAhccLRcqokJR5NLet99zntgW+qDz0e GVZ89wzMFF2B9KaWUfZ8XURdodrRSnKgBdnoLoaiZb6dtiQ6DgyzG+xEShASKWlzKU5Z qFM2rDasE1uMXGfM0VnbeFM5VaeOTIssPJWcaNX+WmYV4s95FEW2Wh9kMvCidfYxVS09 Emsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="BwZ/6py/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a170902e84b00b0018128753b25si3611929plg.271.2022.11.23.09.05.36; Wed, 23 Nov 2022 09:05:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="BwZ/6py/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239135AbiKWQ7M (ORCPT + 88 others); Wed, 23 Nov 2022 11:59:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238060AbiKWQ7K (ORCPT ); Wed, 23 Nov 2022 11:59:10 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B79AB66CA6; Wed, 23 Nov 2022 08:59:08 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 8613060009; Wed, 23 Nov 2022 16:59:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1669222747; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ocNle5svEAfXW7cmp/QTXhOMQIMNm/+sptjua2c54SA=; b=BwZ/6py/00KDo4z2J4uVsGL5bF1dU/Y9qkLDjp0zhlqj5DBhmsT4hq0N5batrHuJWtaBw9 bu1U74/50NDjhFlGFJ1gujiBCwxR0QpFnYA/sHOi1AYrEVqLjlZZ06rnqLEUy0mw3p+WCJ QIP4ZfYPU+67clvVll1t/iRLH7OBc9mq49Bm/ccosWMuC1LQo92VQv3zMdlpfCwIkahg8h iB8fLPmo7ROEfIJpAqeoLupgsgH0TDImjo4LtjvHOhgyOu552uMqTQv8S85BgZUwQ1j3vD zWlrTmTQv/6Zs3IEKcdQKoR/6eqAuJkmX07hjWXjA71xhFlPWVAAjhwGfMFv7Q== Date: Wed, 23 Nov 2022 17:59:00 +0100 From: Miquel Raynal To: Masahiro Yamada Cc: Alexander Lobakin , linux-kbuild@vger.kernel.org, Nicolas Schier , Jens Axboe , Boris Brezillon , Borislav Petkov , Tony Luck , Vladimir Oltean , Alexandre Belloni , Derek Chickles , Ioana Ciornei , Salil Mehta , Sunil Goutham , Grygorii Strashko , Daniel Scally , Hans de Goede , Mark Brown , Andy Shevchenko , NXP Linux Team , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 12/18] mtd: tests: fix object shared between several modules Message-ID: <20221123175900.4e05a0f2@xps-13> In-Reply-To: References: <20221119225650.1044591-1-alobakin@pm.me> <20221119225650.1044591-13-alobakin@pm.me> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, masahiroy@kernel.org wrote on Wed, 23 Nov 2022 22:11:49 +0900: > On Sun, Nov 20, 2022 at 8:08 AM Alexander Lobakin wrote: > > > > mtd_test.o is linked to 8(!) different test modules: > > =20 > > > scripts/Makefile.build:252: ./drivers/mtd/tests/Makefile: mtd_test.o > > > is added to multiple modules: mtd_nandbiterrs mtd_oobtest mtd_pagetest > > > mtd_readtest mtd_speedtest mtd_stresstest mtd_subpagetest mtd_torture= test =20 > > > > Although all of them share one Kconfig option > > (CONFIG_MTD_TESTS), it's better to not link one object file into > > several modules (and/or vmlinux). > > Under certain circumstances, such can lead to the situation fixed by > > commit 637a642f5ca5 ("zstd: Fixing mixed module-builtin objects"). > > In this particular case, there's also no need to duplicate the very > > same object code 8 times. > > > > Convert mtd_test.o to a standalone module which will export its > > functions to the rest. > > > > Fixes: a995c792280d ("mtd: tests: rename sources in order to link a hel= per object") > > Suggested-by: Masahiro Yamada =20 >=20 > IMHO, Reported-by might be a better fit. >=20 >=20 > I think they can become static inline functions in mtd_test.h > (at least, mtdtest_relax() is a static inline there), but I am not sure. >=20 > Please send this to the MTD list, and consult the maintainer(s). TBH I don't really mind. These are test modules that you insert to harden and profile the stack, so whatever makes the robots happy is fine. Anyway, they are being slowly replaced by userspace tools so we might eventually get rid of them. Thanks, Miqu=C3=A8l