Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp115628ybg; Tue, 22 Oct 2019 17:08:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3/1MmK8CN5YRS02+MkKD01j0NcbboZF3K7SgoEAfIgiJYc5v4bcckYglGQ4gpcGsjMNuB X-Received: by 2002:a50:f40c:: with SMTP id r12mr11026277edm.50.1571789336434; Tue, 22 Oct 2019 17:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571789336; cv=none; d=google.com; s=arc-20160816; b=gcnXaENV5P9iziMlW5sQwFritMVJB3pFcZ9fHAoj6Tze5XIEznjBXk+sNOw4DqTCjt nUE65cApelnE4CWHnQvvCL6F0usJasXF1qB3Lh0KyAfgxDKa/8yBKhYJApJXiRlJzkaT ficYqNJ/DCUsnpOyJwmBe1Uj8SNpV85Ap1JRtKRmaMbdXWftp9sYx4wq2uCwjPKrzkO6 XANXoVuNjnFRIi1wfHaQdKGbSiK8c28W75cDY0wmDzpzwGvn62j6EiMkcJj07SXsiVDO Vz2hGpJ5JKpdtcyKruh0vijDqqqg2C1i9CwRFyJKOAMKj4tb4Ngy4WcQUigre5ftPBWK 971A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=zyVBsTyeuK8exQz7uSYQwdsxGdhjYLow8oX5vGt2F/c=; b=1KL0Je2WJchc2yVa7SCYbvmwoss941Cf2PHeNfc28+yM3pld3uVvfqqbPld8qp6anx TUZiMnkSKocvVnvUtbHEkrMdqG6ycOduzPn5PeSoDC7ZGAWA4gzHPXU2tOxZ/9iWTY3w Mn+U1EmxDUAps0lTape3Tb30BhDY9XaajCt5ucyt4URqPhk86RHPTuTgJz+B1rzo9H1m nWmZ1yeE8I2Aap24a6K5C59xjg8vzei2NIGQ+Em3iLc1pEw6evwnMiccX0OPAJ32HwMv pR5RhUEBGg+cv3TN5COqhP2s+8F0hsJ14eMhOY80jl32xswWEVLKdc71TS/cr6kHId1J NiZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=lcXDohfg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q25si6667771ejb.340.2019.10.22.17.08.32; Tue, 22 Oct 2019 17:08:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=lcXDohfg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733115AbfJVW0G (ORCPT + 99 others); Tue, 22 Oct 2019 18:26:06 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37654 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731754AbfJVW0G (ORCPT ); Tue, 22 Oct 2019 18:26:06 -0400 Received: by mail-lj1-f194.google.com with SMTP id l21so18896649lje.4 for ; Tue, 22 Oct 2019 15:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=zyVBsTyeuK8exQz7uSYQwdsxGdhjYLow8oX5vGt2F/c=; b=lcXDohfgOnbx7TXbgUm4VMI+uk3OyUyfK2CRjgW8nUbpj1mYGechfdG73lQX6EqufG a2eCV8+eaW0ZtqTiMH9967z0RKOexKyX24PlFg3uKQBGXwIRAIog2i2aclI5/unG9HE4 iMl/AO5AAc+oDh0AWhnFdJIk6Mi+Fr2PxrW40XVI0Hw0aAyDk0DirtgWbmV7WZe12ep4 bBdZ27K1LD9Pr17nHwA/u526pml3DtsgxPB9SLuugjD51/HwmBVdGk2I/wG7eHQhIDTR Eiqe0K3kmGPRYQb6jJC0ClIlupHA/l+5AzGD7lv2tP8GetLk30BfZsjh7Glwx1UN34oh jPsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=zyVBsTyeuK8exQz7uSYQwdsxGdhjYLow8oX5vGt2F/c=; b=dN09QJ0u2QYIw2NbO1cBKobKmjkgu0Kj4DFD0kRG+sorAHSW/qRP1TdGMJ3N2ONlkv KpmffP2jJaKsrHoYaaXOBq+SRTzEtyR2d0f3Uf5kJdKJDA2CaEe2uWcuVdhzL6mhYGmG cX9z5suFsWaCnEETWd/QrCoJV1I5fin8caYz7wEHGrjD1ash0pvR1iexfVaDFreG8lFZ nHlq2TxX1SDxRXKHgi7ZmybtIn/+HN2hIsVIuQFUqYCPdL3a+fp1IUUxFGlrXX1evPW6 pqTQ8xmFduzZMRNM/vex/b7XYXwj8wBLgHaWUvdZbC4ZliF17LkhKAuOvPEQnMFWXdVw 1xIw== X-Gm-Message-State: APjAAAVa4f4u9VzH5yANHNpo5+NQ8A8aAacBpHbpXtzdd5cbBSAoWFHG Z1gmxnZbFLf3za/3ZWYqVlQgf8gS6n0= X-Received: by 2002:a2e:8544:: with SMTP id u4mr445073ljj.158.1571783162792; Tue, 22 Oct 2019 15:26:02 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id c76sm12184600lfg.11.2019.10.22.15.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 15:26:02 -0700 (PDT) Date: Tue, 22 Oct 2019 15:25:54 -0700 From: Jakub Kicinski To: "Ben Dooks (Codethink)" Cc: linux-kernel@lists.codethink.co.uk, "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: mvneta: make stub functions static inline Message-ID: <20191022152554.251d36ef@cakuba.netronome.com> In-Reply-To: <20191022152205.11815-1-ben.dooks@codethink.co.uk> References: <20191022152205.11815-1-ben.dooks@codethink.co.uk> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Oct 2019 16:22:05 +0100, Ben Dooks (Codethink) wrote: > If the CONFIG_MVNET_BA is not set, then make the stub functions > static inline to avoid trying to export them, and remove hte > following sparse warnings: > > drivers/net/ethernet/marvell/mvneta_bm.h:163:6: warning: symbol 'mvneta_bm_pool_destroy' was not declared. Should it be static? > drivers/net/ethernet/marvell/mvneta_bm.h:165:6: warning: symbol 'mvneta_bm_bufs_free' was not declared. Should it be static? > drivers/net/ethernet/marvell/mvneta_bm.h:167:5: warning: symbol 'mvneta_bm_construct' was not declared. Should it be static? > drivers/net/ethernet/marvell/mvneta_bm.h:168:5: warning: symbol 'mvneta_bm_pool_refill' was not declared. Should it be static? > drivers/net/ethernet/marvell/mvneta_bm.h:170:23: warning: symbol 'mvneta_bm_pool_use' was not declared. Should it be static? > drivers/net/ethernet/marvell/mvneta_bm.h:181:18: warning: symbol 'mvneta_bm_get' was not declared. Should it be static? > drivers/net/ethernet/marvell/mvneta_bm.h:182:6: warning: symbol 'mvneta_bm_put' was not declared. Should it be static? > > Signed-off-by: Ben Dooks (Codethink) Looks like this one will require a bit more work. > drivers/net/ethernet/marvell/mvneta_bm.h | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/mvneta_bm.h b/drivers/net/ethernet/marvell/mvneta_bm.h > index c8425d35c049..9c0c6e20cf80 100644 > --- a/drivers/net/ethernet/marvell/mvneta_bm.h > +++ b/drivers/net/ethernet/marvell/mvneta_bm.h > @@ -160,14 +160,14 @@ static inline u32 mvneta_bm_pool_get_bp(struct mvneta_bm *priv, > (bm_pool->id << MVNETA_BM_POOL_ACCESS_OFFS)); > } > #else > -void mvneta_bm_pool_destroy(struct mvneta_bm *priv, > - struct mvneta_bm_pool *bm_pool, u8 port_map) {} > -void mvneta_bm_bufs_free(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool, > - u8 port_map) {} > -int mvneta_bm_construct(struct hwbm_pool *hwbm_pool, void *buf) { return 0; } > -int mvneta_bm_pool_refill(struct mvneta_bm *priv, > - struct mvneta_bm_pool *bm_pool) {return 0; } > -struct mvneta_bm_pool *mvneta_bm_pool_use(struct mvneta_bm *priv, u8 pool_id, > +static inline void mvneta_bm_pool_destroy(struct mvneta_bm *priv, > + struct mvneta_bm_pool *bm_pool, u8 port_map) {} > +static inline void mvneta_bm_bufs_free(struct mvneta_bm *priv, struct mvneta_bm_pool *bm_pool, > + u8 port_map) {} You're going over 80 characters now. > +static inline int mvneta_bm_construct(struct hwbm_pool *hwbm_pool, void *buf) { return 0; } > +static inline int mvneta_bm_pool_refill(struct mvneta_bm *priv, > + struct mvneta_bm_pool *bm_pool) {return 0; } > +static inline struct mvneta_bm_pool *mvneta_bm_pool_use(struct mvneta_bm *priv, u8 pool_id, > enum mvneta_bm_type type, u8 port_id, > int pkt_size) { return NULL; } The follow up lines need to be adjusted so that they start on the same column as the opening bracket. checkpatch.pl catches those. Please run it with --strict while at it. > @@ -178,7 +178,7 @@ static inline void mvneta_bm_pool_put_bp(struct mvneta_bm *priv, > static inline u32 mvneta_bm_pool_get_bp(struct mvneta_bm *priv, > struct mvneta_bm_pool *bm_pool) > { return 0; } > -struct mvneta_bm *mvneta_bm_get(struct device_node *node) { return NULL; } > -void mvneta_bm_put(struct mvneta_bm *priv) {} > +static inline struct mvneta_bm *mvneta_bm_get(struct device_node *node) { return NULL; } > +static inline void mvneta_bm_put(struct mvneta_bm *priv) {} > #endif /* CONFIG_MVNETA_BM */ > #endif