mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Avoid implicit constant truncation
@ 2010-03-03  0:01 imunsie
  2010-03-03  0:06 ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: imunsie @ 2010-03-03  0:01 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ian Munsie, Jesse Barnes, Matthew Wilcox, Alex Chiang,
	Bjorn Helgaas, Kenji Kaneshige, linux-pci

From: Ian Munsie <imunsie@au.ibm.com>

When building on 64 bit platforms, the compiler throws the following
warning:

drivers/pci/probe.c:197: warning: large integer implicitly truncated to unsigned type

This patch adds an explicit truncation to silence the compiler warning.

Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
---
 drivers/pci/probe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 2a94309..c5d9668 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -195,7 +195,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
 		res->flags |= pci_calc_resource_flags(l) | IORESOURCE_SIZEALIGN;
 		if (type == pci_bar_io) {
 			l &= PCI_BASE_ADDRESS_IO_MASK;
-			mask = PCI_BASE_ADDRESS_IO_MASK & IO_SPACE_LIMIT;
+			mask = (u32)(PCI_BASE_ADDRESS_IO_MASK & IO_SPACE_LIMIT);
 		} else {
 			l &= PCI_BASE_ADDRESS_MEM_MASK;
 			mask = (u32)PCI_BASE_ADDRESS_MEM_MASK;
-- 
1.6.6.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Avoid implicit constant truncation
  2010-03-03  0:01 [PATCH] Avoid implicit constant truncation imunsie
@ 2010-03-03  0:06 ` Randy Dunlap
  2010-03-03  0:09   ` Ian Munsie
  2010-03-03  0:26   ` Jesse Barnes
  0 siblings, 2 replies; 4+ messages in thread
From: Randy Dunlap @ 2010-03-03  0:06 UTC (permalink / raw)
  To: imunsie
  Cc: linux-kernel, Jesse Barnes, Matthew Wilcox, Alex Chiang,
	Bjorn Helgaas, Kenji Kaneshige, linux-pci

On 03/02/10 16:01, imunsie@au1.ibm.com wrote:
> From: Ian Munsie <imunsie@au.ibm.com>
> 
> When building on 64 bit platforms, the compiler throws the following
> warning:
> 
> drivers/pci/probe.c:197: warning: large integer implicitly truncated to unsigned type
> 
> This patch adds an explicit truncation to silence the compiler warning.


Please see/read/use Documentation/SubmittingPatches.  E.g.:

The canonical patch subject line is:

    Subject: [PATCH 001/123] subsystem: summary phrase

I.e., the subject: should tell us that this is a PCI: patch.

(or even pci: -- i don't care which)

thanks,
-- 
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Avoid implicit constant truncation
  2010-03-03  0:06 ` Randy Dunlap
@ 2010-03-03  0:09   ` Ian Munsie
  2010-03-03  0:26   ` Jesse Barnes
  1 sibling, 0 replies; 4+ messages in thread
From: Ian Munsie @ 2010-03-03  0:09 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel

Randy Dunlap writes:

> The canonical patch subject line is:
> 
>     Subject: [PATCH 001/123] subsystem: summary phrase
> 
> I.e., the subject: should tell us that this is a PCI: patch.
> 
> (or even pci: -- i don't care which)

Appologies and thanks for the pointer - I'm new to this.

Cheers,
-Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Avoid implicit constant truncation
  2010-03-03  0:06 ` Randy Dunlap
  2010-03-03  0:09   ` Ian Munsie
@ 2010-03-03  0:26   ` Jesse Barnes
  1 sibling, 0 replies; 4+ messages in thread
From: Jesse Barnes @ 2010-03-03  0:26 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: imunsie, linux-kernel, Matthew Wilcox, Alex Chiang,
	Bjorn Helgaas, Kenji Kaneshige, linux-pci

On Tue, 02 Mar 2010 16:06:33 -0800
Randy Dunlap <rdunlap@xenotime.net> wrote:

> On 03/02/10 16:01, imunsie@au1.ibm.com wrote:
> > From: Ian Munsie <imunsie@au.ibm.com>
> > 
> > When building on 64 bit platforms, the compiler throws the following
> > warning:
> > 
> > drivers/pci/probe.c:197: warning: large integer implicitly
> > truncated to unsigned type
> > 
> > This patch adds an explicit truncation to silence the compiler
> > warning.
> 
> 
> Please see/read/use Documentation/SubmittingPatches.  E.g.:
> 
> The canonical patch subject line is:
> 
>     Subject: [PATCH 001/123] subsystem: summary phrase
> 
> I.e., the subject: should tell us that this is a PCI: patch.
> 
> (or even pci: -- i don't care which)

No need to resubmit though; I usually have to fix up the summary and
changelog a bit when applying anyway.

That said, this patch rings a bell; I think the warning is signalling a
real bug in the ppc code.  IIRC Ben was going to look at it awhile
back, but I think it's mostly harmless so it's probably low on his list.

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-03  0:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-03  0:01 [PATCH] Avoid implicit constant truncation imunsie
2010-03-03  0:06 ` Randy Dunlap
2010-03-03  0:09   ` Ian Munsie
2010-03-03  0:26   ` Jesse Barnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®