All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: x86/intel/quark: Add Isolated Memory Regions for Quark X1000
Date: Wed, 04 Mar 2015 15:06:49 +0000	[thread overview]
Message-ID: <20150304150648.GA26187@mwanda> (raw)

Hello Bryan O'Donoghue,

The patch 28a375df16c2: "x86/intel/quark: Add Isolated Memory Regions
for Quark X1000" from Jan 30, 2015, leads to the following static
checker warning:

	arch/x86/platform/intel-quark/imr.c:229 imr_dbgfs_state_show()
	warn: should '(imr.addr_lo) << 8' be a 64 bit type?

arch/x86/platform/intel-quark/imr.c
   205  static int imr_dbgfs_state_show(struct seq_file *s, void *unused)
   206  {
   207          phys_addr_t base;
   208          phys_addr_t end;
   209          int i;
   210          struct imr_device *idev = s->private;
   211          struct imr_regs imr;
   212          size_t size;
   213          int ret = -ENODEV;
   214  
   215          mutex_lock(&idev->lock);
   216  
   217          for (i = 0; i < idev->max_imr; i++) {
   218  
   219                  ret = imr_read(idev, i, &imr);
   220                  if (ret)
   221                          break;
   222  
   223                  /*
   224                   * Remember to add IMR_ALIGN bytes to size to indicate the
   225                   * inherent IMR_ALIGN size bytes contained in the masked away
   226                   * lower ten bits.
   227                   */
   228                  if (imr_is_enabled(&imr)) {
   229                          base = imr_to_phys(imr.addr_lo);

The imr_to_phys() macro should probably include a cast to phys_addr_t if
only to silence the static checker warnings.

   230                          end = imr_to_phys(imr.addr_hi) + IMR_MASK;
   231                  } else {
   232                          base = 0;
   233                          end = 0;
   234                  }
   235                  size = end - base;
   236                  seq_printf(s, "imr%02i: base=%pa, end=%pa, size=0x%08zx "
   237                             "rmask=0x%08x, wmask=0x%08x, %s, %s\n", i,
   238                             &base, &end, size, imr.rmask, imr.wmask,
   239                             imr_is_enabled(&imr) ? "enabled " : "disabled",
   240                             imr.addr_lo & IMR_LOCK ? "locked" : "unlocked");
   241          }
   242  
   243          mutex_unlock(&idev->lock);
   244          return ret;
   245  }


regards,
dan carpenter

             reply	other threads:[~2015-03-04 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 15:06 Dan Carpenter [this message]
2015-03-04 16:41 ` x86/intel/quark: Add Isolated Memory Regions for Quark X1000 Bryan O'Donoghue

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=20150304150648.GA26187@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.