Re: [PATCH v5 net-next] net: hyperv: Add attributes to show TX indirection table

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

 



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>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux