+static ssize_t hello_len_show(struct device *dev, struct device_attribute *attr,
+ char *buffer)
+{
+ size_t len = CIRC_CNT(hello->head, hello->tail, MAXLEN);
+ return sprintf(buffer, "%d\n", len);
+}
+
+static const struct device_attribute hello_len_attr = {
+ .attr = { .name = "len", .mode = 0444, },
+ .show = hello_len_show,
+};
+