Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5009687ybv; Wed, 26 Feb 2020 06:55:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyqAkdpp/suRuWCmeLvYOa/p0mCTv970oai+LCLQp+/EZ4YhkmnwU7ts1hVs9e/b5O2kJqk X-Received: by 2002:aca:be09:: with SMTP id o9mr3514807oif.177.1582728932753; Wed, 26 Feb 2020 06:55:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582728932; cv=none; d=google.com; s=arc-20160816; b=adZIZInr1sJ3VXLj3j9zhPT8vnbhBt2xDCvkj+0ACT6QmmOJmpnFilxo6D2PTpAic7 wfFIwd4MPDruPbToDsLGMRsw2O5A1lrhxIEtU1B0djHEjdLfH8J8XC0eGHUPOZyRyfHX 3ZEurwP56wga2ZOwBkswNTWy7llBUK16rod43G1qqB1QTqJdiflgfWwDL4T8vXYBgnUi ih27cDi5cQvzEYfwju4kecCGLgs93rR/cSNnWplT5d7aafqT4TLyd9iiTj9/gX0sTDxe qqzXOB3cw528aq0UHdQczrB9XbKTJdH01LghCdd2gozXpybUpzoac078g/nQa39q00YU Up2A== 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:user-agent :in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:dkim-signature; bh=D9ZIih3G83c2i8VjB34cEpnw8W+3tjJJo3awnznjfu8=; b=mqRlpZXmyqyL0ZPe4o13L2Hn5F9inFI+bATUw+kqnKuW9D9LwjkHoR+zTEfUWdGjKG eDzWSZAqcYwb8ODfrFG0vmsGJ/NPtATDJZQSM2jmsXIQ8S4EobY/upI9GRU8JFXPxWjI dtIx/4FpoKi7uqAt6Fa7CstOWRTCIo3mj9QZPdxOSdJgMCe1KGp0hEHVvpiEH8dfBwk2 RRO0Omri04zN7k/58WSl9cW7uePCxcWJGWtGzPBdvrlAryJrApJcWpqGFqMAG05Vog5F xPeEE/axi6FSL7PK3vf65ya/5HGxmqlYdrvZzSPLFZnTasn/sPybGpeoVyxukHNeO1Ib QkZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hN5Ggb6L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si1430852otq.315.2020.02.26.06.55.19; Wed, 26 Feb 2020 06:55:32 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=hN5Ggb6L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726366AbgBZOyz (ORCPT + 99 others); Wed, 26 Feb 2020 09:54:55 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:35794 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726063AbgBZOyy (ORCPT ); Wed, 26 Feb 2020 09:54:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582728892; 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=D9ZIih3G83c2i8VjB34cEpnw8W+3tjJJo3awnznjfu8=; b=hN5Ggb6LERT6UZP8o+qCStp/QFWrd2doSdK3XRHrJPO+w5svXM+EK/QMgsj6O81xcmB/E0 jdHE6TP4zBlZ6EOi8RItnSpWqWbDHngbNmDtuHeNu/4djEcUZMlKtwh7Wk+XLs+uQvD8uG 322gt2AuK9hl8S7w+TWo34mvG/fQ47g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-kpeZS8rrMSiqNG-KzLcfbA-1; Wed, 26 Feb 2020 09:54:46 -0500 X-MC-Unique: kpeZS8rrMSiqNG-KzLcfbA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E4288DB20; Wed, 26 Feb 2020 14:54:41 +0000 (UTC) Received: from localhost (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9FF585D9CD; Wed, 26 Feb 2020 14:54:40 +0000 (UTC) Date: Wed, 26 Feb 2020 22:54:37 +0800 From: 'Baoquan He' To: Greg Kurz Cc: Alastair D'Silva , 'Alastair D'Silva' , "'Aneesh Kumar K . V'" , 'Oliver O'Halloran' , 'Benjamin Herrenschmidt' , 'Paul Mackerras' , 'Michael Ellerman' , 'Frederic Barrat' , 'Andrew Donnellan' , 'Arnd Bergmann' , 'Greg Kroah-Hartman' , 'Dan Williams' , 'Vishal Verma' , 'Dave Jiang' , 'Ira Weiny' , 'Andrew Morton' , 'Mauro Carvalho Chehab' , "'David S. Miller'" , 'Rob Herring' , 'Anton Blanchard' , 'Krzysztof Kozlowski' , 'Mahesh Salgaonkar' , 'Madhavan Srinivasan' , =?iso-8859-1?Q?'C=E9dric?= Le Goater' , 'Anju T Sudhakar' , 'Hari Bathini' , 'Thomas Gleixner' , 'Nicholas Piggin' , 'Masahiro Yamada' , 'Alexey Kardashevskiy' , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-nvdimm@lists.01.org, linux-mm@kvack.org Subject: Re: [PATCH v3 04/27] ocxl: Remove unnecessary externs Message-ID: <20200226145437.GJ4937@MiWiFi-R3L-srv> References: <20200221032720.33893-1-alastair@au1.ibm.com> <20200221032720.33893-5-alastair@au1.ibm.com> <20200226081447.GH4937@MiWiFi-R3L-srv> <4d49801d5ec7e$7a3e8610$6ebb9230$@d-silva.org> <20200226100102.0aab7dda@bahia.home> <20200226141523.GI4937@MiWiFi-R3L-srv> <20200226152050.45547219@bahia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20200226152050.45547219@bahia.home> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/26/20 at 03:20pm, Greg Kurz wrote: > On Wed, 26 Feb 2020 22:15:23 +0800 > 'Baoquan He' wrote: >=20 > > On 02/26/20 at 10:01am, Greg Kurz wrote: > > > On Wed, 26 Feb 2020 19:26:34 +1100 > > > "Alastair D'Silva" wrote: > > >=20 > > > > > -----Original Message----- > > > > > From: Baoquan He > > > > > Sent: Wednesday, 26 February 2020 7:15 PM > > > > > To: Alastair D'Silva > > > > > Cc: alastair@d-silva.org; Aneesh Kumar K . V > > > > > ; Oliver O'Halloran ; > > > > > Benjamin Herrenschmidt ; Paul Mackerr= as > > > > > ; Michael Ellerman ; Fred= eric > > > > > Barrat ; Andrew Donnellan ; > > > > > Arnd Bergmann ; Greg Kroah-Hartman > > > > > ; Dan Williams ; > > > > > Vishal Verma ; Dave Jiang > > > > > ; Ira Weiny ; Andrew= Morton > > > > > ; Mauro Carvalho Chehab > > > > > ; David S. Miller ; > > > > > Rob Herring ; Anton Blanchard ; > > > > > Krzysztof Kozlowski ; Mahesh Salgaonkar > > > > > ; Madhavan Srinivasan > > > > > ; C=E9dric Le Goater ; = Anju T > > > > > Sudhakar ; Hari Bathini > > > > > ; Thomas Gleixner ;= Greg > > > > > Kurz ; Nicholas Piggin ; Mas= ahiro > > > > > Yamada ; Alexey Kardashevskiy > > > > > ; linux-kernel@vger.kernel.org; linuxppc- > > > > > dev@lists.ozlabs.org; linux-nvdimm@lists.01.org; linux-mm@kvack= .org > > > > > Subject: Re: [PATCH v3 04/27] ocxl: Remove unnecessary externs > > > > >=20 > > > > > On 02/21/20 at 02:26pm, Alastair D'Silva wrote: > > > > > > From: Alastair D'Silva > > > > > > > > > > > > Function declarations don't need externs, remove the existing= ones so > > > > > > they are consistent with newer code > > > > > > > > > > > > Signed-off-by: Alastair D'Silva > > > > > > --- > > > > > > arch/powerpc/include/asm/pnv-ocxl.h | 32 ++++++++++++++-----= ---------- > > > > > > include/misc/ocxl.h | 6 +++--- > > > > > > 2 files changed, 18 insertions(+), 20 deletions(-) > > > > > > > > > > > > diff --git a/arch/powerpc/include/asm/pnv-ocxl.h > > > > > > b/arch/powerpc/include/asm/pnv-ocxl.h > > > > > > index 0b2a6707e555..b23c99bc0c84 100644 > > > > > > --- a/arch/powerpc/include/asm/pnv-ocxl.h > > > > > > +++ b/arch/powerpc/include/asm/pnv-ocxl.h > > > > > > @@ -9,29 +9,27 @@ > > > > > > #define PNV_OCXL_TL_BITS_PER_RATE 4 > > > > > > #define PNV_OCXL_TL_RATE_BUF_SIZE > > > > > ((PNV_OCXL_TL_MAX_TEMPLATE+1) * PNV_OCXL_TL_BITS_PER_RATE / 8) > > > > > > > > > > > > -extern int pnv_ocxl_get_actag(struct pci_dev *dev, u16 *base= , u16 > > > > > *enabled, > > > > > > - u16 *supported); > > > > >=20 > > > > > It works w or w/o extern when declare functions. Searching 'ext= ern' > > > > > under include can find so many functions with 'extern' adding. = Do we have > > > > a > > > > > explicit standard if we should add or remove 'exter' in functio= n > > > > declaration? > > > > >=20 > > > > > I have no objection to this patch, just want to make clear so t= hat I can > > > > handle > > > > > it w/o confusion. > > > > >=20 > > > > > Thanks > > > > > Baoquan > > > > >=20 > > > >=20 > > > > For the OpenCAPI driver, we have settled on not having 'extern' o= n > > > > functions. > > > >=20 > > > > I don't think I've seen a standard that supports or refutes this,= but it > > > > does not value add. > > > >=20 > > >=20 > > > FWIW this is a warning condition for checkpatch: > > >=20 > > > $ ./scripts/checkpatch.pl --strict -f include/misc/ocxl.h > >=20 > > Good to know, thanks. > >=20 > > I didn't know checkpatch.pl can run on header file directly. Tried to > > check patch with '--strict -f', the below info doesn't appear. But it >=20 > Hmm... -f is to check a source file, not a patch... What did you try > exactly ? OK, that's it. I can see the 'CHECK' line when run checkpatch.pl on patch with '--strict' only. I think this can be a good reason that we should not add extern when add function declaration into header file. Thanks. >=20 > > does give out below information when run on header file. > >=20 > > >=20 > > > [...] > > >=20 > > > CHECK: extern prototypes should be avoided in .h files > > > #176: FILE: include/misc/ocxl.h:176: > > > +extern int ocxl_afu_irq_alloc(struct ocxl_context *ctx, int *irq_i= d); > > >=20 > > > [...] > > >=20 > >=20 >=20 >=20