From patchwork Wed Jul 2 12:12:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 366346 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AF2261400D5 for ; Wed, 2 Jul 2014 22:12:44 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752726AbaGBMMX (ORCPT ); Wed, 2 Jul 2014 08:12:23 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:38110 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752032AbaGBMMV (ORCPT ); Wed, 2 Jul 2014 08:12:21 -0400 Received: by mail-la0-f47.google.com with SMTP id s18so6977466lam.34 for ; Wed, 02 Jul 2014 05:12:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pRRYM5TwPAlk6WvEodxTzRbcWkS+G+SN14TG87qaxSI=; b=P/ujeA6zIMtXn4AY/vq06d3nhRlIr4rq/rCSO8maomf00I6vJTSSugG/MF37/E48cf jmxq29775KBBRqyl+wzylEmuZ99du5LS9c5TTIjtYv3xLnvbGaaolZjRFFukmRI7dbnc deYTWdmS7dmUmOPi/E5Cf72/Ddzq2Uadoltus5SNgZAnonW0EOm/UOZLTcn3IWDu8fYV WvH6W3FK5icuFQHwSVaNELnjb9Q4IHtHjxeBo1Fqc1RKVhA62ymf2TMJz226obYEj08V j6tgsCe2Z8o9r7ZaIsUXzoU6EFdJOLaDcbdsAYiQZSrEbHc0+hNjYqP65y8tqokSJ3Oj ejZw== X-Gm-Message-State: ALoCoQk0hPe/dwGy3S5Y7zWlfK6KMRE+AZm6+LzIsAu9llK2x/3zjJoTP5FXKpSuAANlPFS7EEJO X-Received: by 10.152.45.99 with SMTP id l3mr3446286lam.5.1404303139829; Wed, 02 Jul 2014 05:12:19 -0700 (PDT) Received: from spencer.imf.au.dk ([130.225.20.51]) by mx.google.com with ESMTPSA id lb5sm4684572lab.20.2014.07.02.05.12.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jul 2014 05:12:18 -0700 (PDT) From: Rasmus Villemoes To: Greg Kroah-Hartman Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Rasmus Villemoes Subject: [PATCH] net: arcnet: Remove "#define bool int" Date: Wed, 2 Jul 2014 14:12:01 +0200 Message-Id: <1404303121-2548-1-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 1.7.10.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The header file include/linux/arcdevice.h #defines bool to int, if bool is not already #defined. However, the files which use that header file seem to rely on that #define (unconditionally) being in effect: the prototypes for the functions arcrimi_reset, com20020_reset, com90io_reset, com90xx_reset (whose addresses are assigned to the hw.reset member of struct arcnet_local) use int explicitly. Moreover, that #define is an accident waiting to happen (scenario: inclusion of arcdevice.h followed by inclusion of some header which declares function prototypes using bool). Also, #include must appear before #include (the compiler wouldn't like "typedef _Bool int"). Since none of the files using arcdevice.h declare variables of type "bool", the patch is actually quite simple, unlike the commit message. Signed-off-by: Rasmus Villemoes --- include/linux/arcdevice.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index 7216b0d..df03562 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h @@ -22,10 +22,6 @@ #ifdef __KERNEL__ #include -#ifndef bool -#define bool int -#endif - /* * RECON_THRESHOLD is the maximum number of RECON messages to receive * within one minute before printing a "cabling problem" warning. The @@ -285,9 +281,9 @@ struct arcnet_local { unsigned long first_recon; /* time of "first" RECON message to count */ unsigned long last_recon; /* time of most recent RECON */ int num_recons; /* number of RECONs between first and last. */ - bool network_down; /* do we think the network is down? */ + int network_down; /* do we think the network is down? */ - bool excnak_pending; /* We just got an excesive nak interrupt */ + int excnak_pending; /* We just got an excesive nak interrupt */ struct { uint16_t sequence; /* sequence number (incs with each packet) */ @@ -305,7 +301,7 @@ struct arcnet_local { void (*command) (struct net_device * dev, int cmd); int (*status) (struct net_device * dev); void (*intmask) (struct net_device * dev, int mask); - bool (*reset) (struct net_device * dev, bool really_reset); + int (*reset) (struct net_device * dev, int really_reset); void (*open) (struct net_device * dev); void (*close) (struct net_device * dev);