From: Mayank Rana <mrana@codeaurora.org>
To: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: David Brown <davidb@codeaurora.org>,
Daniel Walker <dwalker@fifo99.com>,
Bryan Huntsman <bryanh@codeaurora.org>,
linux-arm-msm@vger.kernel.org
Subject: Re: type inconsistency in drivers/tty/serial/msm_serial_hs.c
Date: Mon, 28 Nov 2011 12:02:30 +0530 [thread overview]
Message-ID: <4ED32AFE.7080807@codeaurora.org> (raw)
In-Reply-To: <CAKb7Uvg7iMm9OFr=5nNrwmBSa2jFCvBmuMgg0Q259Zi7hfuwXQ@mail.gmail.com>
Hi Ilia,
On 11/26/2011 1:28 AM, Ilia Mirkin wrote:
> Hello,
>
> I've been playing around with spatch, and noticed the following type
> inconsistency. I thought about just fixing it myself, but since this
> involves DMA's to the device, I decided it was best to leave it up to
> someone who had a device or at least understood how the whole thing
> was supposed to function.
>
> In uartdm_init_port, around line 1540:
>
> tx->command_ptr_ptr = kmalloc(sizeof(u32 *), GFP_KERNEL | __GFP_DMA);
>
> But command_ptr_ptr is a u32*, which means that the kzalloc should be
> for sizeof(u32). This has further implications for the dma_map_single
> a few lines down (and corresponding dma_unmap_single's).
>
> Or perhaps it should go the other way, and command_ptr_ptr should be a
> u32** (as its name might suggest), with no other changes being
> required. Although this seems unlikely given the usage around line
> 812:
>
> *tx->command_ptr_ptr = CMD_PTR_LP | DMOV_CMD_ADDR(tx->mapped_cmd_ptr);
>
> where CMD_PTR_LP is 1<<31. I guess none of this is a particularly big
> deal since sizeof(u32) == sizeof(u32*) == sizeof(u32**) on a 32-bit
> platform... but it's nice to be consistent.
Yes. It seems that there is type inconsistency in both Tx and Rx Command
ptr_ptr.
The first approach which you have mentioned seems to be way to go with
it. I will be sending the fix for the same, once able to verify the change.
Thanks for pointing out this.
>
> -ilia
>
> P.S. Are you guys missing an entry in MAINTAINERS for this file? I
> just noticed that you supported msm_serial.c, figured this was
> related. If not, please repoint me in the right direction.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Regards,
_-_Mayank Rana_-_
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
prev parent reply other threads:[~2011-11-28 6:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-25 19:58 type inconsistency in drivers/tty/serial/msm_serial_hs.c Ilia Mirkin
2011-11-25 22:27 ` David Brown
2011-11-28 6:32 ` Mayank Rana [this message]
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=4ED32AFE.7080807@codeaurora.org \
--to=mrana@codeaurora.org \
--cc=bryanh@codeaurora.org \
--cc=davidb@codeaurora.org \
--cc=dwalker@fifo99.com \
--cc=imirkin@alum.mit.edu \
--cc=linux-arm-msm@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.