From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751542AbbFBTe5 (ORCPT ); Tue, 2 Jun 2015 15:34:57 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:48921 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbbFBTeu (ORCPT ); Tue, 2 Jun 2015 15:34:50 -0400 Date: Tue, 2 Jun 2015 22:34:47 +0300 From: Mikko Rapeli To: Frans Klaver Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH 43/98] include/uapi/linux/hdlc/ioctl.h: include linux/if.h Message-ID: <20150602193447.GS12550@lakka.kapsi.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150530195223.GA15645@bugger.home> <20150530202253.GD15645@bugger.home> X-SA-Exim-Connect-IP: 2001:1bc8:1004::1 X-SA-Exim-Mail-From: mikko.rapeli@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 30, 2015 at 10:22:53PM +0200, Frans Klaver wrote: > On Sat, May 30, 2015 at 05:38:35PM +0200, Mikko Rapeli wrote: > > Fixes userspace compiler error: > > > > error: ‘IFNAMSIZ’ undeclared here (not in a function) > > > > Signed-off-by: Mikko Rapeli > > --- > > include/uapi/linux/hdlc/ioctl.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/include/uapi/linux/hdlc/ioctl.h b/include/uapi/linux/hdlc/ioctl.h > > index 04bc027..8bbee11 100644 > > --- a/include/uapi/linux/hdlc/ioctl.h > > +++ b/include/uapi/linux/hdlc/ioctl.h > > @@ -1,6 +1,7 @@ > > #ifndef __HDLC_IOCTL_H__ > > #define __HDLC_IOCTL_H__ > > > > +#include > > > > #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */ > > What's the point of this one if you break this circular dependency in > patch 49? Are those in between related? They are indeed... On Sat, May 30, 2015 at 09:52:23PM +0200, Frans Klaver wrote: > On Sat, May 30, 2015 at 05:38:41PM +0200, Mikko Rapeli wrote: > > This isn't pretty but does the job. I assume including plain linux/hdlc/ioctl.h > > without linux/if.h is much more rare than the other way round, and that > > these header file names are part of API, and that creating a new header file > > just for IFNAMSIZ isn't a good idea either. > > > > Fixes userspace compiler error: > > > > error: ‘IFNAMSIZ’ undeclared here (not in a function) > > > > Signed-off-by: Mikko Rapeli > > --- > > include/uapi/linux/hdlc/ioctl.h | 5 ++++- > > include/uapi/linux/if.h | 4 ++++ > > 2 files changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/include/uapi/linux/hdlc/ioctl.h b/include/uapi/linux/hdlc/ioctl.h > > index 8bbee11..73982ec 100644 > > --- a/include/uapi/linux/hdlc/ioctl.h > > +++ b/include/uapi/linux/hdlc/ioctl.h > > @@ -1,7 +1,10 @@ > > #ifndef __HDLC_IOCTL_H__ > > #define __HDLC_IOCTL_H__ > > > > -#include > > +/* For breaking dependency loop between if.h and hdlc/ioctl.h */ > > +#ifndef IFNAMSIZ > > +#define IFNAMSIZ 16 > > +#endif > > > > #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */ > > > > diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h > > index 9cf2394..e4b130a 100644 > > --- a/include/uapi/linux/if.h > > +++ b/include/uapi/linux/if.h > > @@ -23,6 +23,10 @@ > > #include /* for "struct sockaddr" et al */ > > #include /* for "__user" et al */ > > > > +/** > > + * IFNAMSIZ is also defined in linux/hdlc/ioctl.h if it does not exists > > + * to break dependency loop between linux/if.h and linux/hdlc/ioctl.h. > > + */ > > #define IFNAMSIZ 16 > > #define IFALIASZ 256 > > #include > > This feels backwards to me. Wouldn't it be less funky to accept that > IFNAMSIZE isn't defined in if.h, but rather in hdlc/ioctl.h? If now That is much less funky, thanks! I'll squash these to commits into a one which moves IFNAMSIZ to linux/hdlc/ioctl.h. -Mikko