Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1303456imu; Fri, 9 Nov 2018 14:18:51 -0800 (PST) X-Google-Smtp-Source: AJdET5d7ROhYD1IEGHArEXgp0VKkYf3pzfqHixAtAsa+12Gds9kjxn99Yl3m+bJ+quz19MKowqI+ X-Received: by 2002:a65:620f:: with SMTP id d15-v6mr9394543pgv.120.1541801931610; Fri, 09 Nov 2018 14:18:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541801931; cv=none; d=google.com; s=arc-20160816; b=lgPbWCNZOYz9nSsEZmKLUsqw9yExfGVtg+Mu0hZDEABaER15SSBe03cPYmhA2c5Q64 J47HX7qMoVzv6WnjvcHDvt2PP97M0XV9kHiBra4O4dYsrRdSWgv5tXC8qCEG3PEx4RVa kHH+4iR+uI3wFJobv7C3bbubDcdfn0d2xxB5/pK6uZce9KDCc5xUd2Fe8p+a93W17wS2 wkhrmMtNi7NgU8pXz+Ka0dk+v680LSf2tprD3NayFMhF0WgF+eJsmpc/C7yr6LkSXrsW 4+NqsyJCdPGgOZZ1gU5431fEwzXUlTSgQOrgN0HrXuVFH7I7FvKt+K4gu5ix8T2lR4UC nkcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=B4W9KlymBHtIegllxA5CaVWcWC0Sh21nPtFia90RDiY=; b=qa1g9WeVE9AOtv5KqCXqZK5fIfGJoWft4nQRbuetCt7RZCsX2BfqA84JpcKMWkOWxz YXc9HkB76LN/AOOURq0sm+uW12cPL6A/lFA7nphbjtmlxM90PxoEmzyemPqpAMsIbZCT QFdN2Zq4Cext93Rpf2qEF/PdPUwWR5vMFWqKZoIe1PkOjazWGoxur8igUrXKtMQnp8hR KWJs3dMJSCa5jIHzhoTV+lSW8nqzA8EAgasPt45jbkXm0z+QFMNQ2JL5I2YLgjySJ1H7 yJP1u4Qxw3s2LMN/LQ2UAdrUTRsLCCW+X8coXp+4GHpP273sMlmy9eqlIjy69NvLTlOh 9Scw== ARC-Authentication-Results: i=1; mx.google.com; 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 y12-v6si7474814pgg.158.2018.11.09.14.18.34; Fri, 09 Nov 2018 14:18:51 -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; 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 S1728147AbeKJIAk (ORCPT + 99 others); Sat, 10 Nov 2018 03:00:40 -0500 Received: from mail.skyhub.de ([5.9.137.197]:53376 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726181AbeKJIAk (ORCPT ); Sat, 10 Nov 2018 03:00:40 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id KMeVoO7jLcQp; Fri, 9 Nov 2018 23:18:05 +0100 (CET) Received: from zn.tnic (p200300EC2BD03D00329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2bd0:3d00:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B04631EC02A3; Fri, 9 Nov 2018 23:18:04 +0100 (CET) Date: Fri, 9 Nov 2018 23:17:50 +0100 From: Borislav Petkov To: Michael Matz , Thomas Gleixner Cc: Yi Wang , mingo@redhat.com, hpa@zytor.com, x86@kernel.org, suravee.suthikulpanit@amd.com, puwen@hygon.cn, davidwang@zhaoxin.com, linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn Subject: Re: [PATCH v2] x86/cpu: fix prototype warning Message-ID: <20181109221750.GA4971@zn.tnic> References: <1541639548-11149-1-git-send-email-wang.yi59@zte.com.cn> <20181108150318.GD7543@zn.tnic> <20181108153226.GF7543@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 08, 2018 at 03:47:32PM +0000, Michael Matz wrote: > What tglx said. If you don't intend such functions to be called > from other units make them static, if you do intend them to be callable > declare the properly. Well, I'll be damned! That just caught two bugs, the smp_thermal_interrupt() is *exactly* what the warning is supposed to catch - functions with changed prototype! --- From: Borislav Petkov Date: Fri, 9 Nov 2018 23:13:13 +0100 Subject: [PATCH] x86/mce: Fix -Wmissing-prototypes warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the proper includes and make smca_get_name() static. Fix an actual bug too which the warning triggered: arch/x86/kernel/cpu/mcheck/therm_throt.c:395:39: error: conflicting \ types for ‘smp_thermal_interrupt’ asmlinkage __visible void __irq_entry smp_thermal_interrupt(struct pt_regs *r) ^~~~~~~~~~~~~~~~~~~~~ In file included from arch/x86/kernel/cpu/mcheck/therm_throt.c:29: ./arch/x86/include/asm/traps.h:107:17: note: previous declaration of \ ‘smp_thermal_interrupt’ was here asmlinkage void smp_thermal_interrupt(void); Signed-off-by: Borislav Petkov --- arch/x86/kernel/cpu/mcheck/mce_amd.c | 3 ++- arch/x86/kernel/cpu/mcheck/therm_throt.c | 3 ++- arch/x86/kernel/cpu/mcheck/threshold.c | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index dd33c357548f..87499b997039 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -99,7 +100,7 @@ static u32 smca_bank_addrs[MAX_NR_BANKS][NR_BLOCKS] __ro_after_init = [0 ... MAX_NR_BANKS - 1] = { [0 ... NR_BLOCKS - 1] = -1 } }; -const char *smca_get_name(enum smca_bank_types t) +static const char *smca_get_name(enum smca_bank_types t) { if (t >= N_SMCA_BANK_TYPES) return NULL; diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index 0d3f6b6a5739..70a05de7ea59 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -391,7 +392,7 @@ static void unexpected_thermal_interrupt(void) static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt; -asmlinkage __visible void __irq_entry smp_thermal_interrupt(struct pt_regs *r) +asmlinkage __visible void __irq_entry smp_thermal_interrupt(void) { entering_irq(); trace_thermal_apic_entry(THERMAL_APIC_VECTOR); diff --git a/arch/x86/kernel/cpu/mcheck/threshold.c b/arch/x86/kernel/cpu/mcheck/threshold.c index 2b584b319eff..b0c60beb6312 100644 --- a/arch/x86/kernel/cpu/mcheck/threshold.c +++ b/arch/x86/kernel/cpu/mcheck/threshold.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include -- 2.19.1 -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.