From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936459AbcIGM55 (ORCPT ); Wed, 7 Sep 2016 08:57:57 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:61420 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932705AbcIGM5y (ORCPT ); Wed, 7 Sep 2016 08:57:54 -0400 From: Arnd Bergmann To: Yuval Mintz Cc: Baoyou Xie , netdev , linux-kernel , "xie.baoyou@zte.com.cn" , Ariel Elior Subject: Re: [PATCH] qed: add missing header dependencies Date: Wed, 07 Sep 2016 14:52:56 +0200 Message-ID: <5820324.xrfiu7KHci@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <1473246420-1035-1-git-send-email-baoyou.xie@linaro.org> <4989831.9c6WyUak3s@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:u/MWXDePWudi/vHWDxhExEQW11fMbsZeY4DKxY8jKjrXFOCAbOP dtqxmUcYMFSVK7d7Qg87CYz7/Rb4v1/8amCJln8rWwnedkbE06H4B8TZvocbMG2Wm+Wr+3S t6FZT+5hZGOQfQ4CyZ/GStlMZ7NtGUx6ud8UPLQekW+Q20cLFvupVI0pzu8OfST8W4H9Bdd S9cPYklhl3Z22K+jP3MIw== X-UI-Out-Filterresults: notjunk:1;V01:K0:tmK+oIxEysQ=:aErYwKHGarMIZws1PncrnO TVgKB61txIqX3zvFyX+mCBG585JrgOcTWYspwf3QoAsEd9L1NZYbbYI755aPZfkAOqdz3CZn3 IriKiCeUmj/2OaMAIxTSoHFdapThP/erGkMtrofbCM8NNygYf3h1z5aOIlHYjHwdR351cUTox WLV4AMXLhAeaEICRbUxEGrFr2U7PbNYt+uNEVN71Lpuphvh4yi0e5zX7ZGlwhNNqJ7SPO6hXv yAq7YMNjS/M74RFx8Xu9feQ88DouCYoZlr4A35pbqfIl0EzOt7RhdX7mV0qOl/wReXOGhc/0V oVAnfL04clEP1fHum+6JsuXu2DzBeIxcW6rbEmO5g9CBu6/BIB9wbVZQB6g4dE6oW1p0DQ+Qm b80E28qu9DWoZ4FT35UPaaFki7PzgRRJu3Ty5vzuw7V2A3WEP6Gipte8NlnF51yt0Do6Hlu+h pOTrxzbPxsEkzEWZoW37JMhSeofqIP7gInTim6MtH+UREgzv9cX66xHbskzIT8D9CwRuuove8 94UNoyvnFjZ4cgIA3OvzH3X0tGssGx50nZoi8VeRaL95bB2sWekgBy5fR7LahqnCU1WzmyM3O tSViC2N1yibmKzXqqxOa2RAd1WjxDyNrpgORve0yvEDfHXT2h2Cf+Dg1H2IdzmQ9Up32I+I3J qnoVcDStrD541bnOAHrVTYjk36yv6MnHDNf8pIL7T2ZFfeXNZWj8QHv5ulrFwLzwJkrGK0qeZ mp0q29aBoingbWiz Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, September 7, 2016 12:31:03 PM CEST Yuval Mintz wrote: > > > While I obviously have no strong objection for including > > > qed_selftest.h from qed_selftest.c, I'm not sure I understand which C > > > standard dictates this requirement. > > > Why should a function definition [not call] be preceded by a prototype? > > > > - When a function is defined in one file and used in another, you want > > both files to include the same header that has the declaration to > > ensure that the types are identical. There are cases where the > > prototype is changed after the fact in an incompatible way, causing > > silent data corruption on some configurations but maybe not on others. > > O.k., motivation is clear. > But this really isn't enforced by the ansi-c standard, right? No, ansi-c doesn't enforce this, and even the regular kernel build flags don't enable the warning in question, we only get it when either building with "make C=1" using sparse, or "make W=1" to enable extra warnings from gcc. The warning is however really useful, and I hope that we go through all drivers in the kernel and eliminate these warnings in order to turn them on by default for all drivers. > Acked-by: Yuval Mintz Thanks, Arnd