static ssize_t read_file_slot(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct ath9k_htc_priv *priv = file->private_data; char buf[512]; unsigned int len = 0; spin_lock_bh(&priv->tx.tx_lock); len += snprintf(buf + len, sizeof(buf) - len, "TX slot bitmap : "); len += bitmap_scnprintf(buf + len, sizeof(buf) - len, priv->tx.tx_slot, MAX_TX_BUF_NUM); len += snprintf(buf + len, sizeof(buf) - len, "\n"); len += snprintf(buf + len, sizeof(buf) - len, "Used slots : %d\n", bitmap_weight(priv->tx.tx_slot, MAX_TX_BUF_NUM)); spin_unlock_bh(&priv->tx.tx_lock); if (len > sizeof(buf)) len = sizeof(buf); return simple_read_from_buffer(user_buf, count, ppos, buf, len); }
bool msm_mpm_irqs_detectable(bool from_idle) { unsigned long *apps_irq_bitmap; int debug_mask; if (from_idle) { apps_irq_bitmap = msm_mpm_enabled_apps_irqs; debug_mask = msm_mpm_debug_mask & MSM_MPM_DEBUG_NON_DETECTABLE_IRQ_IDLE; } else { apps_irq_bitmap = msm_mpm_wake_apps_irqs; debug_mask = msm_mpm_debug_mask & MSM_MPM_DEBUG_NON_DETECTABLE_IRQ; } if (debug_mask) { static char buf[DIV_ROUND_UP(MSM_MPM_NR_APPS_IRQS, 32)*9+1]; bitmap_scnprintf(buf, sizeof(buf), apps_irq_bitmap, MSM_MPM_NR_APPS_IRQS); buf[sizeof(buf) - 1] = '\0'; pr_info("%s: cannot monitor %s", __func__, buf); } return (bool)__bitmap_empty(apps_irq_bitmap, MSM_MPM_NR_APPS_IRQS); }
void wa_rpipes_destroy(struct wahc *wa) { struct device *dev = &wa->usb_iface->dev; if (!bitmap_empty(wa->rpipe_bm, wa->rpipes)) { char buf[256]; WARN_ON(1); bitmap_scnprintf(buf, sizeof(buf), wa->rpipe_bm, wa->rpipes); dev_err(dev, "BUG: pipes not released on exit: %s\n", buf); } kfree(wa->rpipe_bm); }
static void __exit wusbcore_exit(void) { clear_bit(0, wusb_cluster_id_table); if (!bitmap_empty(wusb_cluster_id_table, CLUSTER_IDS)) { char buf[256]; bitmap_scnprintf(buf, sizeof(buf), wusb_cluster_id_table, CLUSTER_IDS); printk(KERN_ERR "BUG: WUSB Cluster IDs not released " "on exit: %s\n", buf); WARN_ON(1); } usb_unregister_notify(&wusb_usb_notifier); destroy_workqueue(wusbd); wusb_crypto_exit(); }
static ssize_t stm_show_entities(struct device *dev, struct device_attribute *attr, char *buf) { struct stm_drvdata *drvdata = dev_get_drvdata(dev->parent); ssize_t len; len = bitmap_scnprintf(buf, PAGE_SIZE, drvdata->entities, OST_ENTITY_MAX); if (PAGE_SIZE - len < 2) len = -EINVAL; else len += scnprintf(buf + len, 2, "\n"); return len; }
bool msm_mpm_irqs_detectable(bool from_idle) { unsigned long *apps_irq_bitmap = from_idle ? msm_mpm_enabled_apps_irqs : msm_mpm_wake_apps_irqs; if (MSM_MPM_DEBUG_NON_DETECTABLE_IRQ & msm_mpm_debug_mask) { static char buf[DIV_ROUND_UP(MSM_MPM_NR_APPS_IRQS, 32)*9+1]; bitmap_scnprintf(buf, sizeof(buf), apps_irq_bitmap, MSM_MPM_NR_APPS_IRQS); buf[sizeof(buf) - 1] = '\0'; pr_info("%s: cannot monitor %s", __func__, buf); } if(from_idle && !bitmap_full(msm_mpm_idle_apps_irqs, MSM_MPM_NR_APPS_IRQS)) return msm_mpm_irqs_idle_ignore(); else return (bool)__bitmap_empty(apps_irq_bitmap, MSM_MPM_NR_APPS_IRQS); }
bool msm_mpm_gpio_irq_enabled(bool from_idle) { unsigned long *apps_irq_bitmap = from_idle ? msm_mpm_enabled_apps_irqs : msm_mpm_wake_apps_irqs; int gpio_irq_enabled = 0; gpio_irq_enabled = __bitmap_intersects(msm_mpm_gpio_irqs_mask, apps_irq_bitmap, MSM_MPM_NR_APPS_IRQS); if (gpio_irq_enabled && (!from_idle || (MSM_MPM_DEBUG_ILDE_BLOCK & msm_mpm_debug_mask))) { char buf[DIV_ROUND_UP(MSM_MPM_NR_APPS_IRQS, 32)*9+1]; DECLARE_BITMAP(msm_mpm_chk_gpio_irqs, MSM_MPM_NR_APPS_IRQS); __bitmap_and(msm_mpm_chk_gpio_irqs, msm_mpm_gic_irqs_mask, apps_irq_bitmap, MSM_MPM_NR_APPS_IRQS); bitmap_scnprintf(buf, sizeof(buf), apps_irq_bitmap, MSM_MPM_NR_APPS_IRQS); buf[sizeof(buf) - 1] = '\0'; pr_info("%s: cannot monitor %s", __func__, buf); } return gpio_irq_enabled; }
static void wusbhc_rsv_complete_cb(struct uwb_rsv *rsv) { struct wusbhc *wusbhc = rsv->pal_priv; struct device *dev = wusbhc->dev; struct uwb_mas_bm mas; char buf[72]; switch (rsv->state) { case UWB_RSV_STATE_O_ESTABLISHED: uwb_rsv_get_usable_mas(rsv, &mas); bitmap_scnprintf(buf, sizeof(buf), mas.bm, UWB_NUM_MAS); dev_dbg(dev, "established reservation: %s\n", buf); wusbhc_bwa_set(wusbhc, rsv->stream, &mas); break; case UWB_RSV_STATE_NONE: dev_dbg(dev, "removed reservation\n"); wusbhc_bwa_set(wusbhc, 0, NULL); break; default: dev_dbg(dev, "unexpected reservation state: %d\n", rsv->state); break; } }