All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: kernel-janitors@vger.kernel.org
Subject: [linus:master 98/99] drivers/base/firmware_class.c:72:28: sparse: incorrect type in argument 2 (diff
Date: Thu, 04 Oct 2012 07:06:23 +0000	[thread overview]
Message-ID: <20121004070623.GA31473@localhost> (raw)

Hi Linus,

FYI, there are new sparse warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3a494318b14b1bc0f59d2d6ce84c505c74d82d2a
commit: abb139e75c2cdbb955e840d6331cb5863e409d0e [98/99] firmware: teach the kernel to load firmware files directly from the filesystem

+ drivers/base/firmware_class.c:72:28: sparse: incorrect type in argument 2 (different address spaces)
  drivers/base/firmware_class.c:72:28:    expected char [noderef] <asn:1>*<noident>
  drivers/base/firmware_class.c:72:28:    got char *[assigned] buf

Shall we use kernel_read() in place of vfs_read()?

vim +72 drivers/base/firmware_class.c

abb139e7 (Linus Torvalds 2012-10-03  59) static bool fw_read_file_contents(struct file *file, struct firmware *fw)
abb139e7 (Linus Torvalds 2012-10-03  60) {
abb139e7 (Linus Torvalds 2012-10-03  61) 	loff_t pos;
abb139e7 (Linus Torvalds 2012-10-03  62) 	long size;
abb139e7 (Linus Torvalds 2012-10-03  63) 	char *buf;
abb139e7 (Linus Torvalds 2012-10-03  64) 
abb139e7 (Linus Torvalds 2012-10-03  65) 	size = fw_file_size(file);
abb139e7 (Linus Torvalds 2012-10-03  66) 	if (size < 0)
abb139e7 (Linus Torvalds 2012-10-03  67) 		return false;
abb139e7 (Linus Torvalds 2012-10-03  68) 	buf = vmalloc(size);
abb139e7 (Linus Torvalds 2012-10-03  69) 	if (!buf)
abb139e7 (Linus Torvalds 2012-10-03  70) 		return false;
abb139e7 (Linus Torvalds 2012-10-03  71) 	pos = 0;
abb139e7 (Linus Torvalds 2012-10-03 @72) 	if (vfs_read(file, buf, size, &pos) != size) {
abb139e7 (Linus Torvalds 2012-10-03  73) 		vfree(buf);
abb139e7 (Linus Torvalds 2012-10-03  74) 		return false;
abb139e7 (Linus Torvalds 2012-10-03  75) 	}
abb139e7 (Linus Torvalds 2012-10-03  76) 	fw->data = buf;
abb139e7 (Linus Torvalds 2012-10-03  77) 	fw->size = size;
abb139e7 (Linus Torvalds 2012-10-03  78) 	return true;
abb139e7 (Linus Torvalds 2012-10-03  79) }
abb139e7 (Linus Torvalds 2012-10-03  80) 

---
0-DAY kernel build testing backend         Open Source Technology Center
Fengguang Wu, Yuanhan Liu                              Intel Corporation

             reply	other threads:[~2012-10-04  7:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-04  7:06 Fengguang Wu [this message]
2012-10-04 16:22 ` [linus:master 98/99] drivers/base/firmware_class.c:72:28: sparse: incorrect type in argument 2 ( Linus Torvalds

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=20121004070623.GA31473@localhost \
    --to=fengguang.wu@intel.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.