Re: [PATCH v2 03/13] Attach/detach SoftiWarp to/from network and RDMA subsystem

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

 



On 10/6/2017 8:28 AM, Bernard Metzler wrote:
Signed-off-by: Bernard Metzler <bmt@xxxxxxxxxxxxxx>
+static bool loopback_enabled = 1;
+module_param(loopback_enabled, bool, 0644);
+MODULE_PARM_DESC(loopback_enabled, "enable_loopback");
+
+LIST_HEAD(siw_devlist);

Pretty much everyone here hates module parameters and you will get push back on principal, but this is an example of why they are bad. The siw_devlist shows you expect to have multiple devices, which is fine and of course makes sense. However, the module parameter is driver wide. This means you can not have one device in loopback mode while the other isn't.

+
+	strcpy(ofa_dev->name, SIW_IBDEV_PREFIX);
+	strlcpy(ofa_dev->name + strlen(SIW_IBDEV_PREFIX), netdev->name,
+		IB_DEVICE_NAME_MAX - strlen(SIW_IBDEV_PREFIX));

I'd encourage you to use the likes of strncpy and friends.

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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux