Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp249069imu; Thu, 8 Nov 2018 07:48:38 -0800 (PST) X-Google-Smtp-Source: AJdET5cWIuJwUJaI08U8rCqO+XCkVfABGjnluJDGiLMz25xbkqmA4y+2JAEII2ouO1ZILxaqTmn/ X-Received: by 2002:a17:902:7d98:: with SMTP id a24-v6mr5036085plm.271.1541692117932; Thu, 08 Nov 2018 07:48:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541692117; cv=none; d=google.com; s=arc-20160816; b=uTWho4kgW9tdRYjPeM6DURMte6T4mei7umFD/ZVY4ohhgP/fElaQanVGGisLgLzZfw 5e19I+mgAAwuWyCXDLroF30iT8fvtmIb9wxSkMcgtysAXNl2Tva0cnfalcMf9BnwlRG3 fDz4Ku6Boswv/6J4nPgRTCWD8pwzx777s9c0IewqWCbpW7+bl3P7iYk5BjUatc0IaWSh jHHhe5eUsDvbD2kD/S8sSUZImPd6dx4+ES5XTNlzw8eWSA8A6KqrXVG/Q8IPz4HyvTcR Tj/U5UT7n0R+FIdhP0tr99PmBFeFZ/Y4BvOItXhvOpjqrxUMMsg8+OnvBrC5R8hVvQe4 kd9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=n2KsMoS+P99o1zXw915Vpm1ZQnq3N5rnlyhyauoW8Xg=; b=v5L6e7I2EYlSdFmRwxRGnj7Nnyn01c0VlTjB5jMouJQDTd9U2hhqCMsqP5+gOg/eka yZhZrGH8NTyYzGFbmHRXeUR1gm1+P0aJOLsuuNOVGG1fR/BPbRGuzLFHwOZIxeYLWZLQ xcaJtkF9HKBms5rwdSEw6zJKhzbvD3wt1SqauPU88VDt0FM2KpZcNNHOtNqUoeML16XK eDZl4hKkYO75IFvdZiMV5kLxU2o9LmV/lSYk6RfnIOyK0rVL9kHaM+Je/mzreKGft3Tw 4qRQNoZLkcbn/fvx8V/VnczF/+AmvEgb9bPnUy9jFVnBIIU7xXZYPlHs2c6NWiaPVGTo uODw== 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 u11-v6si3802881pgh.55.2018.11.08.07.48.21; Thu, 08 Nov 2018 07:48:37 -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 S1727378AbeKIBXm (ORCPT + 99 others); Thu, 8 Nov 2018 20:23:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:36856 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726595AbeKIBXl (ORCPT ); Thu, 8 Nov 2018 20:23:41 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DB262AE5C; Thu, 8 Nov 2018 15:47:34 +0000 (UTC) Date: Thu, 8 Nov 2018 15:47:32 +0000 (UTC) From: Michael Matz To: Borislav Petkov cc: Yi Wang , tglx@linutronix.de, 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 In-Reply-To: <20181108153226.GF7543@zn.tnic> Message-ID: References: <1541639548-11149-1-git-send-email-wang.yi59@zte.com.cn> <20181108150318.GD7543@zn.tnic> <20181108153226.GF7543@zn.tnic> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, 8 Nov 2018, Borislav Petkov wrote: > And frankly, I don't see why we should be fixing all those. So what if a > global function does't have a previous prototype declaration?! > > Micha, is there anything "useful" that warning bitches about or should > we disable it? 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. [There's also one subtle issue with argument promotions. prototypeless functions are called as if they are declared "int name()" that is default argument promotions take place (float->double, {char,short}->int), which won't happen with prototypes, and argument type conversions won't take place (as no parameter types are known). This might lead to different values between calling a prototyped and a prototype-less function arriving at the function even though the call expression looked the same] Ciao, Michael.