lkml.org 
[lkml]   [2024]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [net-next PATCH 3/9] octeontx2-pf: Create representor netdev
Hi Geetha,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url: https://github.com/intel-lab-lkp/linux/commits/Geetha-sowjanya/octeontx2-pf-Refactoring-RVU-driver/20240416-131052
base: net-next/main
patch link: https://lore.kernel.org/r/20240416050616.6056-4-gakula%40marvell.com
patch subject: [net-next PATCH 3/9] octeontx2-pf: Create representor netdev
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240417/202404170922.RBiIclFT-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240417/202404170922.RBiIclFT-lkp@intel.com/reproduce)

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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404170922.RBiIclFT-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/marvell/octeontx2/nic/rep.c:167:7: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
167 | if (register_netdev(ndev)) {
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/marvell/octeontx2/nic/rep.c:181:9: note: uninitialized use occurs here
181 | return err;
| ^~~
drivers/net/ethernet/marvell/octeontx2/nic/rep.c:167:3: note: remove the 'if' if its condition is always false
167 | if (register_netdev(ndev)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
168 | dev_err(priv->dev, "PFVF reprentator registration failed\n");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
169 | free_netdev(ndev);
| ~~~~~~~~~~~~~~~~~~
170 | ndev->netdev_ops = NULL;
| ~~~~~~~~~~~~~~~~~~~~~~~~
171 | goto exit;
| ~~~~~~~~~~
172 | }
| ~
drivers/net/ethernet/marvell/octeontx2/nic/rep.c:137:17: note: initialize the variable 'err' to silence this warning
137 | int rep_id, err;
| ^
| = 0
1 warning generated.


vim +167 drivers/net/ethernet/marvell/octeontx2/nic/rep.c

131
132 int rvu_rep_create(struct otx2_nic *priv)
133 {
134 int rep_cnt = priv->rep_cnt;
135 struct net_device *ndev;
136 struct rep_dev *rep;
137 int rep_id, err;
138 u16 pcifunc;
139
140 priv->reps = devm_kcalloc(priv->dev, rep_cnt, sizeof(struct rep_dev), GFP_KERNEL);
141 if (!priv->reps)
142 return -ENOMEM;
143
144 for (rep_id = 0; rep_id < rep_cnt; rep_id++) {
145 ndev = alloc_etherdev(sizeof(*rep));
146 if (!ndev) {
147 dev_err(priv->dev, "PFVF representor:%d creation failed\n", rep_id);
148 err = -ENOMEM;
149 goto exit;
150 }
151
152 rep = netdev_priv(ndev);
153 priv->reps[rep_id] = rep;
154 rep->mdev = priv;
155 rep->netdev = ndev;
156 rep->rep_id = rep_id;
157
158 ndev->min_mtu = OTX2_MIN_MTU;
159 ndev->max_mtu = priv->hw.max_mtu;
160 pcifunc = priv->rep_pf_map[rep_id];
161 rep->pcifunc = pcifunc;
162
163 snprintf(ndev->name, sizeof(ndev->name), "r%dp%dv%d", rep_id,
164 rvu_get_pf(pcifunc), (pcifunc & RVU_PFVF_FUNC_MASK));
165
166 eth_hw_addr_random(ndev);
> 167 if (register_netdev(ndev)) {
168 dev_err(priv->dev, "PFVF reprentator registration failed\n");
169 free_netdev(ndev);
170 ndev->netdev_ops = NULL;
171 goto exit;
172 }
173 }
174 err = rvu_rep_napi_init(priv);
175 if (err)
176 goto exit;
177
178 return 0;
179 exit:
180 rvu_rep_free_netdev(priv);
181 return err;
182 }
183

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

\
 
 \ /
  Last update: 2024-04-17 03:25    [W:0.036 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site