From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756198AbbJHKrr (ORCPT ); Thu, 8 Oct 2015 06:47:47 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:60574 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751259AbbJHKrp (ORCPT ); Thu, 8 Oct 2015 06:47:45 -0400 Date: Thu, 08 Oct 2015 04:03:32 -0700 (PDT) Message-Id: <20151008.040332.1651208312284048708.davem@davemloft.net> To: arnd@arndb.de Cc: netdev@vger.kernel.org, aconole@bytheb.org, edumazet@google.com, james.l.morris@oracle.com, linux-security-module@vger.kernel.org, serge@hallyn.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] af_unix: introduce unix_sk_const helper From: David Miller In-Reply-To: <10735490.HC94hyceBX@wuerfel> References: <10735490.HC94hyceBX@wuerfel> X-Mailer: Mew version 6.4 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 08 Oct 2015 03:47:45 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Tue, 06 Oct 2015 22:52:46 +0200 > Commit 124613012db1 ("af_unix: Convert the unix_sk macro to an inline > function for type safety") was recently added to catch incorrect > uses of the unix_sk helper using compiler warnings. > > It has now caught one such case in lsm_audit.c. The code is technically > correct, but as it converts a const pointer to a non-const pointer, > the annotation got lost, which gcc now warns about. > > This patch avoids the warning by introducing an additional helper > that has const input and output, which makes the lsm_audit code build > cleanly again. > > Signed-off-by: Arnd Bergmann > --- > I'm not entirely happy with this workaround myself, but could not come > up with a better one. You can make the argument unconditionally const, as Paul Moore has done in a separate patch submission.