On 8/13/2024 5:55 AM, Mateusz Polchlopek wrote:
From: Jacob Keller <jacob.e.kel...@intel.com>
...
diff --git a/drivers/net/ethernet/intel/iavf/iavf_ptp.c
b/drivers/net/ethernet/intel/iavf/iavf_ptp.c
...
+static int iavf_ptp_register_clock(struct iavf_adapter *adapter)
+{
+ struct ptp_clock_info *ptp_info = &adapter->ptp.info;
+ struct device *dev = &adapter->pdev->dev;
+
+ memset(ptp_info, 0, sizeof(*ptp_info));
+
+ snprintf(ptp_info->name, sizeof(ptp_info->name), "%s-%s-clk",
+ dev_driver_string(dev), dev_name(dev));
+ ptp_info->owner = THIS_MODULE;
+
+ adapter->ptp.clock = ptp_clock_register(ptp_info, dev);
+ if (IS_ERR(adapter->ptp.clock)) {
+ adapter->ptp.clock = NULL;
+
+ return PTR_ERR(adapter->ptp.clock);
+ }
cocci reports:
+drivers/net/ethernet/intel/iavf/iavf_ptp.c:47:9-16: ERROR: PTR_ERR
applied after initialization to constant on line 45