Thread (2 messages) 2 messages, 2 authors, 2020-07-21

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

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2020-07-21 04:46:11
Also in: linux-hyperv, lkml

On Tue, 21 Jul 2020 03:50:00 +0000
Chi Song [off-list ref] 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@networkplumber.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help