Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2211137pxf; Sat, 20 Mar 2021 07:52:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVXk6moF4pn3MfVgLzaJ5aXs0tMtoGMN9BLlJse3/nJgO0EeBZW+VjsRPr5OiKVVGWOorJ X-Received: by 2002:a17:906:58d6:: with SMTP id e22mr9960384ejs.112.1616251976012; Sat, 20 Mar 2021 07:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616251976; cv=none; d=google.com; s=arc-20160816; b=gSy6/cpGlqOGeehLay8x7y8ywl/5YuwKtKEqnXem6Hqy5UO5+kAfbcRcvVex30yx7J PSIKte5cAPc7luqNRfcBzoDU982i9K1uAmVE/v4Hv8d1DSfZhPzL3lZEnHC24K8/gEQS LXfcefCiczjoWSL9Sjs2soDIqjhowdlN0pEYAbFwbip31EIIQwmisgtEpGAx5rYJdnLv 2ynHBzIwbTh6VcqrnxWzUBIYmVpsXKwlYOz9i5gLhcx8qdoEtoFRi8/QnsKoiSgsp4li wkZXAfIyvFIRgkelZ4lx+GkTbVZHl5P5YAK7cHcl6wcBPXMp/4oAzRPWSWvEy0dDfjaC 3ayA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=GAGXrswmnOnUdwDiOLfJrJeP7ZOTl4An3IJeyKNgZRE=; b=A+9gWDza2Be2uqbTr1625LkbIs3hMHxNi4WLGbfPL9UzkNIAwwj+G65nGu105Fl87q yNk7L1NPj5MGhEv1sk+6J41WIThVlMBxiyC4axTqqGRHKSkKpI2JNsZr7yTer6N4VXdd 1+c5R7bkpp0j4HXhKVZoG4VhKlbFnFEQstZ7VrtsauqxhQvI0ShjE52IQI10X44vzx5I SY56L2QQlCxyyArckRT7hF3IwONXSr2HGhEe1vuHp+ds3gbNYRldwi60VSBF7LheEW0X W4LErdRfQVRysSHMqjKEqns/zdOMvCGNS45s7MXUOnJWoHjtUgbBvjp2gAefth4w9Ewa y3EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pH89CaHH; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x4si7235325edd.118.2021.03.20.07.52.33; Sat, 20 Mar 2021 07:52:56 -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=@gmail.com header.s=20161025 header.b=pH89CaHH; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229596AbhCTOtZ (ORCPT + 99 others); Sat, 20 Mar 2021 10:49:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbhCTOtU (ORCPT ); Sat, 20 Mar 2021 10:49:20 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14614C061574 for ; Sat, 20 Mar 2021 07:49:20 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id y6so14198492eds.1 for ; Sat, 20 Mar 2021 07:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GAGXrswmnOnUdwDiOLfJrJeP7ZOTl4An3IJeyKNgZRE=; b=pH89CaHHrbc4iGJ9YgebaSNzaaZHuMtHVo3kHRSFqMsTem4cqOAC7rNakAdkmc0Jm0 RBxRPRR9fUQsUW8Rqs6ziNpmXSJZLN5n++Sv0YGYbpje04roBEN3CxtqYjObP9YG5yHA xCIxCXiKoe8rMGf5Qc6n+kCCu5IuK/+kM84q3hiK23mR/cNU37hHwcwu4KFpX9QqWhy4 lYZrMNrA6ihm9LE3bDWxxPxDap/69KLdqrE05gZkhxStx3RBF9jV9+19Nc4cvQl+D+jE 73OlBxSIWnC+RPHXx3hKc92Vc/qmGaMcdCulG6hZfUfuv+OlrjBTsriqCg1JURKLWflS tejQ== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GAGXrswmnOnUdwDiOLfJrJeP7ZOTl4An3IJeyKNgZRE=; b=tSJzVYXJH20AXbB3QeGHBCx+pMHb0B4Ab3/cosiGGH7IVAao/o4/+sGKPWqSAXOVlQ QYxSSfeaUVSm6yNlxiYDz8qh1u8qKPyfxfhpGCah5rkLjUK5AXyHTtEHzdN1kJyDGcWA BpoEj9rgFL3Aq2J3zmQ+YlkkuKSJPhpnD1mgucquhn6F584GuHG6ac+EJ1EG+Eb1gTuL urwfawPxhD04x5XIs9xQ6FvHflqWn+iBNQvGxu9j35hjtzw5TNM9v24ywXE0yYnddRQn iUPMbP7GgxMIAjOWvMGGMvDVxxma/MbCHsYESFrpI42y1LNudmH7T2rHP3sVrxiDVJxb 3oBw== X-Gm-Message-State: AOAM530pd47YM+wezsU8+ie2CReG2q/lY4PXHbxGtPw6V6ugcS/8uAfw ajSds7S9Oxx3QuEovWBjcjM= X-Received: by 2002:a05:6402:181a:: with SMTP id g26mr15817626edy.225.1616251758697; Sat, 20 Mar 2021 07:49:18 -0700 (PDT) Received: from agape.jhs ([151.46.159.47]) by smtp.gmail.com with ESMTPSA id r25sm5791860edv.78.2021.03.20.07.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Mar 2021 07:49:18 -0700 (PDT) Date: Sat, 20 Mar 2021 15:49:12 +0100 From: Fabio Aiuto To: Greg KH , joe@perches.com, apw@canonical.com Cc: linux-kernel@vger.kernel.org Subject: Re: CHECKPATCH: missing a warning soon after include files decl -c Message-ID: <20210320144911.GA2999@agape.jhs> References: <20210320105424.GA3698@agape.jhs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 20, 2021 at 11:59:44AM +0100, Greg KH wrote: > 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 that's another issue WARNING: externs should be avoided in .c files #35: FILE: drivers/staging/rtl8723bs/core/rtw_efuse.c:35: +bool CHECK: Lines should not end with a '(' #36: FILE: drivers/staging/rtl8723bs/core/rtw_efuse.c:36: --- but that's what I see in line 35 #define REG_EFUSE_CTRL 0x0030 #define EFUSE_CTRL REG_EFUSE_CTRL /* E-Fuse Control. */ bool<--------------------------------- line 35 Efuse_Read1ByteFromFakeContent( struct adapter *padapter, u16 Offset, u8 *Value); bool Efuse_Read1ByteFromFakeContent( struct adapter *padapter, another one... WARNING: externs should be avoided in .c files #40: FILE: drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:40: +u8 rtw_do_join(struct adapter *padapter); <-------- do I miss something about extern keyword? CHECK: Unnecessary parentheses around padapter->mlmepriv #45: FILE: drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:45: thank you, fabio