Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751665AbaK1Noq (ORCPT ); Fri, 28 Nov 2014 08:44:46 -0500 Received: from mail-ig0-f169.google.com ([209.85.213.169]:37920 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbaK1Non convert rfc822-to-8bit (ORCPT ); Fri, 28 Nov 2014 08:44:43 -0500 MIME-Version: 1.0 In-Reply-To: <1416903391-12693-1-git-send-email-acourbot@nvidia.com> References: <5474391F.6030908@nvidia.com> <1416903391-12693-1-git-send-email-acourbot@nvidia.com> Date: Fri, 28 Nov 2014 14:44:42 +0100 Message-ID: Subject: Re: [PATCH v2] gpio: remove const modifier from gpiod_get_direction() From: Linus Walleij To: Alexandre Courbot Cc: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Alexandre Courbot Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 25, 2014 at 9:16 AM, Alexandre Courbot wrote: > Although gpiod_get_direction() can be considered side-effect free for > consumers, its internals involve setting or clearing bits in the > affected GPIO descriptor, for which we need to force-cast the const > descriptor variable to non-const. This could lead to incorrect behavior > if the compiler decides to optimize here, so remove this const > attribute. The intent is to make gpiod_get_direction() private anyway, > so it does not really matter. > > Reported-by: Uwe Kleine-König > Signed-off-by: Alexandre Courbot > Acked-by: Uwe Kleine-König > --- > Changes since v1: > - Fixed poor grammar in commit log > - Added Uwe's Ack Patch applied after crying blood of the quoted-printable encoding of this mail. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/