* [PATCH 01/18] arm: remove cast for kzalloc return value
@ 2013-03-12 4:42 Zhang Yanfei
2013-03-12 4:47 ` [PATCH 02/18] ia64: remove cast for kmalloc " Zhang Yanfei
` (16 more replies)
0 siblings, 17 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 4:42 UTC (permalink / raw)
To: linux, Andrew Morton; +Cc: linux-kernel, linux-arm-kernel
remove cast for kzalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
---
arch/arm/kernel/topology.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index 79282eb..f10316b 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -100,7 +100,7 @@ static void __init parse_dt_topology(void)
int alloc_size, cpu = 0;
alloc_size = nr_cpu_ids * sizeof(struct cpu_capacity);
- cpu_capacity = (struct cpu_capacity *)kzalloc(alloc_size, GFP_NOWAIT);
+ cpu_capacity = kzalloc(alloc_size, GFP_NOWAIT);
while ((cn = of_find_node_by_type(cn, "cpu"))) {
const u32 *rate, *reg;
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 02/18] ia64: remove cast for kmalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
@ 2013-03-12 4:47 ` Zhang Yanfei
2013-03-12 4:54 ` [PATCH 03/18] powerpc: remove cast for kmalloc/kzalloc " Zhang Yanfei
` (15 subsequent siblings)
16 siblings, 0 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 4:47 UTC (permalink / raw)
To: Tony Luck, Fenghua Yu, Andrew Morton; +Cc: linux-kernel, linux-ia64
remove cast for kmalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-ia64@vger.kernel.org
---
arch/ia64/kernel/mca_drv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index 9392e02..94f8bf7 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -349,7 +349,7 @@ init_record_index_pools(void)
/* - 3 - */
slidx_pool.max_idx = (rec_max_size/sect_min_size) * 2 + 1;
- slidx_pool.buffer = (slidx_list_t *)
+ slidx_pool.buffer =
kmalloc(slidx_pool.max_idx * sizeof(slidx_list_t), GFP_KERNEL);
return slidx_pool.buffer ? 0 : -ENOMEM;
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 03/18] powerpc: remove cast for kmalloc/kzalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
2013-03-12 4:47 ` [PATCH 02/18] ia64: remove cast for kmalloc " Zhang Yanfei
@ 2013-03-12 4:54 ` Zhang Yanfei
2013-03-12 4:58 ` [PATCH 04/18] x86: platform: mrst: remove cast for kmalloc " Zhang Yanfei
` (14 subsequent siblings)
16 siblings, 0 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 4:54 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Andrew Morton
Cc: linuxppc-dev, linux-kernel
remove cast for kmalloc/kzalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/kernel/nvram_64.c | 3 +--
arch/powerpc/kvm/book3s_pr.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index bec1e93..48fbc2b 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -511,8 +511,7 @@ int __init nvram_scan_partitions(void)
"detected: 0-length partition\n");
goto out;
}
- tmp_part = (struct nvram_partition *)
- kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
+ tmp_part = kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
err = -ENOMEM;
if (!tmp_part) {
printk(KERN_ERR "nvram_scan_partitions: kmalloc failed\n");
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 5e93438..dbdc15a 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -1039,7 +1039,7 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
if (!vcpu_book3s)
goto out;
- vcpu_book3s->shadow_vcpu = (struct kvmppc_book3s_shadow_vcpu *)
+ vcpu_book3s->shadow_vcpu =
kzalloc(sizeof(*vcpu_book3s->shadow_vcpu), GFP_KERNEL);
if (!vcpu_book3s->shadow_vcpu)
goto free_vcpu;
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 04/18] x86: platform: mrst: remove cast for kmalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
2013-03-12 4:47 ` [PATCH 02/18] ia64: remove cast for kmalloc " Zhang Yanfei
2013-03-12 4:54 ` [PATCH 03/18] powerpc: remove cast for kmalloc/kzalloc " Zhang Yanfei
@ 2013-03-12 4:58 ` Zhang Yanfei
2013-03-12 8:50 ` [tip:x86/platform] x86/platform/intel/mrst: Remove cast for kmalloc() " tip-bot for Zhang Yanfei
2013-03-12 5:03 ` [PATCH 05/18] driver: staging: csr: remove cast for kmalloc " Zhang Yanfei
` (13 subsequent siblings)
16 siblings, 1 reply; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 4:58 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Andrew Morton
Cc: x86, linux-kernel
remove cast for kmalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "x86@kernel.org" <x86@kernel.org>
---
arch/x86/platform/mrst/mrst.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
index e31bcd8..a0a0a43 100644
--- a/arch/x86/platform/mrst/mrst.c
+++ b/arch/x86/platform/mrst/mrst.c
@@ -356,8 +356,7 @@ static int __init sfi_parse_gpio(struct sfi_table_header *table)
num = SFI_GET_NUM_ENTRIES(sb, struct sfi_gpio_table_entry);
pentry = (struct sfi_gpio_table_entry *)sb->pentry;
- gpio_table = (struct sfi_gpio_table_entry *)
- kmalloc(num * sizeof(*pentry), GFP_KERNEL);
+ gpio_table = kmalloc(num * sizeof(*pentry), GFP_KERNEL);
if (!gpio_table)
return -1;
memcpy(gpio_table, pentry, num * sizeof(*pentry));
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 05/18] driver: staging: csr: remove cast for kmalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (2 preceding siblings ...)
2013-03-12 4:58 ` [PATCH 04/18] x86: platform: mrst: remove cast for kmalloc " Zhang Yanfei
@ 2013-03-12 5:03 ` Zhang Yanfei
2013-03-12 5:07 ` [PATCH 06/18] driver: gpu: drm: i915: remove cast for kzalloc " Zhang Yanfei
` (12 subsequent siblings)
16 siblings, 0 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:03 UTC (permalink / raw)
To: Greg Kroah-Hartman, Andrew Morton; +Cc: devel, linux-kernel
remove cast for kmalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: devel@driverdev.osuosl.org
---
drivers/staging/csr/drv.c | 4 ++--
drivers/staging/csr/netdev.c | 2 +-
drivers/staging/csr/sdio_mmc.c | 3 +--
drivers/staging/csr/sme_native.c | 2 +-
drivers/staging/csr/unifi_pdu_processing.c | 4 ++--
5 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/csr/drv.c b/drivers/staging/csr/drv.c
index 3bd52fd..5520d65 100644
--- a/drivers/staging/csr/drv.c
+++ b/drivers/staging/csr/drv.c
@@ -1815,7 +1815,7 @@ udi_log_event(ul_client_t *pcli,
}
/* Allocate log structure plus actual signal. */
- logptr = (udi_log_t *)kmalloc(sizeof(udi_log_t) + total_len, GFP_KERNEL);
+ logptr = kmalloc(sizeof(udi_log_t) + total_len, GFP_KERNEL);
if (logptr == NULL) {
printk(KERN_ERR
@@ -1890,7 +1890,7 @@ uf_sme_queue_message(unifi_priv_t *priv, u8 *buffer, int length)
}
/* Allocate log structure plus actual signal. */
- logptr = (udi_log_t *)kmalloc(sizeof(udi_log_t) + length, GFP_ATOMIC);
+ logptr = kmalloc(sizeof(udi_log_t) + length, GFP_ATOMIC);
if (logptr == NULL) {
unifi_error(priv, "Failed to allocate %d bytes for an SME message\n",
sizeof(udi_log_t) + length);
diff --git a/drivers/staging/csr/netdev.c b/drivers/staging/csr/netdev.c
index 7dad26f..a0177d9 100644
--- a/drivers/staging/csr/netdev.c
+++ b/drivers/staging/csr/netdev.c
@@ -2365,7 +2365,7 @@ unifi_rx(unifi_priv_t *priv, CSR_SIGNAL *signal, bulk_data_param_t *bulkdata)
rx_buffered_packets_t *rx_q_item;
struct list_head *rx_list;
- rx_q_item = (rx_buffered_packets_t *)kmalloc(sizeof(rx_buffered_packets_t),
+ rx_q_item = kmalloc(sizeof(rx_buffered_packets_t),
GFP_KERNEL);
if (rx_q_item == NULL) {
unifi_error(priv, "%s: Failed to allocate %d bytes for rx packet record\n",
diff --git a/drivers/staging/csr/sdio_mmc.c b/drivers/staging/csr/sdio_mmc.c
index b6a16de..30271d3 100644
--- a/drivers/staging/csr/sdio_mmc.c
+++ b/drivers/staging/csr/sdio_mmc.c
@@ -1031,8 +1031,7 @@ uf_glue_sdio_probe(struct sdio_func *func,
sdio_func_id(func), instance);
/* Allocate context */
- sdio_ctx = (CsrSdioFunction *)kmalloc(sizeof(CsrSdioFunction),
- GFP_KERNEL);
+ sdio_ctx = kmalloc(sizeof(CsrSdioFunction), GFP_KERNEL);
if (sdio_ctx == NULL) {
sdio_release_host(func);
return -ENOMEM;
diff --git a/drivers/staging/csr/sme_native.c b/drivers/staging/csr/sme_native.c
index 525fe1b..ca55249 100644
--- a/drivers/staging/csr/sme_native.c
+++ b/drivers/staging/csr/sme_native.c
@@ -273,7 +273,7 @@ sme_native_log_event(ul_client_t *pcli,
}
/* Allocate log structure plus actual signal. */
- logptr = (udi_log_t *)kmalloc(sizeof(udi_log_t) + total_len, GFP_KERNEL);
+ logptr = kmalloc(sizeof(udi_log_t) + total_len, GFP_KERNEL);
if (logptr == NULL) {
unifi_error(priv,
diff --git a/drivers/staging/csr/unifi_pdu_processing.c b/drivers/staging/csr/unifi_pdu_processing.c
index 95efc36..bf7c00a 100644
--- a/drivers/staging/csr/unifi_pdu_processing.c
+++ b/drivers/staging/csr/unifi_pdu_processing.c
@@ -403,7 +403,7 @@ CsrResult enque_tx_data_pdu(unifi_priv_t *priv, bulk_data_param_t *bulkdata,
- tx_q_item = (tx_buffered_packets_t *)kmalloc(sizeof(tx_buffered_packets_t), GFP_ATOMIC);
+ tx_q_item = kmalloc(sizeof(tx_buffered_packets_t), GFP_ATOMIC);
if (tx_q_item == NULL) {
unifi_error(priv,
"Failed to allocate %d bytes for tx packet record\n",
@@ -3282,7 +3282,7 @@ void add_to_send_cfm_list(unifi_priv_t * priv,
{
tx_buffered_packets_t *send_cfm_list_item = NULL;
- send_cfm_list_item = (tx_buffered_packets_t *) kmalloc(sizeof(tx_buffered_packets_t), GFP_ATOMIC);
+ send_cfm_list_item = kmalloc(sizeof(tx_buffered_packets_t), GFP_ATOMIC);
if(send_cfm_list_item == NULL){
unifi_warning(priv, "%s: Failed to allocate memory for new list item \n");
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 06/18] driver: gpu: drm: i915: remove cast for kzalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (3 preceding siblings ...)
2013-03-12 5:03 ` [PATCH 05/18] driver: staging: csr: remove cast for kmalloc " Zhang Yanfei
@ 2013-03-12 5:07 ` Zhang Yanfei
2013-03-12 5:10 ` [PATCH 07/18] driver: hv: remove cast for kmalloc " Zhang Yanfei
` (11 subsequent siblings)
16 siblings, 0 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:07 UTC (permalink / raw)
To: David Airlie, Andrew Morton; +Cc: dri-devel, linux-kernel
remove cast for kzalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
---
drivers/gpu/drm/i915/intel_sdvo.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index d07a8cd..78413ec 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -451,7 +451,7 @@ static bool intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd,
int i, ret = true;
/* Would be simpler to allocate both in one go ? */
- buf = (u8 *)kzalloc(args_len * 2 + 2, GFP_KERNEL);
+ buf = kzalloc(args_len * 2 + 2, GFP_KERNEL);
if (!buf)
return false;
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 07/18] driver: hv: remove cast for kmalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (4 preceding siblings ...)
2013-03-12 5:07 ` [PATCH 06/18] driver: gpu: drm: i915: remove cast for kzalloc " Zhang Yanfei
@ 2013-03-12 5:10 ` Zhang Yanfei
2013-03-12 5:13 ` [PATCH 08/18] driver: isdn: capi: " Zhang Yanfei
` (10 subsequent siblings)
16 siblings, 0 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:10 UTC (permalink / raw)
To: K. Y. Srinivasan, Haiyang Zhang, Andrew Morton; +Cc: devel, linux-kernel
remove cast for kmalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: devel@linuxdriverproject.org
---
drivers/hv/hv.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index 7311589..ae49237 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -289,9 +289,8 @@ void hv_synic_init(void *arg)
/* Check the version */
rdmsrl(HV_X64_MSR_SVERSION, version);
- hv_context.event_dpc[cpu] = (struct tasklet_struct *)
- kmalloc(sizeof(struct tasklet_struct),
- GFP_ATOMIC);
+ hv_context.event_dpc[cpu] = kmalloc(sizeof(struct tasklet_struct),
+ GFP_ATOMIC);
if (hv_context.event_dpc[cpu] == NULL) {
pr_err("Unable to allocate event dpc\n");
goto cleanup;
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 08/18] driver: isdn: capi: remove cast for kmalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (5 preceding siblings ...)
2013-03-12 5:10 ` [PATCH 07/18] driver: hv: remove cast for kmalloc " Zhang Yanfei
@ 2013-03-12 5:13 ` Zhang Yanfei
2013-03-12 15:41 ` David Miller
2013-03-12 5:15 ` [PATCH 09/18] driver: isdn: hisax: remove cast for kmalloc/kzalloc " Zhang Yanfei
` (9 subsequent siblings)
16 siblings, 1 reply; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:13 UTC (permalink / raw)
To: Karsten Keil, Andrew Morton; +Cc: netdev, linux-kernel
remove cast for kmalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
---
drivers/isdn/capi/capidrv.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index 832bc80..cc9f192 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -469,8 +469,7 @@ static int capidrv_add_ack(struct capidrv_ncci *nccip,
{
struct ncci_datahandle_queue *n, **pp;
- n = (struct ncci_datahandle_queue *)
- kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
+ n = kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
if (!n) {
printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n");
return -1;
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 09/18] driver: isdn: hisax: remove cast for kmalloc/kzalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (6 preceding siblings ...)
2013-03-12 5:13 ` [PATCH 08/18] driver: isdn: capi: " Zhang Yanfei
@ 2013-03-12 5:15 ` Zhang Yanfei
2013-03-12 15:41 ` David Miller
2013-03-12 5:18 ` [PATCH 10/18] driver: s390: block: remove cast for kzalloc " Zhang Yanfei
` (8 subsequent siblings)
16 siblings, 1 reply; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:15 UTC (permalink / raw)
To: Karsten Keil, Andrew Morton; +Cc: netdev, linux-kernel
remove cast for kmalloc/kzalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
---
drivers/isdn/hisax/fsm.c | 2 +-
drivers/isdn/hisax/hfc_sx.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/isdn/hisax/fsm.c b/drivers/isdn/hisax/fsm.c
index 1bb2910..c7a9471 100644
--- a/drivers/isdn/hisax/fsm.c
+++ b/drivers/isdn/hisax/fsm.c
@@ -26,7 +26,7 @@ FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount)
{
int i;
- fsm->jumpmatrix = (FSMFNPTR *)
+ fsm->jumpmatrix =
kzalloc(sizeof(FSMFNPTR) * fsm->state_count * fsm->event_count, GFP_KERNEL);
if (!fsm->jumpmatrix)
return -ENOMEM;
diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c
index 90f34ae..dc4574f 100644
--- a/drivers/isdn/hisax/hfc_sx.c
+++ b/drivers/isdn/hisax/hfc_sx.c
@@ -1479,7 +1479,7 @@ int setup_hfcsx(struct IsdnCard *card)
release_region(cs->hw.hfcsx.base, 2);
return (0);
}
- if (!(cs->hw.hfcsx.extra = (void *)
+ if (!(cs->hw.hfcsx.extra =
kmalloc(sizeof(struct hfcsx_extra), GFP_ATOMIC))) {
release_region(cs->hw.hfcsx.base, 2);
printk(KERN_WARNING "HFC-SX: unable to allocate memory\n");
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 10/18] driver: s390: block: remove cast for kzalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (7 preceding siblings ...)
2013-03-12 5:15 ` [PATCH 09/18] driver: isdn: hisax: remove cast for kmalloc/kzalloc " Zhang Yanfei
@ 2013-03-12 5:18 ` Zhang Yanfei
2013-03-12 7:22 ` Heiko Carstens
2013-03-12 5:22 ` [PATCH 11/18] driver: s390: net: " Zhang Yanfei
` (7 subsequent siblings)
16 siblings, 1 reply; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:18 UTC (permalink / raw)
To: Martin Schwidefsky, Heiko Carstens, Andrew Morton; +Cc: linux390, linux-kernel
remove cast for kzalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux390@de.ibm.com
---
drivers/s390/block/dasd_devmap.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index c196827..a71bb8a 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -410,8 +410,7 @@ dasd_add_busid(const char *bus_id, int features)
struct dasd_devmap *devmap, *new, *tmp;
int hash;
- new = (struct dasd_devmap *)
- kzalloc(sizeof(struct dasd_devmap), GFP_KERNEL);
+ new = kzalloc(sizeof(struct dasd_devmap), GFP_KERNEL);
if (!new)
return ERR_PTR(-ENOMEM);
spin_lock(&dasd_devmap_lock);
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 11/18] driver: s390: net: remove cast for kzalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (8 preceding siblings ...)
2013-03-12 5:18 ` [PATCH 10/18] driver: s390: block: remove cast for kzalloc " Zhang Yanfei
@ 2013-03-12 5:22 ` Zhang Yanfei
2013-03-12 7:25 ` Heiko Carstens
2013-03-12 5:25 ` [PATCH 12/18] driver: scsi: remove cast for kmalloc/kzalloc " Zhang Yanfei
` (6 subsequent siblings)
16 siblings, 1 reply; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:22 UTC (permalink / raw)
To: Ursula Braun, Frank Blaschka, Martin Schwidefsky, Heiko Carstens,
Andrew Morton
Cc: linux390, linux-s390, linux-kernel
remove cast for kzalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Ursula Braun <ursula.braun@de.ibm.com>
Cc: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
---
drivers/s390/net/qeth_core_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 0d8cdff..754a54f 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -316,7 +316,7 @@ static inline int qeth_alloc_cq(struct qeth_card *card)
card->qdio.no_in_queues = 2;
- card->qdio.out_bufstates = (struct qdio_outbuf_state *)
+ card->qdio.out_bufstates =
kzalloc(card->qdio.no_out_queues *
QDIO_MAX_BUFFERS_PER_Q *
sizeof(struct qdio_outbuf_state), GFP_KERNEL);
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 12/18] driver: scsi: remove cast for kmalloc/kzalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (9 preceding siblings ...)
2013-03-12 5:22 ` [PATCH 11/18] driver: s390: net: " Zhang Yanfei
@ 2013-03-12 5:25 ` Zhang Yanfei
2013-03-12 9:27 ` James Bottomley
2013-03-12 5:27 ` [PATCH 13/18] driver: tty: serial: remove cast for kzalloc " Zhang Yanfei
` (5 subsequent siblings)
16 siblings, 1 reply; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:25 UTC (permalink / raw)
To: James E.J. Bottomley, Andrew Morton; +Cc: linux-scsi, linux-kernel
remove cast for kmalloc/kzalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-scsi@vger.kernel.org
---
drivers/scsi/hpsa.c | 3 +--
drivers/scsi/lpfc/lpfc_init.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 7f4f790..7a5a002 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3071,8 +3071,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
return -EINVAL;
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
- ioc = (BIG_IOCTL_Command_struct *)
- kmalloc(sizeof(*ioc), GFP_KERNEL);
+ ioc = kmalloc(sizeof(*ioc), GFP_KERNEL);
if (!ioc) {
status = -ENOMEM;
goto cleanup1;
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 314b4f6..f9a3b30 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4674,7 +4674,7 @@ lpfc_sli_driver_resource_setup(struct lpfc_hba *phba)
}
if (!phba->sli.ring)
- phba->sli.ring = (struct lpfc_sli_ring *)
+ phba->sli.ring =
kzalloc(LPFC_SLI3_MAX_RING *
sizeof(struct lpfc_sli_ring), GFP_KERNEL);
if (!phba->sli.ring)
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 13/18] driver: tty: serial: remove cast for kzalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (10 preceding siblings ...)
2013-03-12 5:25 ` [PATCH 12/18] driver: scsi: remove cast for kmalloc/kzalloc " Zhang Yanfei
@ 2013-03-12 5:27 ` Zhang Yanfei
2013-03-12 5:29 ` [PATCH 14/18] driver: tty: vt: remove cast for kmalloc " Zhang Yanfei
` (4 subsequent siblings)
16 siblings, 0 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:27 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Andrew Morton; +Cc: linux-serial, linux-kernel
remove cast for kzalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-serial@vger.kernel.org
---
drivers/tty/serial/icom.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c
index bc9e6b0..18ed5ae 100644
--- a/drivers/tty/serial/icom.c
+++ b/drivers/tty/serial/icom.c
@@ -1415,8 +1415,7 @@ static int icom_alloc_adapter(struct icom_adapter
struct icom_adapter *cur_adapter_entry;
struct list_head *tmp;
- icom_adapter = (struct icom_adapter *)
- kzalloc(sizeof(struct icom_adapter), GFP_KERNEL);
+ icom_adapter = kzalloc(sizeof(struct icom_adapter), GFP_KERNEL);
if (!icom_adapter) {
return -ENOMEM;
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 14/18] driver: tty: vt: remove cast for kmalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (11 preceding siblings ...)
2013-03-12 5:27 ` [PATCH 13/18] driver: tty: serial: remove cast for kzalloc " Zhang Yanfei
@ 2013-03-12 5:29 ` Zhang Yanfei
2013-03-12 5:33 ` [PATCH 15/18] driver: usb: storage: " Zhang Yanfei
` (3 subsequent siblings)
16 siblings, 0 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:29 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Andrew Morton; +Cc: linux-kernel
remove cast for kmalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
drivers/tty/vt/consolemap.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
index 248381b..2978ca5 100644
--- a/drivers/tty/vt/consolemap.c
+++ b/drivers/tty/vt/consolemap.c
@@ -194,8 +194,7 @@ static void set_inverse_transl(struct vc_data *conp, struct uni_pagedir *p, int
q = p->inverse_translations[i];
if (!q) {
- q = p->inverse_translations[i] = (unsigned char *)
- kmalloc(MAX_GLYPH, GFP_KERNEL);
+ q = p->inverse_translations[i] = kmalloc(MAX_GLYPH, GFP_KERNEL);
if (!q) return;
}
memset(q, 0, MAX_GLYPH);
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 15/18] driver: usb: storage: remove cast for kmalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (12 preceding siblings ...)
2013-03-12 5:29 ` [PATCH 14/18] driver: tty: vt: remove cast for kmalloc " Zhang Yanfei
@ 2013-03-12 5:33 ` Zhang Yanfei
2013-03-12 5:35 ` [PATCH 16/18] fs: befs: " Zhang Yanfei
` (2 subsequent siblings)
16 siblings, 0 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:33 UTC (permalink / raw)
To: Matthew Dharm, Greg Kroah-Hartman, Andrew Morton
Cc: linux-usb, usb-storage, linux-kernel
remove cast for kmalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-usb@vger.kernel.org
Cc: usb-storage@lists.one-eyed-alien.net
---
drivers/usb/storage/isd200.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
index ecea478..06a3d22 100644
--- a/drivers/usb/storage/isd200.c
+++ b/drivers/usb/storage/isd200.c
@@ -1457,8 +1457,7 @@ static int isd200_init_info(struct us_data *us)
retStatus = ISD200_ERROR;
else {
info->id = kzalloc(ATA_ID_WORDS * 2, GFP_KERNEL);
- info->RegsBuf = (unsigned char *)
- kmalloc(sizeof(info->ATARegs), GFP_KERNEL);
+ info->RegsBuf = kmalloc(sizeof(info->ATARegs), GFP_KERNEL);
info->srb.sense_buffer =
kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
if (!info->id || !info->RegsBuf || !info->srb.sense_buffer) {
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 16/18] fs: befs: remove cast for kmalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (13 preceding siblings ...)
2013-03-12 5:33 ` [PATCH 15/18] driver: usb: storage: " Zhang Yanfei
@ 2013-03-12 5:35 ` Zhang Yanfei
2013-03-12 5:37 ` [PATCH 17/18] fs: ufs: " Zhang Yanfei
2013-03-12 5:39 ` [PATCH 18/18] net: sctp: remove cast for kmalloc/kzalloc " Zhang Yanfei
16 siblings, 0 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:35 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
remove cast for kmalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
fs/befs/btree.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fs/befs/btree.c b/fs/befs/btree.c
index a66c9b1..74e397d 100644
--- a/fs/befs/btree.c
+++ b/fs/befs/btree.c
@@ -436,8 +436,7 @@ befs_btree_read(struct super_block *sb, befs_data_stream * ds,
goto error;
}
- if ((this_node = (befs_btree_node *)
- kmalloc(sizeof (befs_btree_node), GFP_NOFS)) == NULL) {
+ if ((this_node = kmalloc(sizeof (befs_btree_node), GFP_NOFS)) == NULL) {
befs_error(sb, "befs_btree_read() failed to allocate %u "
"bytes of memory", sizeof (befs_btree_node));
goto error;
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 17/18] fs: ufs: remove cast for kmalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (14 preceding siblings ...)
2013-03-12 5:35 ` [PATCH 16/18] fs: befs: " Zhang Yanfei
@ 2013-03-12 5:37 ` Zhang Yanfei
2013-03-12 5:39 ` [PATCH 18/18] net: sctp: remove cast for kmalloc/kzalloc " Zhang Yanfei
16 siblings, 0 replies; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:37 UTC (permalink / raw)
To: Evgeniy Dushistov, Andrew Morton; +Cc: linux-kernel
remove cast for kmalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
fs/ufs/util.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fs/ufs/util.c b/fs/ufs/util.c
index 95425b5..b6c2f94 100644
--- a/fs/ufs/util.c
+++ b/fs/ufs/util.c
@@ -26,8 +26,7 @@ struct ufs_buffer_head * _ubh_bread_ (struct ufs_sb_private_info * uspi,
count = size >> uspi->s_fshift;
if (count > UFS_MAXFRAG)
return NULL;
- ubh = (struct ufs_buffer_head *)
- kmalloc (sizeof (struct ufs_buffer_head), GFP_NOFS);
+ ubh = kmalloc (sizeof (struct ufs_buffer_head), GFP_NOFS);
if (!ubh)
return NULL;
ubh->fragment = fragment;
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 18/18] net: sctp: remove cast for kmalloc/kzalloc return value
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
` (15 preceding siblings ...)
2013-03-12 5:37 ` [PATCH 17/18] fs: ufs: " Zhang Yanfei
@ 2013-03-12 5:39 ` Zhang Yanfei
2013-03-12 11:35 ` Neil Horman
16 siblings, 1 reply; 26+ messages in thread
From: Zhang Yanfei @ 2013-03-12 5:39 UTC (permalink / raw)
To: Vlad Yasevich, Sridhar Samudrala, Neil Horman, Andrew Morton
Cc: linux-sctp, linux-kernel
remove cast for kmalloc/kzalloc return value.
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Cc: Sridhar Samudrala <sri@us.ibm.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-sctp@vger.kernel.org
---
include/net/sctp/sctp.h | 2 +-
net/sctp/protocol.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index df85a0c..cd89510 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -576,7 +576,7 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\
#define WORD_ROUND(s) (((s)+3)&~3)
/* Make a new instance of type. */
-#define t_new(type, flags) (type *)kzalloc(sizeof(type), flags)
+#define t_new(type, flags) kzalloc(sizeof(type), flags)
/* Compare two timevals. */
#define tv_lt(s, t) \
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 1c2e46c..eaee00c 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1403,7 +1403,7 @@ SCTP_STATIC __init int sctp_init(void)
/* Allocate and initialize the endpoint hash table. */
sctp_ep_hashsize = 64;
- sctp_ep_hashtable = (struct sctp_hashbucket *)
+ sctp_ep_hashtable =
kmalloc(64 * sizeof(struct sctp_hashbucket), GFP_KERNEL);
if (!sctp_ep_hashtable) {
pr_err("Failed endpoint_hash alloc\n");
--
1.7.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 10/18] driver: s390: block: remove cast for kzalloc return value
2013-03-12 5:18 ` [PATCH 10/18] driver: s390: block: remove cast for kzalloc " Zhang Yanfei
@ 2013-03-12 7:22 ` Heiko Carstens
0 siblings, 0 replies; 26+ messages in thread
From: Heiko Carstens @ 2013-03-12 7:22 UTC (permalink / raw)
To: Zhang Yanfei; +Cc: Martin Schwidefsky, Andrew Morton, linux390, linux-kernel
On Tue, Mar 12, 2013 at 01:18:47PM +0800, Zhang Yanfei wrote:
> remove cast for kzalloc return value.
[...]
> diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
> index c196827..a71bb8a 100644
> --- a/drivers/s390/block/dasd_devmap.c
> +++ b/drivers/s390/block/dasd_devmap.c
> @@ -410,8 +410,7 @@ dasd_add_busid(const char *bus_id, int features)
> struct dasd_devmap *devmap, *new, *tmp;
> int hash;
>
> - new = (struct dasd_devmap *)
> - kzalloc(sizeof(struct dasd_devmap), GFP_KERNEL);
> + new = kzalloc(sizeof(struct dasd_devmap), GFP_KERNEL);
Applied, thanks.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 11/18] driver: s390: net: remove cast for kzalloc return value
2013-03-12 5:22 ` [PATCH 11/18] driver: s390: net: " Zhang Yanfei
@ 2013-03-12 7:25 ` Heiko Carstens
0 siblings, 0 replies; 26+ messages in thread
From: Heiko Carstens @ 2013-03-12 7:25 UTC (permalink / raw)
To: Zhang Yanfei
Cc: Ursula Braun, Frank Blaschka, Martin Schwidefsky, Andrew Morton,
linux390, linux-s390, linux-kernel
On Tue, Mar 12, 2013 at 01:22:40PM +0800, Zhang Yanfei wrote:
> remove cast for kzalloc return value.
>
> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> drivers/s390/net/qeth_core_main.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
> index 0d8cdff..754a54f 100644
> --- a/drivers/s390/net/qeth_core_main.c
> +++ b/drivers/s390/net/qeth_core_main.c
> @@ -316,7 +316,7 @@ static inline int qeth_alloc_cq(struct qeth_card *card)
>
> card->qdio.no_in_queues = 2;
>
> - card->qdio.out_bufstates = (struct qdio_outbuf_state *)
> + card->qdio.out_bufstates =
Applied, thanks.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [tip:x86/platform] x86/platform/intel/mrst: Remove cast for kmalloc() return value
2013-03-12 4:58 ` [PATCH 04/18] x86: platform: mrst: remove cast for kmalloc " Zhang Yanfei
@ 2013-03-12 8:50 ` tip-bot for Zhang Yanfei
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Zhang Yanfei @ 2013-03-12 8:50 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, akpm, zhangyanfei, tglx
Commit-ID: ad0304cfd90f46bfcae3a6cd2b69067741541730
Gitweb: http://git.kernel.org/tip/ad0304cfd90f46bfcae3a6cd2b69067741541730
Author: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
AuthorDate: Tue, 12 Mar 2013 12:58:02 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 12 Mar 2013 09:10:20 +0100
x86/platform/intel/mrst: Remove cast for kmalloc() return value
Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/513EB5DA.2010300@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/platform/mrst/mrst.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
index e31bcd8..a0a0a43 100644
--- a/arch/x86/platform/mrst/mrst.c
+++ b/arch/x86/platform/mrst/mrst.c
@@ -356,8 +356,7 @@ static int __init sfi_parse_gpio(struct sfi_table_header *table)
num = SFI_GET_NUM_ENTRIES(sb, struct sfi_gpio_table_entry);
pentry = (struct sfi_gpio_table_entry *)sb->pentry;
- gpio_table = (struct sfi_gpio_table_entry *)
- kmalloc(num * sizeof(*pentry), GFP_KERNEL);
+ gpio_table = kmalloc(num * sizeof(*pentry), GFP_KERNEL);
if (!gpio_table)
return -1;
memcpy(gpio_table, pentry, num * sizeof(*pentry));
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 12/18] driver: scsi: remove cast for kmalloc/kzalloc return value
2013-03-12 5:25 ` [PATCH 12/18] driver: scsi: remove cast for kmalloc/kzalloc " Zhang Yanfei
@ 2013-03-12 9:27 ` James Bottomley
2013-03-12 16:32 ` Joe Perches
0 siblings, 1 reply; 26+ messages in thread
From: James Bottomley @ 2013-03-12 9:27 UTC (permalink / raw)
To: Zhang Yanfei; +Cc: Andrew Morton, linux-scsi, linux-kernel
On Tue, 2013-03-12 at 13:25 +0800, Zhang Yanfei wrote:
> remove cast for kmalloc/kzalloc return value.
I've got to ask why? Just because void * can be assigned to any pointer
doesn't mean we should religiously eliminate all casts of void *. If
the driver writer believes there's value making sure of the pointer
type, I'm happy to keep the cast.
James
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 18/18] net: sctp: remove cast for kmalloc/kzalloc return value
2013-03-12 5:39 ` [PATCH 18/18] net: sctp: remove cast for kmalloc/kzalloc " Zhang Yanfei
@ 2013-03-12 11:35 ` Neil Horman
0 siblings, 0 replies; 26+ messages in thread
From: Neil Horman @ 2013-03-12 11:35 UTC (permalink / raw)
To: Zhang Yanfei
Cc: Vlad Yasevich, Sridhar Samudrala, Andrew Morton, linux-sctp,
linux-kernel
On Tue, Mar 12, 2013 at 01:39:47PM +0800, Zhang Yanfei wrote:
> remove cast for kmalloc/kzalloc return value.
>
> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> Cc: Sridhar Samudrala <sri@us.ibm.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: linux-sctp@vger.kernel.org
> ---
> include/net/sctp/sctp.h | 2 +-
> net/sctp/protocol.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
> index df85a0c..cd89510 100644
> --- a/include/net/sctp/sctp.h
> +++ b/include/net/sctp/sctp.h
> @@ -576,7 +576,7 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\
> #define WORD_ROUND(s) (((s)+3)&~3)
>
> /* Make a new instance of type. */
> -#define t_new(type, flags) (type *)kzalloc(sizeof(type), flags)
> +#define t_new(type, flags) kzalloc(sizeof(type), flags)
>
> /* Compare two timevals. */
> #define tv_lt(s, t) \
> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
> index 1c2e46c..eaee00c 100644
> --- a/net/sctp/protocol.c
> +++ b/net/sctp/protocol.c
> @@ -1403,7 +1403,7 @@ SCTP_STATIC __init int sctp_init(void)
>
> /* Allocate and initialize the endpoint hash table. */
> sctp_ep_hashsize = 64;
> - sctp_ep_hashtable = (struct sctp_hashbucket *)
> + sctp_ep_hashtable =
> kmalloc(64 * sizeof(struct sctp_hashbucket), GFP_KERNEL);
> if (!sctp_ep_hashtable) {
> pr_err("Failed endpoint_hash alloc\n");
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 08/18] driver: isdn: capi: remove cast for kmalloc return value
2013-03-12 5:13 ` [PATCH 08/18] driver: isdn: capi: " Zhang Yanfei
@ 2013-03-12 15:41 ` David Miller
0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2013-03-12 15:41 UTC (permalink / raw)
To: zhangyanfei; +Cc: isdn, akpm, netdev, linux-kernel
From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Date: Tue, 12 Mar 2013 13:13:47 +0800
> remove cast for kmalloc return value.
>
> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Applied.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 09/18] driver: isdn: hisax: remove cast for kmalloc/kzalloc return value
2013-03-12 5:15 ` [PATCH 09/18] driver: isdn: hisax: remove cast for kmalloc/kzalloc " Zhang Yanfei
@ 2013-03-12 15:41 ` David Miller
0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2013-03-12 15:41 UTC (permalink / raw)
To: zhangyanfei; +Cc: isdn, akpm, netdev, linux-kernel
From: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Date: Tue, 12 Mar 2013 13:15:49 +0800
> remove cast for kmalloc/kzalloc return value.
>
> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Applied.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 12/18] driver: scsi: remove cast for kmalloc/kzalloc return value
2013-03-12 9:27 ` James Bottomley
@ 2013-03-12 16:32 ` Joe Perches
0 siblings, 0 replies; 26+ messages in thread
From: Joe Perches @ 2013-03-12 16:32 UTC (permalink / raw)
To: James Bottomley; +Cc: Zhang Yanfei, Andrew Morton, linux-scsi, linux-kernel
On Tue, 2013-03-12 at 09:27 +0000, James Bottomley wrote:
> On Tue, 2013-03-12 at 13:25 +0800, Zhang Yanfei wrote:
> > remove cast for kmalloc/kzalloc return value.
>
> I've got to ask why? Just because void * can be assigned to any pointer
> doesn't mean we should religiously eliminate all casts of void *. If
> the driver writer believes there's value making sure of the pointer
> type, I'm happy to keep the cast.
This view is why scsi has many different styles
instead of a more consistent kernel style.
For the cciss/hpsa example shown:
Do you suggest indirecting structs with typedefs like
BIG_IOCTL_Command_struct is a good thing as well
because the driver writer thinks it so?
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2013-03-12 16:32 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-12 4:42 [PATCH 01/18] arm: remove cast for kzalloc return value Zhang Yanfei
2013-03-12 4:47 ` [PATCH 02/18] ia64: remove cast for kmalloc " Zhang Yanfei
2013-03-12 4:54 ` [PATCH 03/18] powerpc: remove cast for kmalloc/kzalloc " Zhang Yanfei
2013-03-12 4:58 ` [PATCH 04/18] x86: platform: mrst: remove cast for kmalloc " Zhang Yanfei
2013-03-12 8:50 ` [tip:x86/platform] x86/platform/intel/mrst: Remove cast for kmalloc() " tip-bot for Zhang Yanfei
2013-03-12 5:03 ` [PATCH 05/18] driver: staging: csr: remove cast for kmalloc " Zhang Yanfei
2013-03-12 5:07 ` [PATCH 06/18] driver: gpu: drm: i915: remove cast for kzalloc " Zhang Yanfei
2013-03-12 5:10 ` [PATCH 07/18] driver: hv: remove cast for kmalloc " Zhang Yanfei
2013-03-12 5:13 ` [PATCH 08/18] driver: isdn: capi: " Zhang Yanfei
2013-03-12 15:41 ` David Miller
2013-03-12 5:15 ` [PATCH 09/18] driver: isdn: hisax: remove cast for kmalloc/kzalloc " Zhang Yanfei
2013-03-12 15:41 ` David Miller
2013-03-12 5:18 ` [PATCH 10/18] driver: s390: block: remove cast for kzalloc " Zhang Yanfei
2013-03-12 7:22 ` Heiko Carstens
2013-03-12 5:22 ` [PATCH 11/18] driver: s390: net: " Zhang Yanfei
2013-03-12 7:25 ` Heiko Carstens
2013-03-12 5:25 ` [PATCH 12/18] driver: scsi: remove cast for kmalloc/kzalloc " Zhang Yanfei
2013-03-12 9:27 ` James Bottomley
2013-03-12 16:32 ` Joe Perches
2013-03-12 5:27 ` [PATCH 13/18] driver: tty: serial: remove cast for kzalloc " Zhang Yanfei
2013-03-12 5:29 ` [PATCH 14/18] driver: tty: vt: remove cast for kmalloc " Zhang Yanfei
2013-03-12 5:33 ` [PATCH 15/18] driver: usb: storage: " Zhang Yanfei
2013-03-12 5:35 ` [PATCH 16/18] fs: befs: " Zhang Yanfei
2013-03-12 5:37 ` [PATCH 17/18] fs: ufs: " Zhang Yanfei
2013-03-12 5:39 ` [PATCH 18/18] net: sctp: remove cast for kmalloc/kzalloc " Zhang Yanfei
2013-03-12 11:35 ` Neil Horman
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).