LKML Archive on
help / color / mirror / Atom feed
From: Andrew Morton <>
To: Magnus Damm <>
Subject: Re: [PATCH] sm501: Add uart support
Date: Tue, 12 Feb 2008 16:04:07 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, 08 Feb 2008 18:57:42 +0900
Magnus Damm <> wrote:

>  	smdev = kzalloc(sizeof(struct sm501_device) +
> -			sizeof(struct resource) * res_count, GFP_KERNEL);
> +			(sizeof(struct resource) * res_count) +
> +			platform_data_size, GFP_KERNEL);
> ...
> +		smdev->pdev.resource = (struct resource *)(smdev+1);

So this driver plays party tricks with memory allocation and the C type

We could at least add

	struct resource resources[0];

to the end of `struct sm501_device' to avoid the type abuse.  Or we could
even get radical and splurge four bytes on a `struct resource *'.  But
please, not this.

Oh well. A pre-existing problem.

      parent reply	other threads:[~2008-02-13  0:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08  9:57 Magnus Damm
2008-02-12 11:51 ` Ben Dooks
2008-02-13  0:04 ` Andrew Morton [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH] sm501: Add uart support' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).