treewide: fix potentially dangerous trailing ';' in #defined values/expressions
authorPhil Carmody <ext-phil.2.carmody@nokia.com>
Thu, 14 Jul 2011 12:07:13 +0000 (15:07 +0300)
committerJiri Kosina <jkosina@suse.cz>
Thu, 21 Jul 2011 12:10:00 +0000 (14:10 +0200)
All these are instances of
  #define NAME value;
or
  #define NAME(params_opt) value;

These of course fail to build when used in contexts like
  if(foo $OP NAME)
  while(bar $OP NAME)
and may silently generate the wrong code in contexts such as
  foo = NAME + 1;    /* foo = value; + 1; */
  bar = NAME - 1;    /* bar = value; - 1; */
  baz = NAME & quux; /* baz = value; & quux; */

Reported on comp.lang.c,
Message-ID: <ab0d55fe-25e5-482b-811e-c475aa6065c3@c29g2000yqd.googlegroups.com>
Initial analysis of the dangers provided by Keith Thompson in that thread.

There are many more instances of more complicated macros having unnecessary
trailing semicolons, but this pile seems to be all of the cases of simple
values suffering from the problem. (Thus things that are likely to be found
in one of the contexts above, more complicated ones aren't.)

Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
35 files changed:
Documentation/DocBook/v4l/io.xml
arch/alpha/include/asm/floppy.h
arch/h8300/kernel/setup.c
arch/ia64/include/asm/sn/tioce.h
arch/mips/include/asm/floppy.h
arch/parisc/include/asm/dma-mapping.h
arch/parisc/math-emu/decode_exc.c
arch/powerpc/include/asm/elf.h
arch/powerpc/include/asm/smu.h
arch/sparc/include/asm/elf_64.h
arch/um/sys-i386/signal.c
arch/x86/kernel/i387.c
drivers/acpi/ac.c
drivers/acpi/battery.c
drivers/acpi/sbs.c
drivers/gpu/drm/sis/sis_drv.h
drivers/hwmon/gl520sm.c
drivers/isdn/i4l/isdn_bsdcomp.c
drivers/net/bsd_comp.c
drivers/net/natsemi.c
drivers/net/r8169.c
drivers/net/s2io.h
drivers/net/wireless/iwlegacy/iwl-commands.h
drivers/net/wireless/iwlwifi/iwl-commands.h
drivers/net/wireless/rtlwifi/rtl8192ce/reg.h
drivers/scsi/device_handler/scsi_dh_rdac.c
drivers/scsi/lpfc/lpfc_hw.h
drivers/usb/otg/twl4030-usb.c
drivers/video/i810/i810.h
include/linux/ceph/libceph.h
include/linux/mfd/tps65910.h
include/scsi/scsi.h
include/sound/soundfont.h
mm/slub.c
net/mac80211/mesh_hwmp.c

index 227e7ac45a06c4dbf3ac91973e492c3301df983f..c57d1ec6291cf00c7a3a2f87f13c84c0b53d5468 100644 (file)
@@ -210,7 +210,7 @@ for (i = 0; i &lt; reqbuf.count; i++)
       <programlisting>
 &v4l2-requestbuffers; reqbuf;
 /* Our current format uses 3 planes per buffer */
-#define FMT_NUM_PLANES = 3;
+#define FMT_NUM_PLANES = 3
 
 struct {
        void *start[FMT_NUM_PLANES];
index 0be50413b2b5007ff2343d0be0b94d1d6dc378c3..46cefbd50e73453abc7d26c08e501c09ce8da5e9 100644 (file)
@@ -27,7 +27,7 @@
 #define fd_cacheflush(addr,size) /* nothing */
 #define fd_request_irq()        request_irq(FLOPPY_IRQ, floppy_interrupt,\
                                            IRQF_DISABLED, "floppy", NULL)
-#define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL);
+#define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL)
 
 #ifdef CONFIG_PCI
 
index 7fda657110eb3d7a7cab104dd3d81f1693506526..68d651081bd3f00dcbc71767e86b1614a98c9ab8 100644 (file)
@@ -46,7 +46,7 @@
 #include <asm/regs267x.h>
 #endif
 
-#define STUBSIZE 0xc000;
+#define STUBSIZE 0xc000
 
 unsigned long rom_length;
 unsigned long memory_start;
index 893468e1b41b7f4214a9f1057f6387015c7dd671..6eae8ada90f00f308fbb8e5c2e12721d795e1c31 100644 (file)
@@ -467,7 +467,7 @@ typedef volatile struct tioce {
 #define CE_LSI_GB_CFG1_RXL0S_THS_SHFT  0
 #define CE_LSI_GB_CFG1_RXL0S_THS_MASK  (0xffULL << 0)
 #define CE_LSI_GB_CFG1_RXL0S_SMP_SHFT  8
-#define CE_LSI_GB_CFG1_RXL0S_SMP_MASK  (0xfULL << 8);
+#define CE_LSI_GB_CFG1_RXL0S_SMP_MASK  (0xfULL << 8)
 #define CE_LSI_GB_CFG1_RXL0S_ADJ_SHFT  12
 #define CE_LSI_GB_CFG1_RXL0S_ADJ_MASK  (0x7ULL << 12)
 #define CE_LSI_GB_CFG1_RXL0S_FLT_SHFT  15
index c5c7c0e6064c509b92c4c965bab3264a2318beab..4456c9c47e2144c67cd2449c98f9c8e4e5a1728b 100644 (file)
@@ -29,7 +29,7 @@ static inline void fd_cacheflush(char * addr, long size)
 #define FLOPPY0_TYPE           fd_drive_type(0)
 #define FLOPPY1_TYPE           fd_drive_type(1)
 
-#define FDC1                   fd_getfdaddr1();
+#define FDC1                   fd_getfdaddr1()
 
 #define N_FDC 1                        /* do you *really* want a second controller? */
 #define N_DRIVE 8
index 4ef73b09b1681db7aaef8ce95a4f8f1ea7db1349..890531e32fe87462f4a0cdbc20c8df019ad2db71 100644 (file)
@@ -210,7 +210,7 @@ parisc_walk_tree(struct device *dev)
        return dev->platform_data;
 }
                
-#define GET_IOC(dev) (HBA_DATA(parisc_walk_tree(dev))->iommu)
+#define GET_IOC(dev) (HBA_DATA(parisc_walk_tree(dev))->iommu)
        
 
 #ifdef CONFIG_IOMMU_CCIO
index 27a7492ddb0d66f7762e94dea40ff3f3ac1fcd85..04e550e76ae81ac3a4d226d26702240a35b22223 100644 (file)
@@ -56,7 +56,7 @@
 /* General definitions */
 #define DOESTRAP 1
 #define NOTRAP 0
-#define SIGNALCODE(signal, code) ((signal) << 24 | (code));
+#define SIGNALCODE(signal, code) ((signal) << 24 | (code))
 #define copropbit      1<<31-2 /* bit position 2 */
 #define opclass                9       /* bits 21 & 22 */
 #define fmt            11      /* bits 19 & 20 */
index 2b917c69ed15683bc4d761a5c5b6a5d7304718af..3bf9cca3514798d44d3a358bc42554a6e6d41845 100644 (file)
@@ -267,7 +267,7 @@ extern int ucache_bsize;
 struct linux_binprm;
 extern int arch_setup_additional_pages(struct linux_binprm *bprm,
                                       int uses_interp);
-#define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b);
+#define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b)
 
 /* 1GB for 64bit, 8MB for 32bit */
 #define STACK_RND_MASK (is_32bit_task() ? \
@@ -298,7 +298,7 @@ do {                                                                        \
        NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize);                      \
        NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize);                      \
        NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize);                      \
-       VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso_base)   \
+       VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso_base);  \
 } while (0)
 
 /* PowerPC64 relocations defined by the ABIs */
index e3bdada8c542b732d619d5ac9192fe26180003ee..ae20ce1af4c739e9085f3e53caf421a35f41c529 100644 (file)
@@ -547,7 +547,7 @@ struct smu_sdbp_header {
  * (currently, afaik, this concerns only the FVT partition
  * (0x12)
  */
-#define SMU_U16_MIX(x) le16_to_cpu(x);
+#define SMU_U16_MIX(x) le16_to_cpu(x)
 #define SMU_U32_MIX(x)  ((((x) & 0xff00ff00u) >> 8)|(((x) & 0x00ff00ffu) << 8))
 
 
index e67880381b84e6a0ebe04f1d6ef8efd2ce00d662..cfa9cd2e5519b65f620048d2836f9c91c5d070c8 100644 (file)
@@ -186,7 +186,7 @@ static inline unsigned int sparc64_elf_hwcap(void)
        return cap;
 }
 
-#define ELF_HWCAP      sparc64_elf_hwcap();
+#define ELF_HWCAP      sparc64_elf_hwcap()
 
 /* This yields a string that ld.so will use to load implementation
    specific libraries for optimization.  This is more specific in
index 129647375a6ccfb7f61910f0c8543ed9053f7480..89a46626bfd894c54d683622b7148633c1f91c97 100644 (file)
@@ -58,7 +58,7 @@ static inline unsigned long twd_fxsr_to_i387(struct user_fxsr_struct *fxsave)
        unsigned long ret = 0xffff0000;
        int i;
 
-#define FPREG_ADDR(f, n)       ((char *)&(f)->st_space + (n) * 16);
+#define FPREG_ADDR(f, n)       ((char *)&(f)->st_space + (n) * 16)
 
        for (i = 0; i < 8; i++) {
                if (twd & 0x1) {
index 12aff2537682b29cbb4264fac836a6371732c4a9..739d8598f7899bbebd4cd6666d9df08ca8f988f1 100644 (file)
@@ -321,7 +321,7 @@ static inline unsigned short twd_i387_to_fxsr(unsigned short twd)
        return tmp;
 }
 
-#define FPREG_ADDR(f, n)       ((void *)&(f)->st_space + (n) * 16);
+#define FPREG_ADDR(f, n)       ((void *)&(f)->st_space + (n) * 16)
 #define FP_EXP_TAG_VALID       0
 #define FP_EXP_TAG_ZERO                1
 #define FP_EXP_TAG_SPECIAL     2
index 58c3f74bd84cb2158bdd4a69e49931cee33c2ede..6512b20aeccdce0184a6a5c524af85c6f7f6db91 100644 (file)
@@ -89,7 +89,7 @@ struct acpi_ac {
        unsigned long long state;
 };
 
-#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
+#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger)
 
 #ifdef CONFIG_ACPI_PROCFS_POWER
 static const struct file_operations acpi_ac_fops = {
index fcc13ac0aa1870009ad0fd9dc41712795e582aab..2c661353e8f26145dffffbc5339a11d22272acea 100644 (file)
@@ -132,7 +132,7 @@ struct acpi_battery {
        unsigned long flags;
 };
 
-#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);
+#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat)
 
 inline int acpi_battery_present(struct acpi_battery *battery)
 {
index 51ae3794ec7f895f16cb2cf4545f6f146860909f..50658ff887d99a51f51bca23be2ba8fee4470281 100644 (file)
@@ -112,7 +112,7 @@ struct acpi_battery {
        u8 have_sysfs_alarm:1;
 };
 
-#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);
+#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat)
 
 struct acpi_sbs {
        struct power_supply charger;
index ef940bad63f7516703f2402859c973386753754c..194303c177ad65375af2801200e219f69894d3c6 100644 (file)
@@ -48,8 +48,8 @@ enum sis_family {
 
 
 #define SIS_BASE (dev_priv->mmio)
-#define SIS_READ(reg)         DRM_READ32(SIS_BASE, reg);
-#define SIS_WRITE(reg, val)   DRM_WRITE32(SIS_BASE, reg, val);
+#define SIS_READ(reg)         DRM_READ32(SIS_BASE, reg)
+#define SIS_WRITE(reg, val)   DRM_WRITE32(SIS_BASE, reg, val)
 
 typedef struct drm_sis_private {
        drm_local_map_t *mmio;
index ec588026f0a9c46c2ffd37347b5ac69da6f7b721..131ea8625f0830b1bfcc81d251ebf7e9cf3551f7 100644 (file)
@@ -273,7 +273,7 @@ static SENSOR_DEVICE_ATTR(in4_max, S_IRUGO | S_IWUSR,
 
 #define DIV_FROM_REG(val) (1 << (val))
 #define FAN_FROM_REG(val,div) ((val)==0 ? 0 : (480000/((val) << (div))))
-#define FAN_TO_REG(val,div) ((val)<=0?0:SENSORS_LIMIT((480000 + ((val) << ((div)-1))) / ((val) << (div)), 1, 255));
+#define FAN_TO_REG(val,div) ((val)<=0?0:SENSORS_LIMIT((480000 + ((val) << ((div)-1))) / ((val) << (div)), 1, 255))
 
 static ssize_t get_fan_input(struct device *dev, struct device_attribute *attr,
                             char *buf)
index 02d9918705dd5d70a96f538e6244e641f4dc9bca..aa0b6a6f5ef4e0ad4d4607610eb2f3c315e15951 100644 (file)
@@ -155,7 +155,7 @@ struct bsd_db {
 #define LAST   255
 
 #define MAXCODE(b)     ((1 << (b)) - 1)
-#define BADCODEM1      MAXCODE(MAX_BSD_BITS);
+#define BADCODEM1      MAXCODE(MAX_BSD_BITS)
 
 #define BSD_HASH(prefix,suffix,hshift) ((((unsigned long)(suffix))<<(hshift)) \
                                         ^ (unsigned long)(prefix))
index 6e99d80ec409be994fb1a9d41d5a8a5e5b14c33c..a9b759add187ad3033849c402b4854f2dfb2b074 100644 (file)
@@ -201,7 +201,7 @@ extern void ppp_unregister_compressor (struct compressor *cp);
 #define LAST   255
 
 #define MAXCODE(b)     ((1 << (b)) - 1)
-#define BADCODEM1      MAXCODE(MAX_BSD_BITS);
+#define BADCODEM1      MAXCODE(MAX_BSD_BITS)
 
 #define BSD_HASH(prefix,suffix,hshift) ((((unsigned long)(suffix))<<(hshift)) \
                                         ^ (unsigned long)(prefix))
index 68e6b0224eddbf166ea7dd464bfb643acb19ccc7..c69f82a17c280bf039dade352e3ceed9c0a3b2c0 100644 (file)
@@ -1382,7 +1382,7 @@ static int find_mii(struct net_device *dev)
 /* WCSR bits [0:4] [9:10] */
 #define WCSR_RESET_SAVE 0x61f
 /* RFCR bits [20] [22] [27:31] */
-#define RFCR_RESET_SAVE 0xf8500000;
+#define RFCR_RESET_SAVE 0xf8500000
 
 static void natsemi_reset(struct net_device *dev)
 {
index 5990621fb5cd3f401a0db5d30c8507b2b866cc9e..6f3630618fa8de007e18689dcd2ff2bb66505175 100644 (file)
@@ -667,7 +667,7 @@ struct rtl8169_private {
        u32 saved_wolopts;
 
        const struct firmware *fw;
-#define RTL_FIRMWARE_UNKNOWN   ERR_PTR(-EAGAIN);
+#define RTL_FIRMWARE_UNKNOWN   ERR_PTR(-EAGAIN)
 };
 
 MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
index 800b3a44e653f6cc6aba7ef6c8e7b1ced9674bcf..57a4dc7c7d7a878147278b7bc4e9a605e8aa0549 100644 (file)
@@ -968,8 +968,8 @@ struct s2io_nic {
        u8  serial_num[VPD_STRING_LEN];
 };
 
-#define RESET_ERROR 1;
-#define CMD_ERROR   2;
+#define RESET_ERROR 1
+#define CMD_ERROR   2
 
 /*  OS related system calls */
 #ifndef readq
index 17a1d504348e41281e62d23aaa55b87ec50d99ac..6a5c76e7345fb4cdbfc91a7df55fda13fe25b218 100644 (file)
@@ -2624,8 +2624,8 @@ struct iwl_scanstart_notification {
        __le32 status;
 } __packed;
 
-#define  SCAN_OWNER_STATUS 0x1;
-#define  MEASURE_OWNER_STATUS 0x2;
+#define  SCAN_OWNER_STATUS 0x1
+#define  MEASURE_OWNER_STATUS 0x2
 
 #define IWL_PROBE_STATUS_OK            0
 #define IWL_PROBE_STATUS_TX_FAILED     BIT(0)
index 6ee5f1aa555ca76af578642459fc178189f62db3..6288d1fdfcc6ae16238494db301c3ca938a60ea1 100644 (file)
@@ -2457,8 +2457,8 @@ struct iwl_scanstart_notification {
        __le32 status;
 } __packed;
 
-#define  SCAN_OWNER_STATUS 0x1;
-#define  MEASURE_OWNER_STATUS 0x2;
+#define  SCAN_OWNER_STATUS 0x1
+#define  MEASURE_OWNER_STATUS 0x2
 
 #define IWL_PROBE_STATUS_OK            0
 #define IWL_PROBE_STATUS_TX_FAILED     BIT(0)
index 598cecc63f41a554c362e218b2ab92e1e358bc64..5b43749031dd111af85fcd58123841dadbec5688 100644 (file)
 #define _SRL(x)                                        (((x) & 0x3F) << 8)
 
 #define _SIFS_CCK_CTX(x)                       ((x) & 0xFF)
-#define _SIFS_CCK_TRX(x)                       (((x) & 0xFF) << 8);
+#define _SIFS_CCK_TRX(x)                       (((x) & 0xFF) << 8)
 
 #define _SIFS_OFDM_CTX(x)                      ((x) & 0xFF)
-#define _SIFS_OFDM_TRX(x)                      (((x) & 0xFF) << 8);
+#define _SIFS_OFDM_TRX(x)                      (((x) & 0xFF) << 8)
 
 #define _TBTT_PROHIBIT_HOLD(x)                 (((x) & 0xFF) << 8)
 
index e7fc70d6b478734fb2b71f34f91400d331ee8070..2e7c136bb80528906ca2374eca7f235ac02a997a 100644 (file)
@@ -35,7 +35,7 @@
  * mode page were taken from the LSI RDAC 2.4 GPL'd
  * driver, and then converted to Linux conventions.
  */
-#define RDAC_QUIESCENCE_TIME 20;
+#define RDAC_QUIESCENCE_TIME 20
 /*
  * Page Codes
  */
index 9059524cf225410d71041a0555c3432ba2e0d734..ab4c4d651d0cf83226e9e00ba9d760c6dbbd7c09 100644 (file)
@@ -2955,18 +2955,18 @@ typedef struct _SLI2_RDSC {
 typedef struct _PCB {
 #ifdef __BIG_ENDIAN_BITFIELD
        uint32_t type:8;
-#define TYPE_NATIVE_SLI2       0x01;
+#define TYPE_NATIVE_SLI2       0x01
        uint32_t feature:8;
-#define FEATURE_INITIAL_SLI2   0x01;
+#define FEATURE_INITIAL_SLI2   0x01
        uint32_t rsvd:12;
        uint32_t maxRing:4;
 #else  /*  __LITTLE_ENDIAN_BITFIELD */
        uint32_t maxRing:4;
        uint32_t rsvd:12;
        uint32_t feature:8;
-#define FEATURE_INITIAL_SLI2   0x01;
+#define FEATURE_INITIAL_SLI2   0x01
        uint32_t type:8;
-#define TYPE_NATIVE_SLI2       0x01;
+#define TYPE_NATIVE_SLI2       0x01
 #endif
 
        uint32_t mailBoxSize;
index efeb4d1517ff12cfda0493362c93941eec622938..14f66c35862938adc5817c123233521c9ca1f925 100644 (file)
@@ -166,7 +166,7 @@ struct twl4030_usb {
 };
 
 /* internal define on top of container_of */
-#define xceiv_to_twl(x)                container_of((x), struct twl4030_usb, otg);
+#define xceiv_to_twl(x)                container_of((x), struct twl4030_usb, otg)
 
 /*-------------------------------------------------------------------------*/
 
index f37de60ecc5961856015fd729fa4d731d703790f..1414b73ac55b67f0ffbdde5da0f8923572252169 100644 (file)
 #define DRAM_ON                     0x08            
 #define DRAM_OFF                    0xE7
 #define PG_ENABLE_MASK              0x01
-#define RING_SIZE_MASK              (RINGBUFFER_SIZE - 1);
+#define RING_SIZE_MASK              (RINGBUFFER_SIZE - 1)
 
 /* defines for restoring registers partially */
 #define ADDR_MAP_MASK               (0x07 << 5)
index 6365f041745b87c04f21fa732a87ddea389f0520..563755181c1ea33e7a4c8ff99565704b5432d566 100644 (file)
@@ -35,7 +35,7 @@
 #define CEPH_OPT_MYIP             (1<<2) /* specified my ip */
 #define CEPH_OPT_NOCRC            (1<<3) /* no data crc on writes */
 
-#define CEPH_OPT_DEFAULT   (0);
+#define CEPH_OPT_DEFAULT   (0)
 
 #define ceph_set_opt(client, opt) \
        (client)->options->flags |= CEPH_OPT_##opt;
index 8bb85b930c0783a5fb697a1cfa3daf3b7cd49254..73572c65d04f17e8bb6729689035bbe721c516f8 100644 (file)
 #define LDO1_SEL_MASK                                  0xFC
 #define LDO3_SEL_MASK                                  0x7C
 #define LDO_MIN_VOLT                                   1000
-#define LDO_MAX_VOLT                                   3300;
+#define LDO_MAX_VOLT                                   3300
 
 
 /*Register VDIG1  (0x80) register.RegisterDescription */
index 3668903e397bafea89a45292a9680e9118403112..8001ae4cd7bad3bb848d40749f5af836bdc008cf 100644 (file)
@@ -495,7 +495,7 @@ static inline int scsi_is_wlun(unsigned int lun)
 
 #define sense_class(sense)  (((sense) >> 4) & 0x7)
 #define sense_error(sense)  ((sense) & 0xf)
-#define sense_valid(sense)  ((sense) & 0x80);
+#define sense_valid(sense)  ((sense) & 0x80)
 
 /*
  * default timeouts
index f95d99ba7f7473028b497932cda5493805f0b6c0..679df0574066be08206971f8213fd7eae7f4c963 100644 (file)
@@ -121,7 +121,7 @@ int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,
 int snd_sf_calc_parm_hold(int msec);
 int snd_sf_calc_parm_attack(int msec);
 int snd_sf_calc_parm_decay(int msec);
-#define snd_sf_calc_parm_delay(msec) (0x8000 - (msec) * 1000 / 725);
+#define snd_sf_calc_parm_delay(msec) (0x8000 - (msec) * 1000 / 725)
 extern int snd_sf_vol_table[128];
 int snd_sf_linear_to_log(unsigned int amount, int offset, int ratio);
 
index 35f351f26193a47145cd8bcb7f55ae091331ca97..5b7f7eb680e129997aaa619db89fd8317dce744a 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4058,7 +4058,7 @@ static int any_slab_objects(struct kmem_cache *s)
 #endif
 
 #define to_slab_attr(n) container_of(n, struct slab_attribute, attr)
-#define to_slab(n) container_of(n, struct kmem_cache, kobj);
+#define to_slab(n) container_of(n, struct kmem_cache, kobj)
 
 struct slab_attribute {
        struct attribute attr;
index 2b18053070c1d45c08b8b9c7f1711f84006134a0..3460108810d5ea60930d87d15d1057187a427bb2 100644 (file)
@@ -57,29 +57,29 @@ static inline u32 u16_field_get(u8 *preq_elem, int offset, bool ae)
 #define PREQ_IE_TTL(x)         (*(x + 2))
 #define PREQ_IE_PREQ_ID(x)     u32_field_get(x, 3, 0)
 #define PREQ_IE_ORIG_ADDR(x)   (x + 7)
-#define PREQ_IE_ORIG_SN(x)     u32_field_get(x, 13, 0);
-#define PREQ_IE_LIFETIME(x)    u32_field_get(x, 17, AE_F_SET(x));
-#define PREQ_IE_METRIC(x)      u32_field_get(x, 21, AE_F_SET(x));
+#define PREQ_IE_ORIG_SN(x)     u32_field_get(x, 13, 0)
+#define PREQ_IE_LIFETIME(x)    u32_field_get(x, 17, AE_F_SET(x))
+#define PREQ_IE_METRIC(x)      u32_field_get(x, 21, AE_F_SET(x))
 #define PREQ_IE_TARGET_F(x)    (*(AE_F_SET(x) ? x + 32 : x + 26))
 #define PREQ_IE_TARGET_ADDR(x)         (AE_F_SET(x) ? x + 33 : x + 27)
-#define PREQ_IE_TARGET_SN(x)   u32_field_get(x, 33, AE_F_SET(x));
+#define PREQ_IE_TARGET_SN(x)   u32_field_get(x, 33, AE_F_SET(x))
 
 
 #define PREP_IE_FLAGS(x)       PREQ_IE_FLAGS(x)
 #define PREP_IE_HOPCOUNT(x)    PREQ_IE_HOPCOUNT(x)
 #define PREP_IE_TTL(x)         PREQ_IE_TTL(x)
 #define PREP_IE_ORIG_ADDR(x)   (x + 3)
-#define PREP_IE_ORIG_SN(x)     u32_field_get(x, 9, 0);
-#define PREP_IE_LIFETIME(x)    u32_field_get(x, 13, AE_F_SET(x));
-#define PREP_IE_METRIC(x)      u32_field_get(x, 17, AE_F_SET(x));
+#define PREP_IE_ORIG_SN(x)     u32_field_get(x, 9, 0)
+#define PREP_IE_LIFETIME(x)    u32_field_get(x, 13, AE_F_SET(x))
+#define PREP_IE_METRIC(x)      u32_field_get(x, 17, AE_F_SET(x))
 #define PREP_IE_TARGET_ADDR(x) (AE_F_SET(x) ? x + 27 : x + 21)
-#define PREP_IE_TARGET_SN(x)   u32_field_get(x, 27, AE_F_SET(x));
+#define PREP_IE_TARGET_SN(x)   u32_field_get(x, 27, AE_F_SET(x))
 
 #define PERR_IE_TTL(x)         (*(x))
 #define PERR_IE_TARGET_FLAGS(x)        (*(x + 2))
 #define PERR_IE_TARGET_ADDR(x) (x + 3)
-#define PERR_IE_TARGET_SN(x)   u32_field_get(x, 9, 0);
-#define PERR_IE_TARGET_RCODE(x)        u16_field_get(x, 13, 0);
+#define PERR_IE_TARGET_SN(x)   u32_field_get(x, 9, 0)
+#define PERR_IE_TARGET_RCODE(x)        u16_field_get(x, 13, 0)
 
 #define MSEC_TO_TU(x) (x*1000/1024)
 #define SN_GT(x, y) ((long) (y) - (long) (x) < 0)