Re: [PATCH 3/6] sep: Add interfaces for the new functions

From: Hillf Danton
Date: Fri Feb 10 2012 - 08:53:49 EST


Hello Alan

On Fri, Feb 10, 2012 at 9:52 PM, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
> From: Mark A. Allyn <mark.a.allyn@xxxxxxxxx>
>
> [This is picked out of the differences between the upstream driver and
> Âthe staging driver. I'm resolving the differences as a series of updates -AC]
>
> Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
> ---
>
> Âdrivers/staging/sep/sep_main.c | Â 60 +++++++++++++++++++++++++++++++++-------
> Â1 files changed, 49 insertions(+), 11 deletions(-)
>
>
> diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
> index 7d7cb48..1fcabca 100644
> --- a/drivers/staging/sep/sep_main.c
> +++ b/drivers/staging/sep/sep_main.c
> @@ -3067,9 +3067,13 @@ static long sep_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>
> Â Â Â Âswitch (cmd) {
> Â Â Â Âcase SEP_IOCSENDSEPCOMMAND:
> + Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev,
> + Â Â Â Â Â Â Â Â Â Â Â "[PID%d] SEP_IOCSENDSEPCOMMAND start\n",
> + Â Â Â Â Â Â Â Â Â Â Â current->pid);
> Â Â Â Â Â Â Â Âif (1 == test_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â&call_status->status)) {
> - Â Â Â Â Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev, "[PID%d] send msg already done\n",
> + Â Â Â Â Â Â Â Â Â Â Â dev_warn(&sep->pdev->dev,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "[PID%d] send msg already done\n",
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âcurrent->pid);
> Â Â Â Â Â Â Â Â Â Â Â Âerror = -EPROTO;
> Â Â Â Â Â Â Â Â Â Â Â Âgoto end_function;
> @@ -3079,37 +3083,71 @@ static long sep_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> Â Â Â Â Â Â Â Âif (!error)
> Â Â Â Â Â Â Â Â Â Â Â Âset_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â&call_status->status);
> - Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCSENDSEPCOMMAND end\n",
> + Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev,
> + Â Â Â Â Â Â Â Â Â Â Â "[PID%d] SEP_IOCSENDSEPCOMMAND end\n",
> Â Â Â Â Â Â Â Â Â Â Â Âcurrent->pid);
> Â Â Â Â Â Â Â Âbreak;
> Â Â Â Âcase SEP_IOCENDTRANSACTION:
> + Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev,
> + Â Â Â Â Â Â Â Â Â Â Â "[PID%d] SEP_IOCENDTRANSACTION start\n",
> + Â Â Â Â Â Â Â Â Â Â Â current->pid);
> Â Â Â Â Â Â Â Âerror = sep_end_transaction_handler(sep, dma_ctx, call_status,
> - Â Â Â Â Â Â Â Â Â Â Â my_queue_elem);
> - Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCENDTRANSACTION end\n",
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â my_queue_elem);
> + Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev,
> + Â Â Â Â Â Â Â Â Â Â Â "[PID%d] SEP_IOCENDTRANSACTION end\n",
> Â Â Â Â Â Â Â Â Â Â Â Âcurrent->pid);
> Â Â Â Â Â Â Â Âbreak;
> Â Â Â Âcase SEP_IOCPREPAREDCB:
> + Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev,
> + Â Â Â Â Â Â Â Â Â Â Â "[PID%d] SEP_IOCPREPAREDCB start\n",
> + Â Â Â Â Â Â Â Â Â Â Â current->pid);
> + Â Â Â case SEP_IOCPREPAREDCB_SECURE_DMA:
> + Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev,
> + Â Â Â Â Â Â Â Â Â Â Â "[PID%d] SEP_IOCPREPAREDCB_SECURE_DMA start\n",
> + Â Â Â Â Â Â Â Â Â Â Â current->pid);
> Â Â Â Â Â Â Â Âif (1 == test_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â&call_status->status)) {
> - Â Â Â Â Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "[PID%d] dcb preparation needed before send msg\n",
> + Â Â Â Â Â Â Â Â Â Â Â dev_warn(&sep->pdev->dev,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "[PID%d] dcb prep needed before send msg\n",
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âcurrent->pid);
> Â Â Â Â Â Â Â Â Â Â Â Âerror = -EPROTO;
> Â Â Â Â Â Â Â Â Â Â Â Âgoto end_function;
> Â Â Â Â Â Â Â Â}
>
> Â Â Â Â Â Â Â Âif (!arg) {
> - Â Â Â Â Â Â Â Â Â Â Â dev_dbg(&sep->pdev->dev,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "[PID%d] dcb prep null arg\n", current->pid);
> - Â Â Â Â Â Â Â Â Â Â Â error = -EINVAL;
> + Â Â Â Â Â Â Â Â Â Â Â dev_warn(&sep->pdev->dev,
> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "[PID%d] dcb null arg\n", current->pid);
> + Â Â Â Â Â Â Â Â Â Â Â error = EINVAL;

Typo if error = -EPROTO allowed?
N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i