Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1241048rwb; Tue, 29 Nov 2022 10:42:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf6iTfEqpzIsOj2WGrcWsuppNdEOuzKjtsZVb3nuCGurLepvm1YQbjlwHSUQ9UJBHkkPQycz X-Received: by 2002:a17:902:b101:b0:188:abb9:288 with SMTP id q1-20020a170902b10100b00188abb90288mr40264776plr.123.1669747367416; Tue, 29 Nov 2022 10:42:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669747367; cv=none; d=google.com; s=arc-20160816; b=c/IR5Oa1h6GUAXJfwwDYyNeTiCbWW1gm652bZKzbCga/VnQjo05Z25+6/SxvqV6f7L TXTCh9JofJi77SRbQuz1myR505hYiV2Ca6IB1Lbu+DzmjNNU9RO+We6kC+5qyC8sbcDf mBo1xwoUuqeH0egWiEVxqt5Gqp/kxQGFrbOf5KX4ZrKlOVZNic9CvL4XacIW3jTgHe89 k6Mf1LtcBOOnTi9Aenwk5vC3ih1mUluMNshnB3FTMQ4sFQK4gX371bITAGxFs6QrWzEj 45hWwFnOMT5brfcCTAIpryoEEu/3V0Thr9uufFpix6w0YbtrS+05bNSA2QraJJyb8ld1 Y38g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ofMM1FHrj8VajyNy27mGe2ShSZNNvZ2bILHbYWk3VJQ=; b=MRbNIK62mGlPG0EyBBvz+iJqtT8kPds8qDRxU2iIx5M1EUTCJ69+MQ8o29P4MUiftj FqKKruw9Jz5Cq5t35S1wnd9dlP9ZijeN2wihYwNe6I9ZjLwz+PaoXswHu/W3s9u19Nv0 36xDbdEmJ+l2kCQEHoD5TQTDMwOrM+KpW1DefpLPwizAa1QWIOF85u00N4LNxehJZCXm u7ns//m3srSJlT9nEMFJSRPAkcvOrJW1FctrlDWj073yDH+OrYRJMEq1HQnIYADuqh2S Ui4Q2ivYJyc7Aa01znlnAmnD6H3b3HJ+HYkWJ4HWK4ClQxkbShdSbyTTgbXj0rJO9ReX F9bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=djwnf6jE; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d8-20020a630e08000000b0046eca85c48dsi14942913pgl.110.2022.11.29.10.42.36; Tue, 29 Nov 2022 10:42:47 -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=@ti.com header.s=ti-com-17Q1 header.b=djwnf6jE; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233312AbiK2SZu (ORCPT + 84 others); Tue, 29 Nov 2022 13:25:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230410AbiK2SZr (ORCPT ); Tue, 29 Nov 2022 13:25:47 -0500 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E58885F85E; Tue, 29 Nov 2022 10:25:45 -0800 (PST) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2ATIOwuG005450; Tue, 29 Nov 2022 12:24:58 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1669746299; bh=ofMM1FHrj8VajyNy27mGe2ShSZNNvZ2bILHbYWk3VJQ=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=djwnf6jE3TwlGYj1RIbw9GX7+4f3x78hY1Mvzg0UKLTW5+V970/q5OXrbSd6AIhL9 yAI3A2MbEZsEb+L4GX4j6yomYq3CMSQmEJ2mxJKWpZkgwo//KGkfEXhWzZ6g7+/xiq 4nT/8oIbh4X/qE+phQyt4Fuub84oK1EHybTAJaMM= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2ATIOwkr018566 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 29 Nov 2022 12:24:58 -0600 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 29 Nov 2022 12:24:58 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 29 Nov 2022 12:24:58 -0600 Received: from [10.250.38.44] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2ATIOvbE020258; Tue, 29 Nov 2022 12:24:57 -0600 Message-ID: <922413d0-c566-7765-f374-6f64d94f39aa@ti.com> Date: Tue, 29 Nov 2022 12:24:56 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 01/18] block/rnbd: fix mixed module-builtin object Content-Language: en-US To: Masahiro Yamada CC: Alexander Lobakin , , Nicolas Schier , Jens Axboe , "Boris Brezillon" , Borislav Petkov , Tony Luck , Miquel Raynal , "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 , , References: <20221119225650.1044591-1-alobakin@pm.me> <20221119225650.1044591-2-alobakin@pm.me> <68ceddec-7af9-983d-c8be-7e0dc109df88@ti.com> From: Andrew Davis In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 On 11/21/22 11:59 PM, Masahiro Yamada wrote: > On Tue, Nov 22, 2022 at 6:18 AM Andrew Davis wrote: >> >> On 11/19/22 5:04 PM, Alexander Lobakin wrote: >>> From: Masahiro Yamada >>> >>> With CONFIG_BLK_DEV_RNBD_CLIENT=m and CONFIG_BLK_DEV_RNBD_SERVER=y >>> (or vice versa), rnbd-common.o is linked to a module and also to >>> vmlinux even though CFLAGS are different between builtins and modules. >>> >>> This is the same situation as fixed by commit 637a642f5ca5 ("zstd: >>> Fixing mixed module-builtin objects"). >>> >>> Turn rnbd_access_mode_str() into an inline function. >>> >> >> Why inline? All you should need is "static" to keep these internal to >> each compilation unit. Inline also bloats the object files when the >> function is called from multiple places. Let the compiler decide when >> to inline. >> >> Andrew > > > Since it is a header file. > > > In header files, "static inline" should be always used. > Never "static". > My comment was more "why"? > > If a header is included from a C file and there is a function > that is not used from that C file, > "static" would emit -Wunused-function warning > (-Wunused-function is enabled by -Wall, which is the case > for the kernel build). > > Inline still hints to the compiler to inline, causing unneeded object size bloat. Using "inline" to signal something else (that the function may be unused) when we already have a flag for that (__maybe_unused) feels wrong. Seems this was already debated way back in 2006.. So maybe not worth revisiting today, but still a cleanup that could be good to think more about later. Andrew