From: Dan Carpenter <dan.carpenter@oracle.com>
To: ching <ching2048@areca.com.tw>
Cc: jbottomley@parallels.com, thenzl@redhat.com,
linux-scsi@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1.0 14/16] arcmsr: fix sparse checking error
Date: Fri, 2 May 2014 12:13:15 +0300 [thread overview]
Message-ID: <20140502091315.GG4963@mwanda> (raw)
In-Reply-To: <1398857906.6930.59.camel@localhost>
On Wed, Apr 30, 2014 at 07:38:26PM +0800, ching wrote:
> From: Ching<ching2048@areca.com.tw>
>
> Fix sparse utility checking errors.
>
I was expecting that this patch would add __iomem annotations throughout
but in several places it actually removes calls to readl() and writel()
as well.
> case ACB_ADAPTER_TYPE_C:{
> - struct MessageUnit_C *reg = (struct MessageUnit_C *)acb->pmuC;
> + struct MessageUnit_C __iomem *reg = acb->pmuC;
> /* disable all outbound interrupt */
> orig_mask = readl(®->host_int_mask); /* disable outbound message0 int */
> writel(orig_mask|ARCMSR_HBCMU_ALL_INTMASKENABLE, ®->host_int_mask);v
> @@ -1085,8 +1085,9 @@ static void arcmsr_done4abort_postqueue(
> /*clear all outbound posted Q*/
> writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); /* clear doorbell interrupt */
> for (i = 0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) {
> - if ((flag_ccb = readl(®->done_qbuffer[i])) != 0) {
> - writel(0, ®->done_qbuffer[i]);
> + flag_ccb = reg->done_qbuffer[i];
> + if (flag_ccb != 0) {
> + reg->done_qbuffer[i] = 0;
> pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset+(flag_ccb << 5));/*frame must be 32 bytes aligned*/
> pCCB = container_of(pARCMSR_CDB, struct CommandControlBlock, arcmsr_cdb);
> error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE0) ? true : false;
I don't know the hardware, but it doesn't even seem to make sense to me.
if "reg" is an __iomem pointer surely an offset into reg is an iomem
pointer as well.
I am worried that this introduces a bug.
regards,
dan carpenter
next prev parent reply other threads:[~2014-05-02 9:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-30 11:38 [PATCH v1.0 14/16] arcmsr: fix sparse checking error ching
2014-05-02 9:13 ` Dan Carpenter [this message]
2014-05-05 4:10 ` 黃清隆
2014-05-05 12:10 ` Dan Carpenter
2014-05-05 12:10 ` Dan Carpenter
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=20140502091315.GG4963@mwanda \
--to=dan.carpenter@oracle.com \
--cc=ching2048@areca.com.tw \
--cc=jbottomley@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=thenzl@redhat.com \
/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.