Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2090833pxf; Sat, 20 Mar 2021 04:18:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdqIGAFJpONcLQtm8aPbMGv5RDOQWkFLbUI1BlpzouOHt4At9/s/olEheqxZELY63LCdgZ X-Received: by 2002:a17:907:e88:: with SMTP id ho8mr9503413ejc.199.1616239096902; Sat, 20 Mar 2021 04:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616239096; cv=none; d=google.com; s=arc-20160816; b=Y5A+HF8MFKo1BqMjdGRiLbz5cf/uOrfKpbacYSpEahDix2mOkGtmAjb7jJercEXZ4p e9/URnCy3dIUu5ez1l7GqfqRPpmbE6QO9j5CAPAeI6Rv6h9B5BAiNH6QFdSn793gTgAB 5oBxZ6NzRZkfg5lx0etnNawzLN5I+rLVohHkIYip2jg0i0ikLpuTYwFB70jO9gAUAgSt PIpc+C+N9ilGvBw46x3pTEOnSMni3RKKSv2vrUyqMEbWW7mfV1XMD5zNM9qpraqv75V8 +2dLDFdoEhq3we7m0EjNxtQggQFjy56MjlTraFrBbYx9bWSflHStqMRqNOOchnwK1mzj uoaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/6IPbePhY4+4hz4+dv4Bdz36i7Gzcf7M0wySkAnsw1o=; b=pvBQyoI2MRoyW11SkdGYeY7IDETOHwA5uZgssRWERy3c4+u/ynndNK0rGv9ixn7OUI BArvnnxz2FWkrS7sdMyL/SOYo16Qxz+weg6xPYbRApd4oxt4riehNA48WKMXFT7itM6Y YhNb3sMqceiD/UPsaGg17Z1IEmC+DH4DGD9WSwkTLXkJATRmVOODQ27kKpaeK2btwYdw Mq3yzI9jmOIJIUUgjFvVYaQDmdHCD07W2THQ1A/LD6PJsNYNLibSJTAL3snK7rU3OJkL rac2h58mS7v/mrinI+iptNJsMF68VEykFCo2qw6FsBGqCyJLQZM1eLm8qJ8r3kTxi8ZO jSsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=F4FLz7mu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si6283095edw.487.2021.03.20.04.17.54; Sat, 20 Mar 2021 04:18:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=F4FLz7mu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230525AbhCTLMw (ORCPT + 99 others); Sat, 20 Mar 2021 07:12:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:52724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229979AbhCTLML (ORCPT ); Sat, 20 Mar 2021 07:12:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A295A61946; Sat, 20 Mar 2021 10:59:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616237987; bh=p31KwVKXtkgcsWMN/om5slcfa/J6I7QJUjp4ye8tGYw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F4FLz7muZWDs+zx732Q8vD/ghPIqu2kqAY7ofZYckJlnhlHdcN03PqI8eYU+xFYdS gPzB0zbJovJyGJNpr7ECMlkLoykC2TgcJ4zdVe51RLdgfJZ1690bdVkiKacO/G6n2p A40yvHvtzYdediG0L9UlFUvDvFXQ+jX+xvn+t4BY= Date: Sat, 20 Mar 2021 11:59:44 +0100 From: Greg KH To: Fabio Aiuto Cc: linux-kernel@vger.kernel.org, apw@canonical.com, joe@perches.com Subject: Re: CHECKPATCH: missing a warning soon after include files decl -c Message-ID: References: <20210320105424.GA3698@agape.jhs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210320105424.GA3698@agape.jhs> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 20, 2021 at 11:54:24AM +0100, Fabio Aiuto wrote: > Hi, > > here's an issue in checkpatch.pl > > $ perl script/checkpatch.pl -f drivers/staging/rtl8723bs/core/rtw_ap.c > > I get three warning related to an extern declaration > > WARNING: externs should be avoided in .c files > #14: FILE: drivers/staging/rtl8723bs/core/rtw_ap.c:14: > +extern unsigned char WMM_OUI[]; > -- > WARNING: externs should be avoided in .c files > #15: FILE: drivers/staging/rtl8723bs/core/rtw_ap.c:15: > +extern unsigned char WPS_OUI[]; > -- > WARNING: externs should be avoided in .c files > #16: FILE: drivers/staging/rtl8723bs/core/rtw_ap.c:16: > +extern unsigned char P2P_OUI[]; > ---------------------- > > but the file checked has 4 extern declaration: > ----------------------------- > #define _RTW_AP_C_ > > #include > #include > #include > > extern unsigned char RTW_WPA_OUI[]; > extern unsigned char WMM_OUI[]; > extern unsigned char WPS_OUI[]; > extern unsigned char P2P_OUI[]; > > void init_mlme_ap_info(struct adapter *padapter) > ------------------------------- > > If I add a ';' this way: > ---------------------------- > #define _RTW_AP_C_ > > #include > #include > #include > ; > extern unsigned char RTW_WPA_OUI[]; > extern unsigned char WMM_OUI[]; > extern unsigned char WPS_OUI[]; > extern unsigned char P2P_OUI[]; > > void init_mlme_ap_info(struct adapter *padapter) > -------------------------------- Wait, why would you do the above? Don't try to trick a perl script that has a hard time parsing C files, try to resolve the original issue here. And that is that the above definitions should be in a .h file somewhere. If you make that move then all should be fine. thanks, greg k-h