Re: [PATCH v2 01/10] blk-mq: create debugfs directory tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2017-01-25 at 08:06 -0800, Omar Sandoval wrote:
> +       for (i = 0; i < ARRAY_SIZE(blk_mq_debugfs_ctx_attrs); i++) {
> +               const struct blk_mq_debugfs_attr *attr;
> +
> +               attr = &blk_mq_debugfs_ctx_attrs[i];
> +               if (!debugfs_create_file(attr->name, attr->mode, ctx_dir, ctx,
> +                                        attr->fops))
> +                       return -ENOMEM;
> +       }

This loop occurs two times. Please consider introducing a helper function,
e.g. debugfs_create_files(). If you follow the same convention as for sysfs,
namely to use a sentinel at the end of an attribute array then that helper
function will only need a pointer to the attribute array and won't need the
size of that array.

Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux