From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755020AbbINPZc (ORCPT ); Mon, 14 Sep 2015 11:25:32 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:56046 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751406AbbINPZa (ORCPT ); Mon, 14 Sep 2015 11:25:30 -0400 From: Arnd Bergmann To: linaro-kernel@lists.linaro.org Cc: Viresh Kumar , gregkh@linuxfoundation.org, sboyd@codeaurora.org, Rafael Wysocki , open list Subject: Re: [PATCH] debugfs: don't access 4 bytes for a boolean Date: Mon, 14 Sep 2015 17:25:23 +0200 Message-ID: <1499926.Jx7HlHxHXb@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <3d6f65fa15363650f2d10ca58b9d9d243e98980f.1441961769.git.viresh.kumar@linaro.org> References: <3d6f65fa15363650f2d10ca58b9d9d243e98980f.1441961769.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:9crwAYw3kM8l09zSA4dVVCz7b26S9vD8T6echpJ9lVAE1l3iK+6 V2+2EGomIfArvee1btFg4zdMKPlkqiyBVz19TDKT9cvF4vYkNW0nz9Vg4eRmCyKB6NY5uaO Db1CdE0zBLkby8ded3XbTafesEJCzW8TSirm9JHt6WZvUk3mDdThbETXKhDdOKmAfJlgQ08 u0PhzsoEkS7j1XCUD5Org== X-UI-Out-Filterresults: notjunk:1;V01:K0:d/26q3iAyPg=:OmXoiwuirrP2FeXmIoACoC ctvRJVtbcbAxCoKwNUFlikD0AQFJtXTDBSvGMBcWDCj5RfRGBce5RIcCg+FWOcg/F14GrPaiJ iVMcqBZHst4DXuJlZKPhndi+ZAs28hhkTHLP3T7Zk47dtMafGwUMN4LDbYQrJ4FDcmuQOLoet lV5kNaWwI8GzBR9NpzDHyDl17OnDcr/KvC8ff10GOP9cJqVmbXOraXnkrYFC2GLfzJfk2Xv7A 5fJ4nsQ3H/v3bE0bex9buIQGf58fV2FrxJuQG6EGwNZaf2Zkx/rzuOpaLIwMrZaiZ3UUqZqno U0z2UfzmaPMvIcUbhk2U1xq9807E+P2mH/05ZclaslzOhdt+1DgiImvo/VQa1anlQS6KIJkLk e1zvlq/WbI/h95z3d5w/K5pkmQTwgcRdp0oYZwp/zpOIjgaz85EsprtUJNSSku5ceP6ObeenP 29JAxHK1SWuV6BlbndlO3O16QvGFfCSTBpvPlI3p5jC8HhinYuSsZbwPuhURFFPLYNOYrhif5 +8gGe9XeuaYP8rnJtnJk1eKinplmYaHL+/lWzlribYKSTLIt5oBPc9czkBrrScGSESUIuatv6 kIGFd3WZJ7DMMfcIPxEC1r7WcBKjaDbs4ZFkGND9QpBNI6tZTwrrRqjslD5iHakp7TXw8XtwF 6S4/hnBhzQlXB6NRjsTcyHFhyzBRub46WqxuASlag8lOsMxtbfuD+Q8q2gQnfKiQ4oDIcs0gb EylleLpYEFG9LD7P Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 11 September 2015 14:36:06 Viresh Kumar wrote: > > debugfs_create_bool() declares the pointer to be of type u32 *. > Shouldn't that be changed to u8 *? There are many users which are > typecasting the variables to make debugfs API happy I'd say that the argument to debugfs_create_bool() has to match the access in the functions you are modifying, as well as whatever gets passed into it by callers. By accessing only the first byte, you break all drivers that call debugfs_create_bool() with a four-byte argument, at least on big-endian systems! If we change any part of this, we need to audit the existing 31 callers of the function and change them all to use a bool type. In the problem that you saw, what prevented gcc from printing a compile-time warning about debugfs_create_bool() being called with a bool argument? Arnd