From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754378AbbINPbK (ORCPT ); Mon, 14 Sep 2015 11:31:10 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34147 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752111AbbINPbI (ORCPT ); Mon, 14 Sep 2015 11:31:08 -0400 Date: Mon, 14 Sep 2015 21:01:02 +0530 From: Viresh Kumar To: Arnd Bergmann Cc: linaro-kernel@lists.linaro.org, gregkh@linuxfoundation.org, sboyd@codeaurora.org, Rafael Wysocki , open list Subject: Re: [PATCH] debugfs: don't access 4 bytes for a boolean Message-ID: <20150914153102.GE32551@linux> References: <3d6f65fa15363650f2d10ca58b9d9d243e98980f.1441961769.git.viresh.kumar@linaro.org> <1499926.Jx7HlHxHXb@wuerfel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1499926.Jx7HlHxHXb@wuerfel> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14-09-15, 17:25, Arnd Bergmann wrote: > 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. Right, so I have already sent a new version of this patch which should be able to take care of stuff you pointed out. > 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? A forced cast to u32 * :) -- viresh