* [PATCH 0/9] use correct structure type name in sizeof
@ 2014-07-29 15:16 Julia Lawall
2014-07-29 15:16 ` [PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type name in Julia Lawall
` (8 more replies)
0 siblings, 9 replies; 17+ messages in thread
From: Julia Lawall @ 2014-07-29 15:16 UTC (permalink / raw)
To: linux-wireless
Cc: devel, linux-ia64, linux-scsi, e1000-devel, toralf.foerster,
linux-usb, kernel-janitors, reiserfs-devel, linux-kernel,
linux-gpio, hmh, netdev, ceph-devel, linux-media
These patches fix typos in the name of a type referenced in a sizeof
command. These problems are not caught by the compiler, because they have
no impact on execution - the size of a pointer is independent of the size
of the pointed value.
The semantic patch that finds these problems is shown below
(http://coccinelle.lip6.fr/). This semantic patch distinguishes between
structures that are defined in C files, and thus are expected to be visible
in only that file, and structures that are defined in header files, which
could potential be visible everywhere. This distinction seems to be
unnecessary in practice, though.
<smpl>
virtual after_start
@initialize:ocaml@
@@
type fl = C of string | H
let structures = Hashtbl.create 101
let restarted = ref false
let add_if_not_present _ if not !restarted
then
begin
restarted := true;
let it = new iteration() in
it#add_virtual_rule After_start;
it#register()
end
let hashadd str file let cell try Hashtbl.find structures str
with Not_found ->
let cell = ref [] in
Hashtbl.add structures str cell;
cell in
if not (List.mem file !cell) then cell := file :: !cell
let get_file fl if Filename.check_suffix fl ".c"
then C fl
else H
@script:ocaml depends on !after_start@
@@
add_if_not_present()
@r depends on !after_start@
identifier nm;
position p;
@@
struct nm@p { ... };
@script:ocaml@
nm << r.nm;
p << r.p;
@@
hashadd nm (get_file (List.hd p).file)
// -------------------------------------------------------------------------
@sz depends on after_start@
identifier nm;
position p;
@@
sizeof(struct nm@p *)
@script:ocaml@
nm << sz.nm;
p << sz.p;
@@
try
let allowed = !(Hashtbl.find structures nm) in
if List.mem H allowed or List.mem (get_file (List.hd p).file) allowed
then ()
else print_main nm p
with Not_found -> print_main nm p
</smpl>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type name in
2014-07-29 15:16 [PATCH 0/9] use correct structure type name in sizeof Julia Lawall
@ 2014-07-29 15:16 ` Julia Lawall
2015-11-09 20:48 ` [PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type nam Laurent Pinchart
2014-07-29 15:16 ` [PATCH 2/9] CAPI: use correct structure type name in sizeof Julia Lawall
` (7 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Julia Lawall @ 2014-07-29 15:16 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: devel, linux-ia64, Greg Kroah-Hartman, kernel-janitors,
linux-kernel, hmh, toralf.foerster, ceph-devel, linux-media
From: Julia Lawall <Julia.Lawall@lip6.fr>
Correct typo in the name of the type given to sizeof. Because it is the
size of a pointer that is wanted, the typo has no impact on compilation or
execution.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
semantic patch used can be found in message 0 of this patch series.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
index cda8388..255590f 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
@@ -227,7 +227,7 @@ static int vpfe_enable_clock(struct vpfe_device *vpfe_dev)
return 0;
vpfe_dev->clks = kzalloc(vpfe_cfg->num_clocks *
- sizeof(struct clock *), GFP_KERNEL);
+ sizeof(struct clk *), GFP_KERNEL);
if (vpfe_dev->clks = NULL) {
v4l2_err(vpfe_dev->pdev->driver, "Memory allocation failed\n");
return -ENOMEM;
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/9] CAPI: use correct structure type name in sizeof
2014-07-29 15:16 [PATCH 0/9] use correct structure type name in sizeof Julia Lawall
2014-07-29 15:16 ` [PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type name in Julia Lawall
@ 2014-07-29 15:16 ` Julia Lawall
2014-07-31 2:14 ` David Miller
2014-07-29 15:16 ` [PATCH 3/9] i40e: " Julia Lawall
` (6 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Julia Lawall @ 2014-07-29 15:16 UTC (permalink / raw)
To: Karsten Keil
Cc: kernel-janitors, linux-ia64, ceph-devel, toralf.foerster, hmh,
netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Correct typo in the name of the type given to sizeof. Because it is the
size of a pointer that is wanted, the typo has no impact on compilation or
execution.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
semantic patch used can be found in message 0 of this patch series.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/isdn/capi/capi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index f9a87ed..6a2df32 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1260,7 +1260,7 @@ static int __init capinc_tty_init(void)
if (capi_ttyminors <= 0)
capi_ttyminors = CAPINC_NR_PORTS;
- capiminors = kzalloc(sizeof(struct capi_minor *) * capi_ttyminors,
+ capiminors = kzalloc(sizeof(struct capiminor *) * capi_ttyminors,
GFP_KERNEL);
if (!capiminors)
return -ENOMEM;
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/9] i40e: use correct structure type name in sizeof
2014-07-29 15:16 [PATCH 0/9] use correct structure type name in sizeof Julia Lawall
2014-07-29 15:16 ` [PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type name in Julia Lawall
2014-07-29 15:16 ` [PATCH 2/9] CAPI: use correct structure type name in sizeof Julia Lawall
@ 2014-07-29 15:16 ` Julia Lawall
2014-07-29 20:22 ` Brown, Aaron F
2014-07-31 2:14 ` David Miller
2014-07-29 15:16 ` [PATCH 4/9] reiserfs: " Julia Lawall
` (5 subsequent siblings)
8 siblings, 2 replies; 17+ messages in thread
From: Julia Lawall @ 2014-07-29 15:16 UTC (permalink / raw)
To: Jeff Kirsher
Cc: kernel-janitors, linux-ia64, ceph-devel, toralf.foerster, hmh,
Jesse Brandeburg, Bruce Allan, Carolyn Wyborny, Don Skidmore,
Greg Rose, Alex Duyck, John Ronciak, Mitch Williams, Linux NICS,
e1000-devel, netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Correct typo in the name of the type given to sizeof. Because it is the
size of a pointer that is wanted, the typo has no impact on compilation or
execution.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
semantic patch used can be found in message 0 of this patch series.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 821fcc1..b913c27 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6137,7 +6137,7 @@ static int i40e_vsi_alloc_arrays(struct i40e_vsi *vsi, bool alloc_qvectors)
if (alloc_qvectors) {
/* allocate memory for q_vector pointers */
- size = sizeof(struct i40e_q_vectors *) * vsi->num_q_vectors;
+ size = sizeof(struct i40e_q_vector *) * vsi->num_q_vectors;
vsi->q_vectors = kzalloc(size, GFP_KERNEL);
if (!vsi->q_vectors) {
ret = -ENOMEM;
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 4/9] reiserfs: use correct structure type name in sizeof
2014-07-29 15:16 [PATCH 0/9] use correct structure type name in sizeof Julia Lawall
` (2 preceding siblings ...)
2014-07-29 15:16 ` [PATCH 3/9] i40e: " Julia Lawall
@ 2014-07-29 15:16 ` Julia Lawall
2014-07-29 15:16 ` [PATCH 5/9] scsi: " Julia Lawall
` (4 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Julia Lawall @ 2014-07-29 15:16 UTC (permalink / raw)
To: reiserfs-devel
Cc: kernel-janitors, linux-ia64, ceph-devel, toralf.foerster, hmh,
linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Correct typo in the name of the type given to sizeof. Because it is the
size of a pointer that is wanted, the typo has no impact on compilation or
execution.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
semantic patch used can be found in message 0 of this patch series.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
fs/reiserfs/resize.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/reiserfs/resize.c b/fs/reiserfs/resize.c
index 6052d32..e69051b 100644
--- a/fs/reiserfs/resize.c
+++ b/fs/reiserfs/resize.c
@@ -99,7 +99,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
*/
copy_size = bmap_nr_new < bmap_nr ? bmap_nr_new : bmap_nr;
copy_size - copy_size * sizeof(struct reiserfs_list_bitmap_node *);
+ copy_size * sizeof(struct reiserfs_bitmap_node *);
for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) {
struct reiserfs_bitmap_node **node_tmp;
jb = SB_JOURNAL(s)->j_list_bitmap + i;
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 5/9] scsi: use correct structure type name in sizeof
2014-07-29 15:16 [PATCH 0/9] use correct structure type name in sizeof Julia Lawall
` (3 preceding siblings ...)
2014-07-29 15:16 ` [PATCH 4/9] reiserfs: " Julia Lawall
@ 2014-07-29 15:16 ` Julia Lawall
2014-07-29 15:16 ` [PATCH 6/9] gpiolib: devres: " Julia Lawall
` (3 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Julia Lawall @ 2014-07-29 15:16 UTC (permalink / raw)
To: Dario Ballabio
Cc: kernel-janitors, linux-ia64, ceph-devel, toralf.foerster, hmh,
James E.J. Bottomley, linux-scsi, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Correct typo in the name of the type given to sizeof. Because it is the
size of a pointer that is wanted, the typo has no impact on compilation or
execution.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
semantic patch used can be found in message 0 of this patch series.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/scsi/eata.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
index 813dd5c..4caf221 100644
--- a/drivers/scsi/eata.c
+++ b/drivers/scsi/eata.c
@@ -811,7 +811,7 @@ struct mscp {
struct sg_list *sglist; /* pointer to the allocated SG list */
};
-#define CP_TAIL_SIZE (sizeof(struct sglist *) + sizeof(dma_addr_t))
+#define CP_TAIL_SIZE (sizeof(struct sg_list *) + sizeof(dma_addr_t))
struct hostdata {
struct mscp cp[MAX_MAILBOXES]; /* Mailboxes for this board */
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 6/9] gpiolib: devres: use correct structure type name in sizeof
2014-07-29 15:16 [PATCH 0/9] use correct structure type name in sizeof Julia Lawall
` (4 preceding siblings ...)
2014-07-29 15:16 ` [PATCH 5/9] scsi: " Julia Lawall
@ 2014-07-29 15:16 ` Julia Lawall
2014-07-30 8:27 ` Alexandre Courbot
2014-08-08 13:26 ` Linus Walleij
2014-07-29 15:16 ` [PATCH 7/9] scsi: " Julia Lawall
` (2 subsequent siblings)
8 siblings, 2 replies; 17+ messages in thread
From: Julia Lawall @ 2014-07-29 15:16 UTC (permalink / raw)
To: Linus Walleij
Cc: kernel-janitors, linux-ia64, ceph-devel, toralf.foerster, hmh,
Alexandre Courbot, linux-gpio, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Correct typo in the name of the type given to sizeof. Because it is the
size of a pointer that is wanted, the typo has no impact on compilation or
execution.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
semantic patch used can be found in message 0 of this patch series.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/gpio/devres.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
index 65978cf..4a63207 100644
--- a/drivers/gpio/devres.c
+++ b/drivers/gpio/devres.c
@@ -84,7 +84,7 @@ struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
struct gpio_desc **dr;
struct gpio_desc *desc;
- dr = devres_alloc(devm_gpiod_release, sizeof(struct gpiod_desc *),
+ dr = devres_alloc(devm_gpiod_release, sizeof(struct gpio_desc *),
GFP_KERNEL);
if (!dr)
return ERR_PTR(-ENOMEM);
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 7/9] scsi: use correct structure type name in sizeof
2014-07-29 15:16 [PATCH 0/9] use correct structure type name in sizeof Julia Lawall
` (5 preceding siblings ...)
2014-07-29 15:16 ` [PATCH 6/9] gpiolib: devres: " Julia Lawall
@ 2014-07-29 15:16 ` Julia Lawall
2014-07-29 15:16 ` [PATCH 8/9] iwlegacy: " Julia Lawall
2014-07-29 15:16 ` [PATCH 9/9] uwb/whci: " Julia Lawall
8 siblings, 0 replies; 17+ messages in thread
From: Julia Lawall @ 2014-07-29 15:16 UTC (permalink / raw)
To: Dario Ballabio
Cc: kernel-janitors, linux-ia64, ceph-devel, toralf.foerster, hmh,
James E.J. Bottomley, linux-scsi, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Correct typo in the name of the type given to sizeof. Because it is the
size of a pointer that is wanted, the typo has no impact on compilation or
execution.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
semantic patch used can be found in message 0 of this patch series.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/scsi/u14-34f.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
index 4e76fe8..617d72a 100644
--- a/drivers/scsi/u14-34f.c
+++ b/drivers/scsi/u14-34f.c
@@ -585,7 +585,7 @@ struct mscp {
struct sg_list *sglist; /* pointer to the allocated SG list */
};
-#define CP_TAIL_SIZE (sizeof(struct sglist *) + sizeof(dma_addr_t))
+#define CP_TAIL_SIZE (sizeof(struct sg_list *) + sizeof(dma_addr_t))
struct hostdata {
struct mscp cp[MAX_MAILBOXES]; /* Mailboxes for this board */
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 8/9] iwlegacy: use correct structure type name in sizeof
2014-07-29 15:16 [PATCH 0/9] use correct structure type name in sizeof Julia Lawall
` (6 preceding siblings ...)
2014-07-29 15:16 ` [PATCH 7/9] scsi: " Julia Lawall
@ 2014-07-29 15:16 ` Julia Lawall
2014-07-29 15:16 ` [PATCH 9/9] uwb/whci: " Julia Lawall
8 siblings, 0 replies; 17+ messages in thread
From: Julia Lawall @ 2014-07-29 15:16 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: kernel-janitors, linux-ia64, ceph-devel, toralf.foerster, hmh,
John W. Linville, linux-wireless, netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Correct typo in the name of the type given to sizeof. Because it is the
size of a pointer that is wanted, the typo has no impact on compilation or
execution.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
semantic patch used can be found in message 0 of this patch series.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/iwlegacy/common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 03de746..2c4fa49 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -2980,7 +2980,8 @@ il_tx_queue_alloc(struct il_priv *il, struct il_tx_queue *txq, u32 id)
/* Driver ilate data, only for Tx (not command) queues,
* not shared with device. */
if (id != il->cmd_queue) {
- txq->skbs = kcalloc(TFD_QUEUE_SIZE_MAX, sizeof(struct skb *),
+ txq->skbs = kcalloc(TFD_QUEUE_SIZE_MAX,
+ sizeof(struct sk_buff *),
GFP_KERNEL);
if (!txq->skbs) {
IL_ERR("Fail to alloc skbs\n");
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 9/9] uwb/whci: use correct structure type name in sizeof
2014-07-29 15:16 [PATCH 0/9] use correct structure type name in sizeof Julia Lawall
` (7 preceding siblings ...)
2014-07-29 15:16 ` [PATCH 8/9] iwlegacy: " Julia Lawall
@ 2014-07-29 15:16 ` Julia Lawall
8 siblings, 0 replies; 17+ messages in thread
From: Julia Lawall @ 2014-07-29 15:16 UTC (permalink / raw)
To: linux-usb
Cc: kernel-janitors, linux-ia64, ceph-devel, toralf.foerster, hmh,
linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Correct typo in the name of the type given to sizeof. Because it is the
size of a pointer that is wanted, the typo has no impact on compilation or
execution.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
semantic patch used can be found in message 0 of this patch series.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/uwb/whci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/uwb/whci.c b/drivers/uwb/whci.c
index c9df8ba..46b7cfc 100644
--- a/drivers/uwb/whci.c
+++ b/drivers/uwb/whci.c
@@ -175,7 +175,7 @@ static int whci_probe(struct pci_dev *pci, const struct pci_device_id *id)
err = -ENOMEM;
card = kzalloc(sizeof(struct whci_card)
- + sizeof(struct whci_dev *) * (n_caps + 1),
+ + sizeof(struct umc_dev *) * (n_caps + 1),
GFP_KERNEL);
if (card = NULL)
goto error_kzalloc;
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 3/9] i40e: use correct structure type name in sizeof
2014-07-29 15:16 ` [PATCH 3/9] i40e: " Julia Lawall
@ 2014-07-29 20:22 ` Brown, Aaron F
2014-07-31 2:14 ` David Miller
1 sibling, 0 replies; 17+ messages in thread
From: Brown, Aaron F @ 2014-07-29 20:22 UTC (permalink / raw)
To: Julia.Lawall@lip6.fr
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Allan, Bruce W,
Wyborny, Carolyn, Skidmore, Donald C, Rose, Gregory V,
Duyck, Alexander H, Ronciak, John, Williams, Mitch A,
kernel-janitors@vger.kernel.org, linux-ia64@vger.kernel.org,
ceph-devel@vger.kernel.org, toralf.foerster@gmx.de,
hmh@hmh.eng.br, Linux NICS, e1000-devel@lists.sourceforge.net,
netdev@vger.kernel.org
T24gVHVlLCAyMDE0LTA3LTI5IGF0IDE3OjE2ICswMjAwLCBKdWxpYSBMYXdhbGwgd3JvdGU6Cj4g
RnJvbTogSnVsaWEgTGF3YWxsIDxKdWxpYS5MYXdhbGxAbGlwNi5mcj4KPiAKPiBDb3JyZWN0IHR5
cG8gaW4gdGhlIG5hbWUgb2YgdGhlIHR5cGUgZ2l2ZW4gdG8gc2l6ZW9mLiAgQmVjYXVzZSBpdCBp
cyB0aGUKPiBzaXplIG9mIGEgcG9pbnRlciB0aGF0IGlzIHdhbnRlZCwgdGhlIHR5cG8gaGFzIG5v
IGltcGFjdCBvbiBjb21waWxhdGlvbiBvcgo+IGV4ZWN1dGlvbi4KPiAKPiBUaGlzIHByb2JsZW0g
d2FzIGZvdW5kIHVzaW5nIENvY2NpbmVsbGUgKGh0dHA6Ly9jb2NjaW5lbGxlLmxpcDYuZnIvKS4g
IFRoZQo+IHNlbWFudGljIHBhdGNoIHVzZWQgY2FuIGJlIGZvdW5kIGluIG1lc3NhZ2UgMCBvZiB0
aGlzIHBhdGNoIHNlcmllcy4KPiAKPiBTaWduZWQtb2ZmLWJ5OiBKdWxpYSBMYXdhbGwgPEp1bGlh
Lkxhd2FsbEBsaXA2LmZyPgo+IAo+IC0tLQo+ICBkcml2ZXJzL25ldC9ldGhlcm5ldC9pbnRlbC9p
NDBlL2k0MGVfbWFpbi5jIHwgICAgMiArLQo+ICAxIGZpbGUgY2hhbmdlZCwgMSBpbnNlcnRpb24o
KyksIDEgZGVsZXRpb24oLSkKClRoYW5rcyBKdWxpYSwgSSBoYXZlIGFkZGVkIHlvdXIgcGF0Y2gg
dG8gb3VyIChKZWZmJ3MpIHF1ZXVlLgo
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 6/9] gpiolib: devres: use correct structure type name in sizeof
2014-07-29 15:16 ` [PATCH 6/9] gpiolib: devres: " Julia Lawall
@ 2014-07-30 8:27 ` Alexandre Courbot
2014-07-30 8:48 ` Julia Lawall
2014-08-08 13:26 ` Linus Walleij
1 sibling, 1 reply; 17+ messages in thread
From: Alexandre Courbot @ 2014-07-30 8:27 UTC (permalink / raw)
To: Julia Lawall
Cc: Linus Walleij, kernel-janitors, linux-ia64, ceph-devel,
toralf.foerster, hmh, linux-gpio@vger.kernel.org,
Linux Kernel Mailing List
On Wed, Jul 30, 2014 at 12:16 AM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Correct typo in the name of the type given to sizeof. Because it is the
> size of a pointer that is wanted, the typo has no impact on compilation or
> execution.
>
> This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
> semantic patch used can be found in message 0 of this patch series.
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Interestingly the compiler never complains despite gpiod_desc not
being a declared type...
Thanks!
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 6/9] gpiolib: devres: use correct structure type name in sizeof
2014-07-30 8:27 ` Alexandre Courbot
@ 2014-07-30 8:48 ` Julia Lawall
0 siblings, 0 replies; 17+ messages in thread
From: Julia Lawall @ 2014-07-30 8:48 UTC (permalink / raw)
To: Alexandre Courbot
Cc: Linus Walleij, kernel-janitors, linux-ia64, ceph-devel,
toralf.foerster, hmh, linux-gpio@vger.kernel.org,
Linux Kernel Mailing List
On Wed, 30 Jul 2014, Alexandre Courbot wrote:
> On Wed, Jul 30, 2014 at 12:16 AM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> > From: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > Correct typo in the name of the type given to sizeof. Because it is the
> > size of a pointer that is wanted, the typo has no impact on compilation or
> > execution.
> >
> > This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
> > semantic patch used can be found in message 0 of this patch series.
>
> Acked-by: Alexandre Courbot <acourbot@nvidia.com>
>
> Interestingly the compiler never complains despite gpiod_desc not
> being a declared type...
The compiler doesn't care. A pointer is a pointer, regardless of the
type.
julia
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/9] CAPI: use correct structure type name in sizeof
2014-07-29 15:16 ` [PATCH 2/9] CAPI: use correct structure type name in sizeof Julia Lawall
@ 2014-07-31 2:14 ` David Miller
0 siblings, 0 replies; 17+ messages in thread
From: David Miller @ 2014-07-31 2:14 UTC (permalink / raw)
To: Julia.Lawall
Cc: isdn, kernel-janitors, linux-ia64, ceph-devel, toralf.foerster,
hmh, netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 29 Jul 2014 17:16:44 +0200
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Correct typo in the name of the type given to sizeof. Because it is the
> size of a pointer that is wanted, the typo has no impact on compilation or
> execution.
>
> This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
> semantic patch used can be found in message 0 of this patch series.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Relatively harmless, so applied to net-next, thanks.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/9] i40e: use correct structure type name in sizeof
2014-07-29 15:16 ` [PATCH 3/9] i40e: " Julia Lawall
2014-07-29 20:22 ` Brown, Aaron F
@ 2014-07-31 2:14 ` David Miller
1 sibling, 0 replies; 17+ messages in thread
From: David Miller @ 2014-07-31 2:14 UTC (permalink / raw)
To: Julia.Lawall
Cc: jeffrey.t.kirsher, kernel-janitors, linux-ia64, ceph-devel,
toralf.foerster, hmh, jesse.brandeburg, bruce.w.allan,
carolyn.wyborny, donald.c.skidmore, gregory.v.rose,
alexander.h.duyck, john.ronciak, mitch.a.williams, linux.nics,
e1000-devel, netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 29 Jul 2014 17:16:45 +0200
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Correct typo in the name of the type given to sizeof. Because it is the
> size of a pointer that is wanted, the typo has no impact on compilation or
> execution.
>
> This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
> semantic patch used can be found in message 0 of this patch series.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
I'll let the Intel driver folks pick this one up, thanks!
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 6/9] gpiolib: devres: use correct structure type name in sizeof
2014-07-29 15:16 ` [PATCH 6/9] gpiolib: devres: " Julia Lawall
2014-07-30 8:27 ` Alexandre Courbot
@ 2014-08-08 13:26 ` Linus Walleij
1 sibling, 0 replies; 17+ messages in thread
From: Linus Walleij @ 2014-08-08 13:26 UTC (permalink / raw)
To: Julia Lawall
Cc: kernel-janitors, linux-ia64, ceph-devel, toralf.foerster, hmh,
Alexandre Courbot, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
On Tue, Jul 29, 2014 at 5:16 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Correct typo in the name of the type given to sizeof. Because it is the
> size of a pointer that is wanted, the typo has no impact on compilation or
> execution.
>
> This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
> semantic patch used can be found in message 0 of this patch series.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Patch applied with Alexandre's ACK.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type nam
2014-07-29 15:16 ` [PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type name in Julia Lawall
@ 2015-11-09 20:48 ` Laurent Pinchart
0 siblings, 0 replies; 17+ messages in thread
From: Laurent Pinchart @ 2015-11-09 20:48 UTC (permalink / raw)
To: Julia Lawall
Cc: Mauro Carvalho Chehab, kernel-janitors, linux-ia64, ceph-devel,
toralf.foerster, hmh, Greg Kroah-Hartman, linux-media, devel,
linux-kernel
Hi Julia,
Thank you for the patch.
On Tuesday 29 July 2014 17:16:43 Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Correct typo in the name of the type given to sizeof. Because it is the
> size of a pointer that is wanted, the typo has no impact on compilation or
> execution.
>
> This problem was found using Coccinelle (http://coccinelle.lip6.fr/). The
> semantic patch used can be found in message 0 of this patch series.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
> b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c index
> cda8388..255590f 100644
> --- a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
> +++ b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
> @@ -227,7 +227,7 @@ static int vpfe_enable_clock(struct vpfe_device
> *vpfe_dev) return 0;
>
> vpfe_dev->clks = kzalloc(vpfe_cfg->num_clocks *
> - sizeof(struct clock *), GFP_KERNEL);
> + sizeof(struct clk *), GFP_KERNEL);
I'd use sizeof(*vpfe_dev->clks) to avoid such issues.
Apart from that,
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
I've applied the patch to my tree with the above change, there's no need to
resubmit if you agree with the proposal.
> if (vpfe_dev->clks = NULL) {
> v4l2_err(vpfe_dev->pdev->driver, "Memory allocation failed\n");
> return -ENOMEM;
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2015-11-09 20:48 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-29 15:16 [PATCH 0/9] use correct structure type name in sizeof Julia Lawall
2014-07-29 15:16 ` [PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type name in Julia Lawall
2015-11-09 20:48 ` [PATCH 1/9] drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c: use correct structure type nam Laurent Pinchart
2014-07-29 15:16 ` [PATCH 2/9] CAPI: use correct structure type name in sizeof Julia Lawall
2014-07-31 2:14 ` David Miller
2014-07-29 15:16 ` [PATCH 3/9] i40e: " Julia Lawall
2014-07-29 20:22 ` Brown, Aaron F
2014-07-31 2:14 ` David Miller
2014-07-29 15:16 ` [PATCH 4/9] reiserfs: " Julia Lawall
2014-07-29 15:16 ` [PATCH 5/9] scsi: " Julia Lawall
2014-07-29 15:16 ` [PATCH 6/9] gpiolib: devres: " Julia Lawall
2014-07-30 8:27 ` Alexandre Courbot
2014-07-30 8:48 ` Julia Lawall
2014-08-08 13:26 ` Linus Walleij
2014-07-29 15:16 ` [PATCH 7/9] scsi: " Julia Lawall
2014-07-29 15:16 ` [PATCH 8/9] iwlegacy: " Julia Lawall
2014-07-29 15:16 ` [PATCH 9/9] uwb/whci: " Julia Lawall
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).