BCC: l...@intel.com
CC: kbuild-...@lists.01.org
CC: Linux Memory Management List <linux...@kvack.org>
TO: Sean Anderson <sean.ander...@seco.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   ef08d387bbbc20df740ced8caee0ffac835869ac
commit: 302376feec1d4e351faf31df17fdb22db685961a [4378/8235] net: fman: Move 
initialization to mac-specific files
:::::: branch date: 6 hours ago
:::::: commit date: 2 weeks ago
config: csky-randconfig-m041-20220918 
(https://download.01.org/0day-ci/archive/20220920/202209202227.tzkzs00j-...@intel.com/config)
compiler: csky-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <l...@intel.com>
Reported-by: Dan Carpenter <dan.carpen...@oracle.com>

smatch warnings:
drivers/net/ethernet/freescale/fman/fman_memac.c:1286 memac_initialization() 
error: uninitialized symbol 'fixed_link'.

vim +/fixed_link +1286 drivers/net/ethernet/freescale/fman/fman_memac.c

302376feec1d4e Sean Anderson 2022-09-02  1199  
302376feec1d4e Sean Anderson 2022-09-02  1200  int memac_initialization(struct 
mac_device *mac_dev,
302376feec1d4e Sean Anderson 2022-09-02  1201                    struct 
device_node *mac_node)
302376feec1d4e Sean Anderson 2022-09-02  1202  {
302376feec1d4e Sean Anderson 2022-09-02  1203   int                      err;
302376feec1d4e Sean Anderson 2022-09-02  1204   struct fman_mac_params   params;
302376feec1d4e Sean Anderson 2022-09-02  1205   struct fixed_phy_status 
*fixed_link;
302376feec1d4e Sean Anderson 2022-09-02  1206  
302376feec1d4e Sean Anderson 2022-09-02  1207   mac_dev->set_promisc            
= memac_set_promiscuous;
302376feec1d4e Sean Anderson 2022-09-02  1208   mac_dev->change_addr            
= memac_modify_mac_address;
302376feec1d4e Sean Anderson 2022-09-02  1209   mac_dev->add_hash_mac_addr      
= memac_add_hash_mac_address;
302376feec1d4e Sean Anderson 2022-09-02  1210   mac_dev->remove_hash_mac_addr   
= memac_del_hash_mac_address;
302376feec1d4e Sean Anderson 2022-09-02  1211   mac_dev->set_tx_pause           
= memac_set_tx_pause_frames;
302376feec1d4e Sean Anderson 2022-09-02  1212   mac_dev->set_rx_pause           
= memac_accept_rx_pause_frames;
302376feec1d4e Sean Anderson 2022-09-02  1213   mac_dev->set_exception          
= memac_set_exception;
302376feec1d4e Sean Anderson 2022-09-02  1214   mac_dev->set_allmulti           
= memac_set_allmulti;
302376feec1d4e Sean Anderson 2022-09-02  1215   mac_dev->set_tstamp             
= memac_set_tstamp;
302376feec1d4e Sean Anderson 2022-09-02  1216   mac_dev->set_multi              
= fman_set_multi;
302376feec1d4e Sean Anderson 2022-09-02  1217   mac_dev->adjust_link            
= adjust_link_memac;
302376feec1d4e Sean Anderson 2022-09-02  1218   mac_dev->enable                 
= memac_enable;
302376feec1d4e Sean Anderson 2022-09-02  1219   mac_dev->disable                
= memac_disable;
302376feec1d4e Sean Anderson 2022-09-02  1220  
302376feec1d4e Sean Anderson 2022-09-02  1221   err = 
set_fman_mac_params(mac_dev, &params);
302376feec1d4e Sean Anderson 2022-09-02  1222   if (err)
302376feec1d4e Sean Anderson 2022-09-02  1223           goto _return;
302376feec1d4e Sean Anderson 2022-09-02  1224   params.internal_phy_node = 
of_parse_phandle(mac_node, "pcsphy-handle", 0);
302376feec1d4e Sean Anderson 2022-09-02  1225  
302376feec1d4e Sean Anderson 2022-09-02  1226   if (params.max_speed == 
SPEED_10000)
302376feec1d4e Sean Anderson 2022-09-02  1227           params.phy_if = 
PHY_INTERFACE_MODE_XGMII;
302376feec1d4e Sean Anderson 2022-09-02  1228  
302376feec1d4e Sean Anderson 2022-09-02  1229   mac_dev->fman_mac = 
memac_config(&params);
302376feec1d4e Sean Anderson 2022-09-02  1230   if (!mac_dev->fman_mac) {
302376feec1d4e Sean Anderson 2022-09-02  1231           err = -EINVAL;
302376feec1d4e Sean Anderson 2022-09-02  1232           goto _return;
302376feec1d4e Sean Anderson 2022-09-02  1233   }
302376feec1d4e Sean Anderson 2022-09-02  1234  
302376feec1d4e Sean Anderson 2022-09-02  1235   err = 
memac_cfg_max_frame_len(mac_dev->fman_mac, fman_get_max_frm());
302376feec1d4e Sean Anderson 2022-09-02  1236   if (err < 0)
302376feec1d4e Sean Anderson 2022-09-02  1237           goto 
_return_fm_mac_free;
302376feec1d4e Sean Anderson 2022-09-02  1238  
302376feec1d4e Sean Anderson 2022-09-02  1239   err = 
memac_cfg_reset_on_init(mac_dev->fman_mac, true);
302376feec1d4e Sean Anderson 2022-09-02  1240   if (err < 0)
302376feec1d4e Sean Anderson 2022-09-02  1241           goto 
_return_fm_mac_free;
302376feec1d4e Sean Anderson 2022-09-02  1242  
302376feec1d4e Sean Anderson 2022-09-02  1243   if (!mac_dev->phy_node && 
of_phy_is_fixed_link(mac_node)) {
302376feec1d4e Sean Anderson 2022-09-02  1244           struct phy_device *phy;
302376feec1d4e Sean Anderson 2022-09-02  1245  
302376feec1d4e Sean Anderson 2022-09-02  1246           err = 
of_phy_register_fixed_link(mac_node);
302376feec1d4e Sean Anderson 2022-09-02  1247           if (err)
302376feec1d4e Sean Anderson 2022-09-02  1248                   goto 
_return_fm_mac_free;
302376feec1d4e Sean Anderson 2022-09-02  1249  
302376feec1d4e Sean Anderson 2022-09-02  1250           fixed_link = 
kzalloc(sizeof(*fixed_link), GFP_KERNEL);
302376feec1d4e Sean Anderson 2022-09-02  1251           if (!fixed_link) {
302376feec1d4e Sean Anderson 2022-09-02  1252                   err = -ENOMEM;
302376feec1d4e Sean Anderson 2022-09-02  1253                   goto 
_return_fm_mac_free;
302376feec1d4e Sean Anderson 2022-09-02  1254           }
302376feec1d4e Sean Anderson 2022-09-02  1255  
302376feec1d4e Sean Anderson 2022-09-02  1256           mac_dev->phy_node = 
of_node_get(mac_node);
302376feec1d4e Sean Anderson 2022-09-02  1257           phy = 
of_phy_find_device(mac_dev->phy_node);
302376feec1d4e Sean Anderson 2022-09-02  1258           if (!phy) {
302376feec1d4e Sean Anderson 2022-09-02  1259                   err = -EINVAL;
302376feec1d4e Sean Anderson 2022-09-02  1260                   
of_node_put(mac_dev->phy_node);
302376feec1d4e Sean Anderson 2022-09-02  1261                   goto 
_return_fixed_link_free;
302376feec1d4e Sean Anderson 2022-09-02  1262           }
302376feec1d4e Sean Anderson 2022-09-02  1263  
302376feec1d4e Sean Anderson 2022-09-02  1264           fixed_link->link = 
phy->link;
302376feec1d4e Sean Anderson 2022-09-02  1265           fixed_link->speed = 
phy->speed;
302376feec1d4e Sean Anderson 2022-09-02  1266           fixed_link->duplex = 
phy->duplex;
302376feec1d4e Sean Anderson 2022-09-02  1267           fixed_link->pause = 
phy->pause;
302376feec1d4e Sean Anderson 2022-09-02  1268           fixed_link->asym_pause 
= phy->asym_pause;
302376feec1d4e Sean Anderson 2022-09-02  1269  
302376feec1d4e Sean Anderson 2022-09-02  1270           
put_device(&phy->mdio.dev);
302376feec1d4e Sean Anderson 2022-09-02  1271  
302376feec1d4e Sean Anderson 2022-09-02  1272           err = 
memac_cfg_fixed_link(mac_dev->fman_mac, fixed_link);
302376feec1d4e Sean Anderson 2022-09-02  1273           if (err < 0)
302376feec1d4e Sean Anderson 2022-09-02  1274                   goto 
_return_fixed_link_free;
302376feec1d4e Sean Anderson 2022-09-02  1275   }
302376feec1d4e Sean Anderson 2022-09-02  1276  
302376feec1d4e Sean Anderson 2022-09-02  1277   err = 
memac_init(mac_dev->fman_mac);
302376feec1d4e Sean Anderson 2022-09-02  1278   if (err < 0)
302376feec1d4e Sean Anderson 2022-09-02  1279           goto 
_return_fixed_link_free;
302376feec1d4e Sean Anderson 2022-09-02  1280  
302376feec1d4e Sean Anderson 2022-09-02  1281   dev_info(mac_dev->dev, "FMan 
MEMAC\n");
302376feec1d4e Sean Anderson 2022-09-02  1282  
302376feec1d4e Sean Anderson 2022-09-02  1283   goto _return;
302376feec1d4e Sean Anderson 2022-09-02  1284  
302376feec1d4e Sean Anderson 2022-09-02  1285  _return_fixed_link_free:
302376feec1d4e Sean Anderson 2022-09-02 @1286   kfree(fixed_link);

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-le...@lists.01.org

Reply via email to