extern struct eeh_ops *eeh_ops;
 extern raw_spinlock_t confirm_error_lock;
 
-static inline bool eeh_enabled(void)
+static inline void eeh_add_flag(int flag)
 {
-       if ((eeh_subsystem_flags & EEH_FORCE_DISABLED) ||
-           !(eeh_subsystem_flags & EEH_ENABLED))
-               return false;
-
-       return true;
+       eeh_subsystem_flags |= flag;
 }
 
-static inline void eeh_set_enable(bool mode)
+static inline void eeh_clear_flag(int flag)
 {
-       if (mode)
-               eeh_subsystem_flags |= EEH_ENABLED;
-       else
-               eeh_subsystem_flags &= ~EEH_ENABLED;
+       eeh_subsystem_flags &= ~flag;
 }
 
-static inline void eeh_probe_mode_set(int flag)
+static inline bool eeh_has_flag(int flag)
 {
-       eeh_subsystem_flags |= flag;
+        return !!(eeh_subsystem_flags & flag);
 }
 
-static inline int eeh_probe_mode_devtree(void)
+static inline bool eeh_enabled(void)
 {
-       return (eeh_subsystem_flags & EEH_PROBE_MODE_DEVTREE);
-}
+       if (eeh_has_flag(EEH_FORCE_DISABLED) ||
+           !eeh_has_flag(EEH_ENABLED))
+               return false;
 
-static inline int eeh_probe_mode_dev(void)
-{
-       return (eeh_subsystem_flags & EEH_PROBE_MODE_DEV);
+       return true;
 }
 
 static inline void eeh_serialize_lock(unsigned long *flags)
         return false;
 }
 
-static inline void eeh_set_enable(bool mode) { }
-
 static inline int eeh_init(void)
 {
        return 0;
 
 static int __init eeh_setup(char *str)
 {
        if (!strcmp(str, "off"))
-               eeh_subsystem_flags |= EEH_FORCE_DISABLED;
+               eeh_add_flag(EEH_FORCE_DISABLED);
 
        return 1;
 }
         * 0xFF's is always returned from PCI config space.
         */
        if (!(pe->type & EEH_PE_PHB)) {
-               if (eeh_probe_mode_devtree())
+               if (eeh_has_flag(EEH_PROBE_MODE_DEVTREE))
                        eeh_pci_enable(pe, EEH_OPT_THAW_MMIO);
                eeh_ops->configure_bridge(pe);
                eeh_pe_restore_bars(pe);
        unsigned long flags;
        int ret;
 
-       if (!eeh_probe_mode_dev())
+       if (!eeh_has_flag(EEH_PROBE_MODE_DEV))
                return -EPERM;
 
        /* Find the PHB PE */
 static int eeh_reboot_notifier(struct notifier_block *nb,
                               unsigned long action, void *unused)
 {
-       eeh_set_enable(false);
+       eeh_clear_flag(EEH_ENABLED);
        return NOTIFY_DONE;
 }
 
                return ret;
 
        /* Enable EEH for all adapters */
-       if (eeh_probe_mode_devtree()) {
+       if (eeh_has_flag(EEH_PROBE_MODE_DEVTREE)) {
                list_for_each_entry_safe(hose, tmp,
                        &hose_list, list_node) {
                        phb = hose->dn;
                        traverse_pci_devices(phb, eeh_ops->of_probe, NULL);
                }
-       } else if (eeh_probe_mode_dev()) {
+       } else if (eeh_has_flag(EEH_PROBE_MODE_DEV)) {
                list_for_each_entry_safe(hose, tmp,
                        &hose_list, list_node)
                        pci_walk_bus(hose->bus, eeh_ops->dev_probe, NULL);
         * would delay the probe until late stage because
         * the PCI device isn't available this moment.
         */
-       if (!eeh_probe_mode_devtree())
+       if (!eeh_has_flag(EEH_PROBE_MODE_DEVTREE))
                return;
 
        if (!of_node_to_eeh_dev(dn))
         * We have to do the EEH probe here because the PCI device
         * hasn't been created yet in the early stage.
         */
-       if (eeh_probe_mode_dev())
+       if (eeh_has_flag(EEH_PROBE_MODE_DEV))
                eeh_ops->dev_probe(dev, NULL);
 
        eeh_addr_cache_insert_dev(dev);
 static int eeh_enable_dbgfs_set(void *data, u64 val)
 {
        if (val)
-               eeh_subsystem_flags &= ~EEH_FORCE_DISABLED;
+               eeh_clear_flag(EEH_FORCE_DISABLED);
        else
-               eeh_subsystem_flags |= EEH_FORCE_DISABLED;
+               eeh_add_flag(EEH_FORCE_DISABLED);
 
        /* Notify the backend */
        if (eeh_ops->post_init)