On Tue, 21 Jul 2020 03:50:00 +0000 Chi Song <Song.Chi@xxxxxxxxxxxxx> wrote: > +static void netvsc_attrs_init(void) > +{ > + char buffer[4]; > + int i; > + > + for (i = 0; i < VRSS_SEND_TAB_SIZE; i++) { > + sprintf(buffer, "%02u", i); > + dev_attr_netvsc_dev_attrs[i].attr.name = > + kstrdup(buffer, GFP_KERNEL); > + dev_attr_netvsc_dev_attrs[i].attr.mode = 0444; > + sysfs_attr_init(&dev_attr_netvsc_dev_attrs[i].attr); > + > + dev_attr_netvsc_dev_attrs[i].show = tx_indirection_show; > + dev_attr_netvsc_dev_attrs[i].store = NULL; > + netvsc_dev_attrs[i] = &dev_attr_netvsc_dev_attrs[i].attr; > + } > + netvsc_dev_attrs[VRSS_SEND_TAB_SIZE] = NULL; You know that last line is unnecessary. The variable is static and starts out as all zero. Overall looks good. Acked-by: Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx>