Skip to contentSkip to conversation

drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c:582:6-8: opportunity for str_enabled_disabled(on)

DISCUSSION kernel test robot 1 participant 1 message Feb 11, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
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/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

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");
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki