All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Bjorn Helgaas <helgaas@kernel.org>,
	Jingoo Han <jingoohan1@gmail.com>,
	Gustavo Pimentel <gustavo.pimentel@synopsys.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Rob Herring <robh+dt@kernel.org>
Cc: <linux-pci@vger.kernel.org>
Subject: Re: sparse warnings
Date: Thu, 1 Oct 2020 11:59:22 +0530	[thread overview]
Message-ID: <6638a699-6476-d449-afa5-9be7799fe9a5@ti.com> (raw)
In-Reply-To: <20200930223928.GA2643255@bjorn-Precision-5520>

+RobH, Lorenzo

Hi Bjorn,

On 01/10/20 4:09 am, Bjorn Helgaas wrote:
> On Wed, Jul 29, 2020 at 02:48:15PM -0500, Bjorn Helgaas wrote:
>> Just FYI, I see the following sparse warnings (among others):
>>
>>   $ make C=2 drivers/pci/
>>
>>   drivers/pci/endpoint/functions/pci-epf-test.c:288:24: warning: incorrect type in argument 1 (different address spaces)
>>   drivers/pci/endpoint/functions/pci-epf-test.c:288:24:    expected void *to
>>   drivers/pci/endpoint/functions/pci-epf-test.c:288:24:    got void [noderef] <asn:2> *[assigned] dst_addr
>>   drivers/pci/endpoint/functions/pci-epf-test.c:288:34: warning: incorrect type in argument 2 (different address spaces)
>>   drivers/pci/endpoint/functions/pci-epf-test.c:288:34:    expected void const *from
>>   drivers/pci/endpoint/functions/pci-epf-test.c:288:34:    got void [noderef] <asn:2> *[assigned] src_addr
>>
>>   drivers/pci/controller/dwc/pcie-designware.c:447:52: warning: cast truncates bits from constant value (ffffffff7fffffff becomes 7fffffff)
>>
>> It'd be nice to fix these if it's practical.
> 
> Any ideas about these?

pci-epf-test here uses memcpy() to copy data from one memory mapped IO
address to other memory mapped IO address. Other places in this driver
uses memcpy_fromio() and memcpy_toio() since only one of them is memory
mapped IO address.

So the option is to either use memcpy_fromio() to copy data from IO to
temporary buffer and then use memcpy_toio() to copy data from the
temporary buffer to the memory mapped IO or create a new variant
[memcpy_fromtoio()?] that takes both memory mapped IO address.

Thanks
Kishon

  reply	other threads:[~2020-10-01  6:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 19:48 sparse warnings Bjorn Helgaas
2020-09-30 22:39 ` Bjorn Helgaas
2020-10-01  6:29   ` Kishon Vijay Abraham I [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-08-04 21:36 Michael S. Tsirkin
2008-10-28 15:57 Johannes Berg
2008-10-29  8:06 ` Holger Schurig
2008-09-11 10:46 Johannes Berg
2008-06-27 19:52 Sparse warnings Larry Finger
2008-06-27 19:53 ` Pavel Roskin

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=6638a699-6476-d449-afa5-9be7799fe9a5@ti.com \
    --to=kishon@ti.com \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=helgaas@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robh+dt@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.