lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 15 Jan 2009 16:05:27 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Adrian Hunter <ext-adrian.hunter@...ia.com>
Cc:	drzeus-mmc@...eus.cx, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] MMC: Add Extended CSD as a device attribute

On Wed, 14 Jan 2009 18:23:35 +0200
Adrian Hunter <ext-adrian.hunter@...ia.com> wrote:
>
> Subject: [PATCH] MMC: Add Extended CSD as a device attribute

Why?  There must be some *reason* for making this change.  Presumably
that reason is obvious to yourself and Pierre, but what about the rest
of us?

> 
> Signed-off-by: Adrian Hunter <ext-adrian.hunter@...ia.com>

It would take only 30 seconds to write a changelog for this patch :(

>  drivers/mmc/core/mmc.c |   29 +++++++++++++++++++++++++++++
>  1 files changed, 29 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 3f5b089..29291de 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -259,6 +259,34 @@ MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name);
>  MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);
>  MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial);
>  
> +static ssize_t mmc_ext_csd_show(struct device *dev, struct device_attribute *attr, char *buf)
> +{
> +	struct mmc_card *card = container_of(dev, struct mmc_card, dev);
> +	ssize_t n = 0;
> +	u8 *ext_csd;
> +	int err, i;
> +
> +	ext_csd = kmalloc(512, GFP_KERNEL);
> +	if (!ext_csd)
> +		return 0;
> +
> +	mmc_claim_host(card->host);
> +	err = mmc_send_ext_csd(card, ext_csd);
> +	mmc_release_host(card->host);
> +
> +	if (!err) {
> +		for (i = 511; i >= 0; i--)
> +			n += sprintf(buf + n, "%02x", (unsigned)ext_csd[i]);

The cast isn't actually needed.

> +		n += sprintf(buf + n, "\n");
> +	}
> +
> +	kfree(ext_csd);
> +
> +	return n;
> +}
> +
> +static DEVICE_ATTR(ext_csd, S_IRUGO, mmc_ext_csd_show, NULL);
> +
>  static struct attribute *mmc_std_attrs[] = {
>  	&dev_attr_cid.attr,
>  	&dev_attr_csd.attr,
> @@ -269,6 +297,7 @@ static struct attribute *mmc_std_attrs[] = {
>  	&dev_attr_name.attr,
>  	&dev_attr_oemid.attr,
>  	&dev_attr_serial.attr,
> +	&dev_attr_ext_csd.attr,
>  	NULL,
>  };

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ