All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Phong Tran <tranmanphong@gmail.com>
Cc: Larry.Finger@lwfinger.net, jakub.kicinski@netronome.com,
	kvalo@codeaurora.org, Wright.Feng@cypress.com,
	arend.vanspriel@broadcom.com, davem@davemloft.net,
	emmanuel.grumbach@intel.com, franky.lin@broadcom.com,
	johannes.berg@intel.com, linux-kernel@vger.kernel.org,
	linux-wireless@vger.kernel.org, luciano.coelho@intel.com,
	netdev@vger.kernel.org, p.figiel@camlintechnologies.com,
	pieter-paul.giesberts@broadcom.com, pkshih@realtek.com,
	rafal@milecki.pl, sara.sharon@intel.com,
	shahar.s.matityahu@intel.com, yhchuang@realtek.com,
	yuehaibing@huawei.com
Subject: Re: [Patch v2 2/4] ipw2x00: Fix -Wcast-function-type
Date: Tue, 26 Nov 2019 21:05:44 -0800	[thread overview]
Message-ID: <201911262105.5AE5669F9E@keescook> (raw)
In-Reply-To: <20191126175529.10909-3-tranmanphong@gmail.com>

On Wed, Nov 27, 2019 at 12:55:27AM +0700, Phong Tran wrote:
> correct usage prototype of callback in tasklet_init().
> Report by https://github.com/KSPP/linux/issues/20
> 
> Signed-off-by: Phong Tran <tranmanphong@gmail.com>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  drivers/net/wireless/intel/ipw2x00/ipw2100.c | 7 ++++---
>  drivers/net/wireless/intel/ipw2x00/ipw2200.c | 5 +++--
>  2 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2100.c b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
> index 8dfbaff2d1fe..a162146a43a7 100644
> --- a/drivers/net/wireless/intel/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/intel/ipw2x00/ipw2100.c
> @@ -3206,8 +3206,9 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
>  	}
>  }
>  
> -static void ipw2100_irq_tasklet(struct ipw2100_priv *priv)
> +static void ipw2100_irq_tasklet(unsigned long data)
>  {
> +	struct ipw2100_priv *priv = (struct ipw2100_priv *)data;
>  	struct net_device *dev = priv->net_dev;
>  	unsigned long flags;
>  	u32 inta, tmp;
> @@ -6007,7 +6008,7 @@ static void ipw2100_rf_kill(struct work_struct *work)
>  	spin_unlock_irqrestore(&priv->low_lock, flags);
>  }
>  
> -static void ipw2100_irq_tasklet(struct ipw2100_priv *priv);
> +static void ipw2100_irq_tasklet(unsigned long data);
>  
>  static const struct net_device_ops ipw2100_netdev_ops = {
>  	.ndo_open		= ipw2100_open,
> @@ -6137,7 +6138,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
>  	INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
>  	INIT_DELAYED_WORK(&priv->scan_event, ipw2100_scan_event);
>  
> -	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
> +	tasklet_init(&priv->irq_tasklet,
>  		     ipw2100_irq_tasklet, (unsigned long)priv);
>  
>  	/* NOTE:  We do not start the deferred work for status checks yet */
> diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> index ed0f06532d5e..ac5f797fb1ad 100644
> --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> @@ -1945,8 +1945,9 @@ static void notify_wx_assoc_event(struct ipw_priv *priv)
>  	wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
>  }
>  
> -static void ipw_irq_tasklet(struct ipw_priv *priv)
> +static void ipw_irq_tasklet(unsigned long data)
>  {
> +	struct ipw_priv *priv = (struct ipw_priv *)data;
>  	u32 inta, inta_mask, handled = 0;
>  	unsigned long flags;
>  	int rc = 0;
> @@ -10680,7 +10681,7 @@ static int ipw_setup_deferred_work(struct ipw_priv *priv)
>  	INIT_WORK(&priv->qos_activate, ipw_bg_qos_activate);
>  #endif				/* CONFIG_IPW2200_QOS */
>  
> -	tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
> +	tasklet_init(&priv->irq_tasklet,
>  		     ipw_irq_tasklet, (unsigned long)priv);
>  
>  	return ret;
> -- 
> 2.20.1
> 

-- 
Kees Cook

  reply	other threads:[~2019-11-27  5:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 15:02 [PATCH 1/3] drivers: net: b43legacy: Fix -Wcast-function-type Phong Tran
2019-11-25 15:02 ` [PATCH 2/3] drivers: net: intel: " Phong Tran
2019-11-25 17:30   ` Larry Finger
2019-11-25 17:56     ` Kalle Valo
2019-11-25 15:02 ` [PATCH 3/3] drivers: net: realtek: " Phong Tran
2019-11-25 17:33   ` Larry Finger
2019-11-25 17:26 ` [PATCH 1/3] drivers: net: b43legacy: " Larry Finger
2019-11-25 17:28   ` Jakub Kicinski
2019-11-25 17:29   ` Kalle Valo
2019-11-26 17:55 ` [Patch v2 0/4] wireless: " Phong Tran
2019-11-26 17:55   ` [Patch v2 1/4] b43legacy: " Phong Tran
2019-11-27  5:05     ` Kees Cook
2019-12-18 18:55     ` Kalle Valo
2019-11-26 17:55   ` [Patch v2 2/4] ipw2x00: " Phong Tran
2019-11-27  5:05     ` Kees Cook [this message]
2019-11-26 17:55   ` [Patch v2 3/4] iwlegacy: " Phong Tran
2019-11-27  5:05     ` Kees Cook
2019-11-26 17:55   ` [Patch v2 4/4] rtlwifi: rtl_pci: " Phong Tran
2019-11-27  5:05     ` Kees Cook

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=201911262105.5AE5669F9E@keescook \
    --to=keescook@chromium.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=Wright.Feng@cypress.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=emmanuel.grumbach@intel.com \
    --cc=franky.lin@broadcom.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=johannes.berg@intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=p.figiel@camlintechnologies.com \
    --cc=pieter-paul.giesberts@broadcom.com \
    --cc=pkshih@realtek.com \
    --cc=rafal@milecki.pl \
    --cc=sara.sharon@intel.com \
    --cc=shahar.s.matityahu@intel.com \
    --cc=tranmanphong@gmail.com \
    --cc=yhchuang@realtek.com \
    --cc=yuehaibing@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.