Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1016350ybg; Mon, 1 Jun 2020 22:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOTm59LO2ItX1L8765kRBC7ieQrzUhx9RijuDs1LYp9prwFyXo2Ktouww5ONxaLbjOv3Lk X-Received: by 2002:a17:906:5590:: with SMTP id y16mr22944703ejp.228.1591074942991; Mon, 01 Jun 2020 22:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591074942; cv=none; d=google.com; s=arc-20160816; b=DbnolAUtnVrmbPSope7sjJ6m8EkN/3J7VOWD/HR/eqzk5STqoi4LouILPj6ImoUk+9 +qxy5iohPDWyEWGFbkZ1WpLsKBig5vOIOnJ+lrnToj5EHzQyxuyjSOF+H/9qtQyig/XY BT9rX3fYEZdxjg4rp1ttSM6CxovfwpkVZWq43GRjH54o4oNulZS28PVR0gPh5jdTgpFT srFZw20xC48hJoerbdgVnHd82lkbNFvsd7pYfrGDH0KGMkCnr9o3hkaghhugTTQxaQLf D+RhIbGZK5nGYludr7jcOTmAp1Vkk6ozbu0tz4Q6nn7uk933rlCA3aEXVK7BwVPpqptT rp8Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=2SggBOc550YecEM44y/gb1WeEfb7jpKNXqeunSNjFLI=; b=Bl9wRaKdH6wfSyTCuxICogs5+I+la3PJBhDjOXoWErHbe4LQuWEV3pLPupk9SlXBXD N031fL0CDG5WfyLGkaxtM1GyA7MBE28Ojp1XdsQXYF78Mj5XYsROVvFa7duAd3pqye7f 9QCkm35BHu6yHTOGA0gFD3Pm+DFcE7xESYaaY8xB46sE8V/7OqMRVtbTJ4zhob46uIU8 5bbjq9vLy4yMtN58hAoO1Io9q7sqfOoVRkEXB76tW5QbdoYt/lN/BOCf1ybNpY4S7ycf 84ZT+N+oemS7ej8XgaprXe/2BhUeIZpvvkt17JDBLAiaTsmn5IxENbcFw6vQVI0WSUl5 FBYQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si874868edd.58.2020.06.01.22.15.19; Mon, 01 Jun 2020 22:15:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726012AbgFBFLB (ORCPT + 99 others); Tue, 2 Jun 2020 01:11:01 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:29584 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbgFBFLA (ORCPT ); Tue, 2 Jun 2020 01:11:00 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 49bg9X1GFkz9v6fV; Tue, 2 Jun 2020 07:10:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 3ldYUwlK1F5r; Tue, 2 Jun 2020 07:10:56 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 49bg9W6c28z9v6fT; Tue, 2 Jun 2020 07:10:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id EFB0B8B789; Tue, 2 Jun 2020 07:10:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id asvamB4ZYI96; Tue, 2 Jun 2020 07:10:56 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4B2548B77C; Tue, 2 Jun 2020 07:10:56 +0200 (CEST) Subject: Re: [PATCH] hw_breakpoint: Fix build warnings with clang To: Ravi Bangoria , mpe@ellerman.id.au Cc: christophe.leroy@c-s.fr, mikey@neuling.org, apopple@linux.ibm.com, linux-kernel@vger.kernel.org, npiggin@gmail.com, paulus@samba.org, naveen.n.rao@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org References: <20200602041208.128913-1-ravi.bangoria@linux.ibm.com> From: Christophe Leroy Message-ID: <0217bbaf-a831-8aea-3ecd-fa217fca1669@csgroup.eu> Date: Tue, 2 Jun 2020 07:10:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200602041208.128913-1-ravi.bangoria@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 02/06/2020 à 06:12, Ravi Bangoria a écrit : > kbuild test robot reported few build warnings with hw_breakpoint code > when compiled with clang[1]. Fix those. > > [1]: https://lore.kernel.org/linuxppc-dev/202005192233.oi9CjRtA%25lkp@intel.com/ > > Reported-by: kbuild test robot > Signed-off-by: Ravi Bangoria > --- > Note: Prepared on top of powerpc/next. > > arch/powerpc/include/asm/hw_breakpoint.h | 3 --- > include/linux/hw_breakpoint.h | 4 ++++ > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h > index f42a55eb77d2..cb424799da0d 100644 > --- a/arch/powerpc/include/asm/hw_breakpoint.h > +++ b/arch/powerpc/include/asm/hw_breakpoint.h > @@ -70,9 +70,6 @@ extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused, > unsigned long val, void *data); > int arch_install_hw_breakpoint(struct perf_event *bp); > void arch_uninstall_hw_breakpoint(struct perf_event *bp); > -int arch_reserve_bp_slot(struct perf_event *bp); > -void arch_release_bp_slot(struct perf_event *bp); > -void arch_unregister_hw_breakpoint(struct perf_event *bp); > void hw_breakpoint_pmu_read(struct perf_event *bp); > extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk); > > diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h > index 6058c3844a76..521481f0d320 100644 > --- a/include/linux/hw_breakpoint.h > +++ b/include/linux/hw_breakpoint.h > @@ -80,6 +80,10 @@ extern int dbg_reserve_bp_slot(struct perf_event *bp); > extern int dbg_release_bp_slot(struct perf_event *bp); > extern int reserve_bp_slot(struct perf_event *bp); > extern void release_bp_slot(struct perf_event *bp); > +extern int hw_breakpoint_weight(struct perf_event *bp); > +extern int arch_reserve_bp_slot(struct perf_event *bp); > +extern void arch_release_bp_slot(struct perf_event *bp); > +extern void arch_unregister_hw_breakpoint(struct perf_event *bp); Please no new 'extern'. In the old days 'extern' keyword was used, but new code shall not introduce new unnecessary usage of 'extern' keyword. See report from Checkpatch below: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #9: [1]: https://lore.kernel.org/linuxppc-dev/202005192233.oi9CjRtA%25lkp@intel.com/ CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files #40: FILE: include/linux/hw_breakpoint.h:83: +extern int hw_breakpoint_weight(struct perf_event *bp); CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files #41: FILE: include/linux/hw_breakpoint.h:84: +extern int arch_reserve_bp_slot(struct perf_event *bp); CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files #42: FILE: include/linux/hw_breakpoint.h:85: +extern void arch_release_bp_slot(struct perf_event *bp); CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files #43: FILE: include/linux/hw_breakpoint.h:86: +extern void arch_unregister_hw_breakpoint(struct perf_event *bp); total: 0 errors, 1 warnings, 4 checks, 19 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. the.patch has style problems, please review. NOTE: Ignored message types: ARCH_INCLUDE_LINUX BIT_MACRO COMPARISON_TO_NULL DT_SPLIT_BINDING_PATCH EMAIL_SUBJECT FILE_PATH_CHANGES GLOBAL_INITIALISERS LINE_SPACING MULTIPLE_ASSIGNMENTS NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Christophe