From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752343AbcLGG0l (ORCPT ); Wed, 7 Dec 2016 01:26:41 -0500 Received: from s3.sipsolutions.net ([5.9.151.49]:33268 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225AbcLGG0i (ORCPT ); Wed, 7 Dec 2016 01:26:38 -0500 Message-ID: <1481091951.4092.12.camel@sipsolutions.net> Subject: Re: [PATCH 10/10] virtio: enable endian checks for sparse builds From: Johannes Berg To: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org Cc: Jason Wang , linux-kbuild@vger.kernel.org, Michal Marek , Arnd Bergmann , Greg Kroah-Hartman , Matt Mackall , Herbert Xu , David Airlie , Gerd Hoffmann , Ohad Ben-Cohen , Christian Borntraeger , Cornelia Huck , "James E.J. Bottomley" , "David S. Miller" , Jens Axboe , Neil Armstrong , Stefan Hajnoczi , Asias He , linux-crypto@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-scsi@vger.kernel.org, v9fs-developer@lists.sourceforge.net Date: Wed, 07 Dec 2016 07:25:51 +0100 In-Reply-To: <1481038106-24899-11-git-send-email-mst@redhat.com> (sfid-20161206_164156_647850_329465D7) References: <1481038106-24899-1-git-send-email-mst@redhat.com> <1481038106-24899-11-git-send-email-mst@redhat.com> (sfid-20161206_164156_647850_329465D7) Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-12-06 at 17:41 +0200, Michael S. Tsirkin wrote: > It seems that there should be a better way to do it, > but this works too. In some cases there might be: > --- a/drivers/s390/virtio/Makefile > +++ b/drivers/s390/virtio/Makefile > @@ -6,6 +6,8 @@ >  # it under the terms of the GNU General Public License (version 2 > only) >  # as published by the Free Software Foundation. >   > +CFLAGS_virtio_ccw.o += -D__CHECK_ENDIAN__ > +CFLAGS_kvm_virtio.o += -D__CHECK_ENDIAN__ >  s390-virtio-objs := virtio_ccw.o >  ifdef CONFIG_S390_GUEST_OLD_TRANSPORT >  s390-virtio-objs += kvm_virtio.o Here you could use ccflags-y += -D__CHECK_ENDIAN__ for example, or even subdir-ccflags-y += -D__CHECK_ENDIAN__ (in case any subdirs ever get added here) > --- a/drivers/vhost/Makefile > +++ b/drivers/vhost/Makefile > @@ -1,3 +1,4 @@ > +ccflags-y := -D__CHECK_ENDIAN__ Looks like you did that here and in some other places though - so perhaps the s390 one was intentionally different? > --- a/net/packet/Makefile > +++ b/net/packet/Makefile > @@ -2,6 +2,7 @@ >  # Makefile for the packet AF. >  # >   > +ccflags-y := -D__CHECK_ENDIAN__ Technically this is slightly more than advertised, but I guess that still makes sense if it's clean now. johannes