* [PATCH v2] staging: rtl8712: Remove exceptional & on function name
@ 2016-02-21 6:28 Amitoj Kaur Chawla
2016-02-21 13:57 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 3+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-21 6:28 UTC (permalink / raw)
To: outreachy-kernel
In these files, function names are otherwise used as pointers without &.
The Coccinelle semantic patch that is used to make this change is as
follows:
// <smpl>
@r@
identifier f;
@@
f(...) { ... }
@@
identifier r.f;
@@
- &f
+ f
@m@
type T;
identifier f;
@@
T f(...);
@@
identifier m.f;
@@
- &f
+ f
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
Changes in v2:
-Modified semantic patch and consequently, this patch to make changes
for non-static functions also.
drivers/staging/rtl8712/usb_intf.c | 10 +++++-----
drivers/staging/rtl8712/usb_ops.c | 26 +++++++++++++-------------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index f1d3d70..c1a0ca49 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -399,11 +399,11 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
SET_NETDEV_DEV(pnetdev, &pusb_intf->dev);
pnetdev->dev.type = &wlan_type;
/* step 2. */
- padapter->dvobj_init = &r8712_usb_dvobj_init;
- padapter->dvobj_deinit = &r8712_usb_dvobj_deinit;
- padapter->halpriv.hal_bus_init = &r8712_usb_hal_bus_init;
- padapter->dvobjpriv.inirp_init = &r8712_usb_inirp_init;
- padapter->dvobjpriv.inirp_deinit = &r8712_usb_inirp_deinit;
+ padapter->dvobj_init = r8712_usb_dvobj_init;
+ padapter->dvobj_deinit = r8712_usb_dvobj_deinit;
+ padapter->halpriv.hal_bus_init = r8712_usb_hal_bus_init;
+ padapter->dvobjpriv.inirp_init = r8712_usb_inirp_init;
+ padapter->dvobjpriv.inirp_deinit = r8712_usb_inirp_deinit;
/* step 3.
* initialize the dvobj_priv
*/
diff --git a/drivers/staging/rtl8712/usb_ops.c b/drivers/staging/rtl8712/usb_ops.c
index 856f257..9172400 100644
--- a/drivers/staging/rtl8712/usb_ops.c
+++ b/drivers/staging/rtl8712/usb_ops.c
@@ -179,22 +179,22 @@ static void usb_intf_hdl_close(u8 *priv)
void r8712_usb_set_intf_funs(struct intf_hdl *pintf_hdl)
{
- pintf_hdl->intf_hdl_init = &usb_intf_hdl_init;
- pintf_hdl->intf_hdl_unload = &usb_intf_hdl_unload;
- pintf_hdl->intf_hdl_open = &usb_intf_hdl_open;
- pintf_hdl->intf_hdl_close = &usb_intf_hdl_close;
+ pintf_hdl->intf_hdl_init = usb_intf_hdl_init;
+ pintf_hdl->intf_hdl_unload = usb_intf_hdl_unload;
+ pintf_hdl->intf_hdl_open = usb_intf_hdl_open;
+ pintf_hdl->intf_hdl_close = usb_intf_hdl_close;
}
void r8712_usb_set_intf_ops(struct _io_ops *pops)
{
memset((u8 *)pops, 0, sizeof(struct _io_ops));
- pops->_read8 = &usb_read8;
- pops->_read16 = &usb_read16;
- pops->_read32 = &usb_read32;
- pops->_read_port = &r8712_usb_read_port;
- pops->_write8 = &usb_write8;
- pops->_write16 = &usb_write16;
- pops->_write32 = &usb_write32;
- pops->_write_mem = &r8712_usb_write_mem;
- pops->_write_port = &r8712_usb_write_port;
+ pops->_read8 = usb_read8;
+ pops->_read16 = usb_read16;
+ pops->_read32 = usb_read32;
+ pops->_read_port = r8712_usb_read_port;
+ pops->_write8 = usb_write8;
+ pops->_write16 = usb_write16;
+ pops->_write32 = usb_write32;
+ pops->_write_mem = r8712_usb_write_mem;
+ pops->_write_port = r8712_usb_write_port;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH v2] staging: rtl8712: Remove exceptional & on function name
2016-02-21 6:28 [PATCH v2] staging: rtl8712: Remove exceptional & on function name Amitoj Kaur Chawla
@ 2016-02-21 13:57 ` Julia Lawall
2016-02-21 14:17 ` Amitoj Kaur Chawla
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2016-02-21 13:57 UTC (permalink / raw)
To: Amitoj Kaur Chawla; +Cc: outreachy-kernel
On Sun, 21 Feb 2016, Amitoj Kaur Chawla wrote:
> In these files, function names are otherwise used as pointers without &.
I'm still not clear on the "otherwise" part. This semantic patch just
removes & from all function names. Do you do anything to ensure that that
is the most common case already in the given file?
julia
> The Coccinelle semantic patch that is used to make this change is as
> follows:
>
> // <smpl>
> @r@
> identifier f;
> @@
> f(...) { ... }
> @@
> identifier r.f;
> @@
> - &f
> + f
> @m@
> type T;
> identifier f;
> @@
> T f(...);
> @@
> identifier m.f;
> @@
> - &f
> + f
> // </smpl>
>
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
> Changes in v2:
> -Modified semantic patch and consequently, this patch to make changes
> for non-static functions also.
>
> drivers/staging/rtl8712/usb_intf.c | 10 +++++-----
> drivers/staging/rtl8712/usb_ops.c | 26 +++++++++++++-------------
> 2 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
> index f1d3d70..c1a0ca49 100644
> --- a/drivers/staging/rtl8712/usb_intf.c
> +++ b/drivers/staging/rtl8712/usb_intf.c
> @@ -399,11 +399,11 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
> SET_NETDEV_DEV(pnetdev, &pusb_intf->dev);
> pnetdev->dev.type = &wlan_type;
> /* step 2. */
> - padapter->dvobj_init = &r8712_usb_dvobj_init;
> - padapter->dvobj_deinit = &r8712_usb_dvobj_deinit;
> - padapter->halpriv.hal_bus_init = &r8712_usb_hal_bus_init;
> - padapter->dvobjpriv.inirp_init = &r8712_usb_inirp_init;
> - padapter->dvobjpriv.inirp_deinit = &r8712_usb_inirp_deinit;
> + padapter->dvobj_init = r8712_usb_dvobj_init;
> + padapter->dvobj_deinit = r8712_usb_dvobj_deinit;
> + padapter->halpriv.hal_bus_init = r8712_usb_hal_bus_init;
> + padapter->dvobjpriv.inirp_init = r8712_usb_inirp_init;
> + padapter->dvobjpriv.inirp_deinit = r8712_usb_inirp_deinit;
> /* step 3.
> * initialize the dvobj_priv
> */
> diff --git a/drivers/staging/rtl8712/usb_ops.c b/drivers/staging/rtl8712/usb_ops.c
> index 856f257..9172400 100644
> --- a/drivers/staging/rtl8712/usb_ops.c
> +++ b/drivers/staging/rtl8712/usb_ops.c
> @@ -179,22 +179,22 @@ static void usb_intf_hdl_close(u8 *priv)
>
> void r8712_usb_set_intf_funs(struct intf_hdl *pintf_hdl)
> {
> - pintf_hdl->intf_hdl_init = &usb_intf_hdl_init;
> - pintf_hdl->intf_hdl_unload = &usb_intf_hdl_unload;
> - pintf_hdl->intf_hdl_open = &usb_intf_hdl_open;
> - pintf_hdl->intf_hdl_close = &usb_intf_hdl_close;
> + pintf_hdl->intf_hdl_init = usb_intf_hdl_init;
> + pintf_hdl->intf_hdl_unload = usb_intf_hdl_unload;
> + pintf_hdl->intf_hdl_open = usb_intf_hdl_open;
> + pintf_hdl->intf_hdl_close = usb_intf_hdl_close;
> }
>
> void r8712_usb_set_intf_ops(struct _io_ops *pops)
> {
> memset((u8 *)pops, 0, sizeof(struct _io_ops));
> - pops->_read8 = &usb_read8;
> - pops->_read16 = &usb_read16;
> - pops->_read32 = &usb_read32;
> - pops->_read_port = &r8712_usb_read_port;
> - pops->_write8 = &usb_write8;
> - pops->_write16 = &usb_write16;
> - pops->_write32 = &usb_write32;
> - pops->_write_mem = &r8712_usb_write_mem;
> - pops->_write_port = &r8712_usb_write_port;
> + pops->_read8 = usb_read8;
> + pops->_read16 = usb_read16;
> + pops->_read32 = usb_read32;
> + pops->_read_port = r8712_usb_read_port;
> + pops->_write8 = usb_write8;
> + pops->_write16 = usb_write16;
> + pops->_write32 = usb_write32;
> + pops->_write_mem = r8712_usb_write_mem;
> + pops->_write_port = r8712_usb_write_port;
> }
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160221062813.GA18950%40amitoj-Inspiron-3542.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH v2] staging: rtl8712: Remove exceptional & on function name
2016-02-21 13:57 ` [Outreachy kernel] " Julia Lawall
@ 2016-02-21 14:17 ` Amitoj Kaur Chawla
0 siblings, 0 replies; 3+ messages in thread
From: Amitoj Kaur Chawla @ 2016-02-21 14:17 UTC (permalink / raw)
To: Julia Lawall; +Cc: outreachy-kernel
On Sun, Feb 21, 2016 at 7:27 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Sun, 21 Feb 2016, Amitoj Kaur Chawla wrote:
>
>> In these files, function names are otherwise used as pointers without &.
>
> I'm still not clear on the "otherwise" part. This semantic patch just
> removes & from all function names. Do you do anything to ensure that that
> is the most common case already in the given file?
>
> julia
No actually there is no other such case in this file. I'll revise the
commit message and resend.
Amitoj
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-21 14:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-21 6:28 [PATCH v2] staging: rtl8712: Remove exceptional & on function name Amitoj Kaur Chawla
2016-02-21 13:57 ` [Outreachy kernel] " Julia Lawall
2016-02-21 14:17 ` Amitoj Kaur Chawla
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.