public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: wei_wang@realsil.com.cn
Cc: gregkh@linuxfoundation.org, devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] drivers/mmc/host: Add realtek sdmmc interface driver
Date: Thu, 19 Jul 2012 14:26:36 +0200	[thread overview]
Message-ID: <1752528.JW0yMAA2dq@linux-lqwf.site> (raw)
In-Reply-To: <1342691718-23199-1-git-send-email-wei_wang@realsil.com.cn>

On Thursday 19 July 2012 17:55:18 wei_wang@realsil.com.cn wrote:

> +static void sd_normal_rw(struct realtek_sdmmc *host, struct mmc_request *mrq)
> +{
> +	struct mmc_command *cmd = mrq->cmd;
> +	struct mmc_data *data = mrq->data;
> +	u8 _cmd[5], *buf;
> +
> +	_cmd[0] = 0x40 | (u8)cmd->opcode;
> +	_cmd[1] = (u8)(cmd->arg >> 24);
> +	_cmd[2] = (u8)(cmd->arg >> 16);
> +	_cmd[3] = (u8)(cmd->arg >> 8);
> +	_cmd[4] = (u8)cmd->arg;

Please use the predefined macro for endianness conversion.

> +	buf = kzalloc(data->blksz, GFP_KERNEL);

1. You must handle a failure to allocate a buffer
2. You must use GFP_NOIO as you are in a block driver

	Regards
		Oliver


  reply	other threads:[~2012-07-19 12:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19  9:55 [PATCH 3/3] drivers/mmc/host: Add realtek sdmmc interface driver wei_wang
2012-07-19 12:26 ` Oliver Neukum [this message]
2012-07-20  1:48   ` wwang
  -- strict thread matches above, loose matches on Subject: below --
2012-07-20 10:09 wei_wang
2012-07-23  9:42 wei_wang
2012-07-23 16:52 ` Borislav Petkov
2012-07-25  3:02 wei_wang
2012-07-31  7:42 wei_wang
2012-07-31 15:22 ` Borislav Petkov
2012-07-31 18:11 ` Borislav Petkov

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=1752528.JW0yMAA2dq@linux-lqwf.site \
    --to=oliver@neukum.org \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wei_wang@realsil.com.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox