[bug report] drivers/net: support hdlc function for QE-UCC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Zhao Qiang,

The patch c19b6d246a35: "drivers/net: support hdlc function for
QE-UCC" from Jun 6, 2016, leads to the following static checker
warning:

	drivers/net/wan/fsl_ucc_hdlc.c:164 uhdlc_init()
	warn: unsigned 'priv->ucc_pram_offset' is never less than zero.

drivers/net/wan/fsl_ucc_hdlc.c
   159  
   160          /* Alloc parameter ram for ucc hdlc */
   161          priv->ucc_pram_offset = qe_muram_alloc(sizeof(priv->ucc_pram),
   162                                  ALIGNMENT_OF_UCC_HDLC_PRAM);
   163  
   164          if (priv->ucc_pram_offset < 0) {

This is slightly complicated what's happening here.  qe_muram_alloc()
returns negatives but casted to an unsigned long, then we assign it to
priv->ucc_pram_offset which is a u32.

   165                  dev_err(priv->dev, "Can not allocate MURAM for hdlc prameter.\n");
   166                  ret = -ENOMEM;
   167                  goto free_tx_bd;
   168          }
   169  

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux