All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] drivers/net: support hdlc function for QE-UCC
Date: Wed, 03 Aug 2016 14:13:31 +0000	[thread overview]
Message-ID: <20160803141331.GA9097@mwanda> (raw)
In-Reply-To: <20160712234919.GA23061@mwanda>

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

      parent reply	other threads:[~2016-08-03 14:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 23:49 [bug report] drivers/net: support hdlc function for QE-UCC Dan Carpenter
2016-07-13  2:22 ` Qiang Zhao
2016-08-03 14:13 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160803141331.GA9097@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.