From patchwork Wed Dec 11 06:43:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 3322521 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 310689F37C for ; Wed, 11 Dec 2013 06:46:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6D0FA203F7 for ; Wed, 11 Dec 2013 06:46:38 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mail.kernel.org (Postfix) with ESMTP id 8E3AE20396 for ; Wed, 11 Dec 2013 06:46:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rBB6i0NZ018604; Wed, 11 Dec 2013 01:44:01 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rBB6hfE7021210 for ; Wed, 11 Dec 2013 01:43:41 -0500 Received: from dhcp80-209.msp.redhat.com (octiron.msp.redhat.com [10.15.80.209]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBB6hftZ021316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Dec 2013 01:43:41 -0500 Received: from dhcp80-209.msp.redhat.com (localhost [127.0.0.1]) by dhcp80-209.msp.redhat.com (8.14.7/8.14.7) with ESMTP id rBB6heSs001388; Wed, 11 Dec 2013 00:43:40 -0600 Received: (from bmarzins@localhost) by dhcp80-209.msp.redhat.com (8.14.7/8.14.7/Submit) id rBB6heoL001387; Wed, 11 Dec 2013 00:43:40 -0600 From: Benjamin Marzinski To: device-mapper development Date: Wed, 11 Dec 2013 00:43:07 -0600 Message-Id: <1386744190-1295-14-git-send-email-bmarzins@redhat.com> In-Reply-To: <1386744190-1295-1-git-send-email-bmarzins@redhat.com> References: <1386744190-1295-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: dm-devel@redhat.com Cc: Christophe Varoqui Subject: [dm-devel] [PATCH 13/16] kpartx: fix strict aliasing warning X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Compiling with strict aliasing throws warnings about aliasing volume_label_t to an array of unsigned ints. Adding __may_alias__ lets it know that we meant to do this. Signed-off-by: Benjamin Marzinski --- kpartx/dasd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kpartx/dasd.c b/kpartx/dasd.c index dcdf678..1fcf778 100644 --- a/kpartx/dasd.c +++ b/kpartx/dasd.c @@ -46,6 +46,8 @@ unsigned long long sectors512(unsigned long long sectors, int blocksize) return sectors * (blocksize >> 9); } +typedef unsigned int __attribute__((__may_alias__)) label_ints_t; + /* */ int @@ -169,7 +171,7 @@ read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns) /* * VM style CMS1 labeled disk */ - unsigned int *label = (unsigned int *) &vlabel; + label_ints_t *label = (label_ints_t *) &vlabel; blocksize = label[4]; if (label[14] != 0) {