* [PATCH 0/1] staging: slicoss: slicoss: fix sparse warnings
@ 2016-09-13 3:23 Peng Sun
2016-09-13 3:23 ` [PATCH 1/1] staging: slicoss: slicoss.c: fix different address space " Peng Sun
0 siblings, 1 reply; 4+ messages in thread
From: Peng Sun @ 2016-09-13 3:23 UTC (permalink / raw)
To: liodot, charrer, gregkh; +Cc: linux-kernel, Peng Sun
linux-next next-20160909, commit-id d221eb9f
Peng Sun (1):
staging: slicoss: slicoss.c: fix different address space sparse
warnings
drivers/staging/slicoss/slicoss.c | 125 +++++++++++++++++++++++++++-----------
1 file changed, 91 insertions(+), 34 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] staging: slicoss: slicoss.c: fix different address space sparse warnings
2016-09-13 3:23 [PATCH 0/1] staging: slicoss: slicoss: fix sparse warnings Peng Sun
@ 2016-09-13 3:23 ` Peng Sun
2016-09-13 3:57 ` kbuild test robot
2016-09-13 6:01 ` Greg KH
0 siblings, 2 replies; 4+ messages in thread
From: Peng Sun @ 2016-09-13 3:23 UTC (permalink / raw)
To: liodot, charrer, gregkh; +Cc: linux-kernel, Peng Sun
Signed-off-by: Peng Sun <sironhide0null@gmail.com>
---
drivers/staging/slicoss/slicoss.c | 125 +++++++++++++++++++++++++++-----------
1 file changed, 91 insertions(+), 34 deletions(-)
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 21280a3..6996143 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -924,8 +924,9 @@ err_unlock_irq:
static void slic_link_upr_complete(struct adapter *adapter, u32 isr)
{
struct slic_shmemory *sm = &adapter->shmem;
- struct slic_shmem_data *sm_data = sm->shmem_data;
- u32 lst = sm_data->lnkstatus;
+ struct slic_shmem_data __iomem *sm_data = sm->shmem_data;
+ u32 lst = ioread32((char __iomem *)sm_data +
+ offsetof(struct slic_shmem_data, lnkstatus));
uint linkup;
unsigned char linkspeed;
unsigned char linkduplex;
@@ -1004,8 +1005,10 @@ static void slic_upr_request_complete(struct adapter *adapter, u32 isr)
switch (upr->upr_request) {
case SLIC_UPR_STATS: {
struct slic_shmemory *sm = &adapter->shmem;
- struct slic_shmem_data *sm_data = sm->shmem_data;
- struct slic_stats *stats = &sm_data->stats;
+ struct slic_shmem_data __iomem *sm_data = sm->shmem_data;
+ struct slic_stats __iomem *stats = (struct slic_stats __iomem *)
+ ((char __iomem *)sm_data +
+ offsetof(struct slic_shmem_data, stats));
struct slic_stats *old = &adapter->inicstats_prev;
struct slicnet_stats *stst = &adapter->slic_stats;
@@ -1015,49 +1018,91 @@ static void slic_upr_request_complete(struct adapter *adapter, u32 isr)
break;
}
- UPDATE_STATS_GB(stst->tcp.xmit_tcp_segs, stats->xmit_tcp_segs,
+ UPDATE_STATS_GB(stst->tcp.xmit_tcp_segs,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ xmit_tcp_segs)),
old->xmit_tcp_segs);
- UPDATE_STATS_GB(stst->tcp.xmit_tcp_bytes, stats->xmit_tcp_bytes,
+ UPDATE_STATS_GB(stst->tcp.xmit_tcp_bytes,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ xmit_tcp_bytes)),
old->xmit_tcp_bytes);
- UPDATE_STATS_GB(stst->tcp.rcv_tcp_segs, stats->rcv_tcp_segs,
+ UPDATE_STATS_GB(stst->tcp.rcv_tcp_segs,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ rcv_tcp_segs)),
old->rcv_tcp_segs);
- UPDATE_STATS_GB(stst->tcp.rcv_tcp_bytes, stats->rcv_tcp_bytes,
+ UPDATE_STATS_GB(stst->tcp.rcv_tcp_bytes,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ rcv_tcp_bytes)),
old->rcv_tcp_bytes);
- UPDATE_STATS_GB(stst->iface.xmt_bytes, stats->xmit_bytes,
+ UPDATE_STATS_GB(stst->iface.xmt_bytes,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ xmit_bytes)),
old->xmit_bytes);
- UPDATE_STATS_GB(stst->iface.xmt_ucast, stats->xmit_unicasts,
+ UPDATE_STATS_GB(stst->iface.xmt_ucast,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ xmit_unicasts)),
old->xmit_unicasts);
- UPDATE_STATS_GB(stst->iface.rcv_bytes, stats->rcv_bytes,
+ UPDATE_STATS_GB(stst->iface.rcv_bytes,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ rcv_bytes)),
old->rcv_bytes);
- UPDATE_STATS_GB(stst->iface.rcv_ucast, stats->rcv_unicasts,
+ UPDATE_STATS_GB(stst->iface.rcv_ucast,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ rcv_unicasts)),
old->rcv_unicasts);
- UPDATE_STATS_GB(stst->iface.xmt_errors, stats->xmit_collisions,
+ UPDATE_STATS_GB(stst->iface.xmt_errors,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ xmit_collisions)),
old->xmit_collisions);
UPDATE_STATS_GB(stst->iface.xmt_errors,
- stats->xmit_excess_collisions,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ xmit_excess_collisions)),
old->xmit_excess_collisions);
- UPDATE_STATS_GB(stst->iface.xmt_errors, stats->xmit_other_error,
+ UPDATE_STATS_GB(stst->iface.xmt_errors,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ xmit_other_error)),
old->xmit_other_error);
- UPDATE_STATS_GB(stst->iface.rcv_errors, stats->rcv_other_error,
+ UPDATE_STATS_GB(stst->iface.rcv_errors,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ rcv_other_error)),
old->rcv_other_error);
- UPDATE_STATS_GB(stst->iface.rcv_discards, stats->rcv_drops,
+ UPDATE_STATS_GB(stst->iface.rcv_discards,
+ readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ rcv_drops)),
old->rcv_drops);
- if (stats->rcv_drops > old->rcv_drops)
- adapter->rcv_drops += (stats->rcv_drops -
- old->rcv_drops);
+ if (readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ rcv_drops)) > old->rcv_drops)
+ adapter->rcv_drops +=
+ (readq((char __iomem *)stats +
+ offsetof(struct slic_stats,
+ rcv_drops)) - old->rcv_drops);
memcpy_fromio(old, stats, sizeof(*stats));
break;
}
@@ -1682,9 +1727,10 @@ static void slic_init_cleanup(struct adapter *adapter)
if (adapter->shmem.shmem_data) {
struct slic_shmemory *sm = &adapter->shmem;
- struct slic_shmem_data *sm_data = sm->shmem_data;
+ struct slic_shmem_data __iomem *sm_data = sm->shmem_data;
- pci_free_consistent(adapter->pcidev, sizeof(*sm_data), sm_data,
+ pci_free_consistent(adapter->pcidev, sizeof(*sm_data),
+ (void __force *)sm_data,
sm->isr_phaddr);
}
@@ -2071,15 +2117,18 @@ static irqreturn_t slic_interrupt(int irq, void *dev_id)
struct net_device *dev = dev_id;
struct adapter *adapter = netdev_priv(dev);
struct slic_shmemory *sm = &adapter->shmem;
- struct slic_shmem_data *sm_data = sm->shmem_data;
+ struct slic_shmem_data __iomem *sm_data = sm->shmem_data;
u32 isr;
- if (sm_data->isr) {
+ if (ioread32((char __iomem *)sm_data +
+ offsetof(struct slic_shmem_data, isr))) {
slic_write32(adapter, SLIC_REG_ICR, ICR_INT_MASK);
slic_flush_write(adapter);
- isr = sm_data->isr;
- sm_data->isr = 0;
+ isr = ioread32((char __iomem *)sm_data +
+ offsetof(struct slic_shmem_data, isr));
+ iowrite32(0, (char __iomem *)sm_data +
+ offsetof(struct slic_shmem_data, isr));
adapter->num_isrs++;
switch (adapter->card->state) {
case CARD_UP:
@@ -2214,7 +2263,7 @@ static int slic_if_init(struct adapter *adapter, unsigned long *flags)
struct sliccard *card = adapter->card;
struct net_device *dev = adapter->netdev;
struct slic_shmemory *sm = &adapter->shmem;
- struct slic_shmem_data *sm_data = sm->shmem_data;
+ struct slic_shmem_data __iomem *sm_data = sm->shmem_data;
int rc;
/* adapter should be down at this point */
@@ -2298,7 +2347,8 @@ static int slic_if_init(struct adapter *adapter, unsigned long *flags)
/*
* clear any pending events, then enable interrupts
*/
- sm_data->isr = 0;
+ iowrite32(0, (char __iomem *)sm_data +
+ offsetof(struct slic_shmem_data, isr));
slic_write32(adapter, SLIC_REG_ISR, 0);
slic_write32(adapter, SLIC_REG_ICR, ICR_INT_ON);
@@ -2587,7 +2637,7 @@ static void slic_config_pci(struct pci_dev *pcidev)
static int slic_card_init(struct sliccard *card, struct adapter *adapter)
{
struct slic_shmemory *sm = &adapter->shmem;
- struct slic_shmem_data *sm_data = sm->shmem_data;
+ struct slic_shmem_data __iomem *sm_data = sm->shmem_data;
struct slic_eeprom *peeprom;
struct oslic_eeprom *pOeeprom;
dma_addr_t phys_config;
@@ -2650,9 +2700,14 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
}
for (;;) {
- if (sm_data->isr) {
- if (sm_data->isr & ISR_UPC) {
- sm_data->isr = 0;
+ if (ioread32((char __iomem *)sm_data +
+ offsetof(struct slic_shmem_data, isr))) {
+ if (ioread32((char __iomem *)sm_data +
+ offsetof(struct slic_shmem_data,
+ isr)) & ISR_UPC) {
+ iowrite32(0, (char __iomem *)sm_data +
+ offsetof(struct
+ slic_shmem_data, isr));
slic_write64(adapter, SLIC_REG_ISP, 0,
0);
slic_write32(adapter, SLIC_REG_ISR, 0);
@@ -2662,7 +2717,9 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
break;
}
- sm_data->isr = 0;
+ iowrite32(0, (char __iomem *)sm_data +
+ offsetof(struct slic_shmem_data,
+ isr));
slic_write32(adapter, SLIC_REG_ISR, 0);
slic_flush_write(adapter);
} else {
@@ -2867,7 +2924,7 @@ static int slic_init_adapter(struct net_device *netdev,
if (!sm_data)
return -ENOMEM;
- sm->shmem_data = sm_data;
+ sm->shmem_data = (struct slic_shmem_data __force __iomem *)sm_data;
sm->isr_phaddr = phaddr;
sm->lnkstatus_phaddr = phaddr + offsetof(struct slic_shmem_data,
lnkstatus);
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] staging: slicoss: slicoss.c: fix different address space sparse warnings
2016-09-13 3:23 ` [PATCH 1/1] staging: slicoss: slicoss.c: fix different address space " Peng Sun
@ 2016-09-13 3:57 ` kbuild test robot
2016-09-13 6:01 ` Greg KH
1 sibling, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2016-09-13 3:57 UTC (permalink / raw)
To: Peng Sun; +Cc: kbuild-all, liodot, charrer, gregkh, linux-kernel, Peng Sun
[-- Attachment #1: Type: text/plain, Size: 1965 bytes --]
Hi Peng,
[auto build test ERROR on staging/staging-testing]
[also build test ERROR on next-20160912]
[cannot apply to v4.8-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]
url: https://github.com/0day-ci/linux/commits/Peng-Sun/staging-slicoss-slicoss-c-fix-different-address-space-sparse-warnings/20160913-112524
config: i386-randconfig-x010-201637 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
In file included from drivers/staging/slicoss/slicoss.c:97:0:
drivers/staging/slicoss/slicoss.c: In function 'slic_upr_request_complete':
>> drivers/staging/slicoss/slicoss.c:1022:5: error: implicit declaration of function 'readq' [-Werror=implicit-function-declaration]
readq((char __iomem *)stats +
^
drivers/staging/slicoss/slic.h:552:19: note: in definition of macro 'UPDATE_STATS_GB'
(largestat) += ((newstat) - (oldstat)); \
^~~~~~~
cc1: some warnings being treated as errors
vim +/readq +1022 drivers/staging/slicoss/slicoss.c
1016 dev_err(&adapter->netdev->dev,
1017 "SLIC_UPR_STATS command failed isr[%x]\n", isr);
1018 break;
1019 }
1020
1021 UPDATE_STATS_GB(stst->tcp.xmit_tcp_segs,
> 1022 readq((char __iomem *)stats +
1023 offsetof(struct slic_stats,
1024 xmit_tcp_segs)),
1025 old->xmit_tcp_segs);
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 28414 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] staging: slicoss: slicoss.c: fix different address space sparse warnings
2016-09-13 3:23 ` [PATCH 1/1] staging: slicoss: slicoss.c: fix different address space " Peng Sun
2016-09-13 3:57 ` kbuild test robot
@ 2016-09-13 6:01 ` Greg KH
1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2016-09-13 6:01 UTC (permalink / raw)
To: Peng Sun; +Cc: liodot, charrer, linux-kernel
On Mon, Sep 12, 2016 at 08:23:04PM -0700, Peng Sun wrote:
> Signed-off-by: Peng Sun <sironhide0null@gmail.com>
> ---
> drivers/staging/slicoss/slicoss.c | 125 +++++++++++++++++++++++++++-----------
> 1 file changed, 91 insertions(+), 34 deletions(-)
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- You did not specify a description of why the patch is needed, or
possibly, any description at all, in the email body. Please read the
section entitled "The canonical patch format" in the kernel file,
Documentation/SubmittingPatches for what is needed in order to
properly describe the change.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-13 6:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13 3:23 [PATCH 0/1] staging: slicoss: slicoss: fix sparse warnings Peng Sun
2016-09-13 3:23 ` [PATCH 1/1] staging: slicoss: slicoss.c: fix different address space " Peng Sun
2016-09-13 3:57 ` kbuild test robot
2016-09-13 6:01 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome