Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2391165rwb; Sat, 19 Nov 2022 15:15:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf5n+dkAlQXjG2t+MCnGVMQ6I4+0GmaunpKeiuKVN6KfUqbq7VhXNKxlrvY/Ei36URhT4iwX X-Received: by 2002:a17:906:cd07:b0:781:f37a:f50e with SMTP id oz7-20020a170906cd0700b00781f37af50emr10477865ejb.468.1668899725122; Sat, 19 Nov 2022 15:15:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668899725; cv=none; d=google.com; s=arc-20160816; b=ZpDwNIMcCHhcBEb1+IiWAYTooJZ11+HMXDvh8RIzq7KW7CPD4nRyhjBOAaU0QRkIP/ KuxBLAaYfQXFenGOm1ilEjL0ZjrdwczwYpfjQ9QFzDlzP58Aw9AzH+EzORDsezPx6s/m yVUMng6x5JdmOK1wVrYUck20MCmVfgthq+N9oeni2a37DovY2F6bkAVV+sxhlGnP4W5v N7wAztbMSd7nvUazzHEsv3Fz0qTrGq8sg2UiL3UtZ6U0P9d94Na5BaQLEzJGsynOJXrF +0S+GlKU4AFXJzBNYd85LwpxS8PxMcEtehSIi25bNMeJIrG+VV9Be6GCCwMBhAfNpket O4qA== 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 :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=2+sOxC40kt2h/1Sz9kRo5GxpGnAXAGHbxk3TUs+fmSg=; b=mj1ehwsrWzL7HU83QJ0VYuFrIzA5Q1Fth5+bwENvc5Yp/nFhd/bUwqnacRAPizOHKf XnU19oyJMZJ6+AR+68NadBqlqHFK4KfASjsDj1oc3isUCc+Pgwvb6SrNTC8zVCGwzDA7 Nc/RFldEG8EUxW6CvmMJu72uiYMdpkxUv/WkhFARWT3Ejof4OO3PBqXE4eNfrKDrUnDy WXUFFdgKwgd1Mwnc1Lt7BArNI3btbUNNk5g4n4WzIvz+3PsMfSt9HRXnNLE/2KkbLkxS T6XPXJeqZ5BGqSGj2gAuTokIf6L8vxdVQZhrkLnAsa3gehljYb1DTq97lhibzgE2tTkN vDPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail3 header.b=jAjIY4B0; 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=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he39-20020a1709073da700b00783d5a873dcsi7381303ejc.341.2022.11.19.15.15.02; Sat, 19 Nov 2022 15:15:25 -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=@pm.me header.s=protonmail3 header.b=jAjIY4B0; 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=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234739AbiKSXEb (ORCPT + 91 others); Sat, 19 Nov 2022 18:04:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234728AbiKSXE3 (ORCPT ); Sat, 19 Nov 2022 18:04:29 -0500 Received: from mail-40134.protonmail.ch (mail-40134.protonmail.ch [185.70.40.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE78E13D59; Sat, 19 Nov 2022 15:04:27 -0800 (PST) Date: Sat, 19 Nov 2022 23:04:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1668899066; x=1669158266; bh=2+sOxC40kt2h/1Sz9kRo5GxpGnAXAGHbxk3TUs+fmSg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=jAjIY4B0YN1LB7N8qwiwUWlFcsxMt9pRvkXj5uAappI40qAbxYMLRmBS/xbgf6UFg 8GP/4XFuSAiyX34JLKshx8QtDxyhLcwSg8dsUeAKR5DfHzJODZFz1SS7SFpqQWSE92 kQkHtGjvsLiAqMdChUFKvytUa2fSL2QHtyEw3OxIuXIZ6zn3iVDmoDx/5VThDaHwLy U5vkbtRx4Hbwa65avysoi42FPMolv/YzFlQXS86B4CWA/9FQaxRSg3BNwMEp9QINq6 E/CLZ0Sbuqy/cKsHn9Qrqq78W1vpYmSF+x1q3ltCWUp6CgeZTkZAX7neHMpso+F+82 pVYfmgihEegcw== To: linux-kbuild@vger.kernel.org From: Alexander Lobakin Cc: Alexander Lobakin , Masahiro Yamada , 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 , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/18] block/rnbd: fix mixed module-builtin object Message-ID: <20221119225650.1044591-2-alobakin@pm.me> In-Reply-To: <20221119225650.1044591-1-alobakin@pm.me> References: <20221119225650.1044591-1-alobakin@pm.me> Feedback-ID: 22809121:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 From: Masahiro Yamada With CONFIG_BLK_DEV_RNBD_CLIENT=3Dm and CONFIG_BLK_DEV_RNBD_SERVER=3Dy (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. Signed-off-by: Masahiro Yamada Reviewed-and-tested-by: Alexander Lobakin Signed-off-by: Alexander Lobakin --- drivers/block/rnbd/Makefile | 6 ++---- drivers/block/rnbd/rnbd-common.c | 23 ----------------------- drivers/block/rnbd/rnbd-proto.h | 14 +++++++++++++- 3 files changed, 15 insertions(+), 28 deletions(-) delete mode 100644 drivers/block/rnbd/rnbd-common.c diff --git a/drivers/block/rnbd/Makefile b/drivers/block/rnbd/Makefile index 40b31630822c..208e5f865497 100644 --- a/drivers/block/rnbd/Makefile +++ b/drivers/block/rnbd/Makefile @@ -3,13 +3,11 @@ ccflags-y :=3D -I$(srctree)/drivers/infiniband/ulp/rtrs rnbd-client-y :=3D rnbd-clt.o \ -=09=09 rnbd-clt-sysfs.o \ -=09=09 rnbd-common.o +=09=09 rnbd-clt-sysfs.o CFLAGS_rnbd-srv-trace.o =3D -I$(src) -rnbd-server-y :=3D rnbd-common.o \ -=09=09 rnbd-srv.o \ +rnbd-server-y :=3D rnbd-srv.o \ =09=09 rnbd-srv-sysfs.o \ =09=09 rnbd-srv-trace.o diff --git a/drivers/block/rnbd/rnbd-common.c b/drivers/block/rnbd/rnbd-com= mon.c deleted file mode 100644 index 596c3f732403..000000000000 --- a/drivers/block/rnbd/rnbd-common.c +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * RDMA Network Block Driver - * - * Copyright (c) 2014 - 2018 ProfitBricks GmbH. All rights reserved. - * Copyright (c) 2018 - 2019 1&1 IONOS Cloud GmbH. All rights reserved. - * Copyright (c) 2019 - 2020 1&1 IONOS SE. All rights reserved. - */ -#include "rnbd-proto.h" - -const char *rnbd_access_mode_str(enum rnbd_access_mode mode) -{ -=09switch (mode) { -=09case RNBD_ACCESS_RO: -=09=09return "ro"; -=09case RNBD_ACCESS_RW: -=09=09return "rw"; -=09case RNBD_ACCESS_MIGRATION: -=09=09return "migration"; -=09default: -=09=09return "unknown"; -=09} -} diff --git a/drivers/block/rnbd/rnbd-proto.h b/drivers/block/rnbd/rnbd-prot= o.h index ea7ac8bca63c..1849e7039fa1 100644 --- a/drivers/block/rnbd/rnbd-proto.h +++ b/drivers/block/rnbd/rnbd-proto.h @@ -300,6 +300,18 @@ static inline u32 rq_to_rnbd_flags(struct request *rq) =09return rnbd_opf; } -const char *rnbd_access_mode_str(enum rnbd_access_mode mode); +static inline const char *rnbd_access_mode_str(enum rnbd_access_mode mode) +{ +=09switch (mode) { +=09case RNBD_ACCESS_RO: +=09=09return "ro"; +=09case RNBD_ACCESS_RW: +=09=09return "rw"; +=09case RNBD_ACCESS_MIGRATION: +=09=09return "migration"; +=09default: +=09=09return "unknown"; +=09} +} #endif /* RNBD_PROTO_H */ -- 2.38.1