linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <fengguang.wu@intel.com>
To: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: kbuild-all@01.org, Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [next:master 6753/6952] drivers/hwmon/w83795.c:312:16: sparse: incorrect type in initializer (different modifiers)
Date: Wed, 25 Mar 2015 18:25:01 +0800	[thread overview]
Message-ID: <201503251859.Sj2lt6iy%fengguang.wu@intel.com> (raw)

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   b2dfdab2f61ed5eb57317136d6efbb973f79210e
commit: f8e5b425f5eea40759a0ccc17caa7f4d660d0d4a [6753/6952] hwmon: (w83795) use find_closest_descending() in pwm_freq_to_reg()
reproduce:
  # apt-get install sparse
  git checkout f8e5b425f5eea40759a0ccc17caa7f4d660d0d4a
  make ARCH=x86_64 allmodconfig
  make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/hwmon/w83795.c:312:16: sparse: incorrect type in initializer (different modifiers)
   drivers/hwmon/w83795.c:312:16:    expected unsigned short *__fc_a
   drivers/hwmon/w83795.c:312:16:    got unsigned short static const [toplevel] *<noident>

vim +312 drivers/hwmon/w83795.c

   296		unsigned long base_clock;
   297	
   298		if (reg & 0x80) {
   299			base_clock = clkin * 1000 / ((clkin == 48000) ? 384 : 256);
   300			return base_clock / ((reg & 0x7f) + 1);
   301		} else
   302			return pwm_freq_cksel0[reg & 0x0f];
   303	}
   304	
   305	static u8 pwm_freq_to_reg(unsigned long val, u16 clkin)
   306	{
   307		unsigned long base_clock;
   308		u8 reg0, reg1;
   309		unsigned long best0, best1;
   310	
   311		/* Best fit for cksel = 0 */
 > 312		reg0 = find_closest_descending(val, pwm_freq_cksel0,
   313					       ARRAY_SIZE(pwm_freq_cksel0));
   314		if (val < 375)	/* cksel = 1 can't beat this */
   315			return reg0;
   316		best0 = pwm_freq_cksel0[reg0];
   317	
   318		/* Best fit for cksel = 1 */
   319		base_clock = clkin * 1000 / ((clkin == 48000) ? 384 : 256);
   320		reg1 = clamp_val(DIV_ROUND_CLOSEST(base_clock, val), 1, 128);

---
0-DAY kernel test infrastructure                Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

                 reply	other threads:[~2015-03-25 10:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201503251859.Sj2lt6iy%fengguang.wu@intel.com \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox