mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: dougthompson@xmission.com
Cc: qingtao.cao@windriver.com, jharan@Brocade.COM,
	dougthompson@xmission.com, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH 1/3] edac: fix worktodo to proper cast
Date: Wed, 8 Apr 2009 08:49:26 +0200	[thread overview]
Message-ID: <20090408084926.59855f77@hyperion.delvare> (raw)
In-Reply-To: <49dbe5ae.cLzjokemOI4s7lyb%dougthompson@xmission.com>

On Tue, 07 Apr 2009 17:45:50 -0600, dougthompson@xmission.com wrote:
> From: Jean Delvare <khali@linux-fr.org>
> 
> The edac-core driver includes code which assumes that the work_struct
> which is included in every delayed_work is the first member of that
> structure. This is currently the case but might change in the future,
> so use to_delayed_work() instead, which doesn't make such an
> assumption.

Please just use my original patch instead, which really uses
to_delayed_work() as the description says. to_delayed_work() is
available in kernel 2.6.30-rc1.

> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> Signed-off-by: Doug Thompson <dougthompson@xmission.com>
> ---
> drivers/edac/edac_device.c |    2 +-
> drivers/edac/edac_mc.c     |    2 +-
> drivers/edac/edac_pci.c    |    2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6.29/drivers/edac/edac_device.c
> ===================================================================
> --- linux-2.6.29.orig/drivers/edac/edac_device.c
> +++ linux-2.6.29/drivers/edac/edac_device.c
> @@ -389,7 +389,8 @@ static void del_edac_device_from_global_
>   */
>  static void edac_device_workq_function(struct work_struct *work_req)
>  {
> -	struct delayed_work *d_work = (struct delayed_work *)work_req;
> +	struct delayed_work *d_work =
> +			container_of(work_req, struct delayed_work, work);
>  	struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work);
>  
>  	mutex_lock(&device_ctls_mutex);
> Index: linux-2.6.29/drivers/edac/edac_mc.c
> ===================================================================
> --- linux-2.6.29.orig/drivers/edac/edac_mc.c
> +++ linux-2.6.29/drivers/edac/edac_mc.c
> @@ -260,7 +260,8 @@ static int edac_mc_assert_error_check_an
>   */
>  static void edac_mc_workq_function(struct work_struct *work_req)
>  {
> -	struct delayed_work *d_work = (struct delayed_work *)work_req;
> +	struct delayed_work *d_work =
> +			container_of(work_req, struct delayed_work, work);
>  	struct mem_ctl_info *mci = to_edac_mem_ctl_work(d_work);
>  
>  	mutex_lock(&mem_ctls_mutex);
> Index: linux-2.6.29/drivers/edac/edac_pci.c
> ===================================================================
> --- linux-2.6.29.orig/drivers/edac/edac_pci.c
> +++ linux-2.6.29/drivers/edac/edac_pci.c
> @@ -232,7 +232,8 @@ EXPORT_SYMBOL_GPL(edac_pci_find);
>   */
>  static void edac_pci_workq_function(struct work_struct *work_req)
>  {
> -	struct delayed_work *d_work = (struct delayed_work *)work_req;
> +	struct delayed_work *d_work =
> +			container_of(work_req, struct delayed_work, work);
>  	struct edac_pci_ctl_info *pci = to_edac_pci_ctl_work(d_work);
>  	int msec;
>  	unsigned long delay;


-- 
Jean Delvare

      reply	other threads:[~2009-04-08  6:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-07 23:45 dougthompson
2009-04-08  6:49 ` Jean Delvare [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=20090408084926.59855f77@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=akpm@linux-foundation.org \
    --cc=dougthompson@xmission.com \
    --cc=jharan@Brocade.COM \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qingtao.cao@windriver.com \
    /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

Powered by JetHome