[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202502111616.xnebdSv1-lkp@intel.com>
Date: Tue, 11 Feb 2025 16:35:34 +0800
From: kernel test robot <lkp@...el.com>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>
Subject: drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c:582:6-8:
opportunity for str_enabled_disabled(on)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: febbc555cf0fff895546ddb8ba2c9a523692fb55
commit: 8e7620726beb800d6806dbe7bf0b8cc13c1feb97 net: stmmac: Introduce dwmac1000 ptp_clock_info and operations
date: 3 months ago
config: csky-randconfig-r051-20250211 (https://download.01.org/0day-ci/archive/20250211/202502111616.xnebdSv1-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 14.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502111616.xnebdSv1-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c:582:6-8: opportunity for str_enabled_disabled(on)
vim +582 drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
557
558 int dwmac1000_ptp_enable(struct ptp_clock_info *ptp,
559 struct ptp_clock_request *rq, int on)
560 {
561 struct stmmac_priv *priv =
562 container_of(ptp, struct stmmac_priv, ptp_clock_ops);
563 void __iomem *ptpaddr = priv->ptpaddr;
564 int ret = -EOPNOTSUPP;
565 u32 tcr_val;
566
567 switch (rq->type) {
568 case PTP_CLK_REQ_EXTTS:
569 mutex_lock(&priv->aux_ts_lock);
570 tcr_val = readl(ptpaddr + PTP_TCR);
571
572 if (on) {
573 tcr_val |= GMAC_PTP_TCR_ATSEN0;
574 tcr_val |= GMAC_PTP_TCR_ATSFC;
575 priv->plat->flags |= STMMAC_FLAG_EXT_SNAPSHOT_EN;
576 } else {
577 tcr_val &= ~GMAC_PTP_TCR_ATSEN0;
578 priv->plat->flags &= ~STMMAC_FLAG_EXT_SNAPSHOT_EN;
579 }
580
581 netdev_dbg(priv->dev, "Auxiliary Snapshot %s.\n",
> 582 on ? "enabled" : "disabled");
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists