* [PATCH 01/18] staging: rtl8723au: hal: Remove useless intialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
@ 2015-10-15 8:04 ` Amitoj Kaur Chawla
2015-10-15 8:05 ` [Outreachy kernel] [PATCH 00/18] staging: Remove useless initialisation Julia Lawall
` (17 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:04 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned. The
problem was found using coccinelle semantic patch and further
opportunities were identified by hand.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
index cf15f80..b5d9e7e 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
@@ -5648,7 +5648,7 @@ static void btdm_1AntTdmaDurationAdjustForACL(struct rtw_adapter *padapter)
(pBtdm8723->curPsTdma != 11)) {
btdm_1AntSetPSTDMA(padapter, true, 0, true, pBtdm8723->psTdmaDuAdjType);
} else {
- s32 judge = 0;
+ s32 judge;
judge = btdm_1AntTdmaJudgement(padapter, pHalData->bt_coexist.halCoex8723.btRetryCnt);
if (judge == -1) {
@@ -9079,7 +9079,7 @@ static void btdm_BTCoexist8723AHandler(struct rtw_adapter *padapter)
u32 BTDM_BtTxRxCounterH(struct rtw_adapter *padapter)
{
struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
- u32 counters = 0;
+ u32 counters;
counters = pHalData->bt_coexist.halCoex8723.highPriorityTx+
pHalData->bt_coexist.halCoex8723.highPriorityRx;
@@ -9089,7 +9089,7 @@ u32 BTDM_BtTxRxCounterH(struct rtw_adapter *padapter)
u32 BTDM_BtTxRxCounterL(struct rtw_adapter *padapter)
{
struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
- u32 counters = 0;
+ u32 counters;
counters = pHalData->bt_coexist.halCoex8723.lowPriorityTx+
pHalData->bt_coexist.halCoex8723.lowPriorityRx;
@@ -9301,7 +9301,7 @@ static void BTDM_AdjustForBtOperation8723A(struct rtw_adapter *padapter)
static void BTDM_FwC2hBtRssi8723A(struct rtw_adapter *padapter, u8 *tmpBuf)
{
struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
- u8 percent = 0, u1tmp = 0;
+ u8 percent, u1tmp;
u1tmp = tmpBuf[0];
percent = u1tmp*2+10;
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* Re: [Outreachy kernel] [PATCH 00/18] staging: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
2015-10-15 8:04 ` [PATCH 01/18] staging: rtl8723au: hal: Remove useless intialisation Amitoj Kaur Chawla
@ 2015-10-15 8:05 ` Julia Lawall
2015-10-15 8:29 ` Amitoj Kaur Chawla
2015-10-15 8:05 ` [PATCH 02/18] staging: rtl8723au: core: rtw_wlan_util: Remove useless intialisation Amitoj Kaur Chawla
` (16 subsequent siblings)
18 siblings, 1 reply; 23+ messages in thread
From: Julia Lawall @ 2015-10-15 8:05 UTC (permalink / raw)
To: Amitoj Kaur Chawla; +Cc: outreachy-kernel
On Thu, 15 Oct 2015, Amitoj Kaur Chawla wrote:
> This patchset removes multiple useless intialisations of variables
> which are immediately reassigned.
The patch is probably fine, but in general, you may find that it is more
comfortable not to send quite so many patches at once.
julia
>
> The semantic patch used to find this is:
>
> // <smpl>
> @@
> type T;
> identifier x;
> constant C;
> expression e;
> @@
>
> T x
> - = C
> ;
> x = e;
> // </smpl>
>
>
> Amitoj Kaur Chawla (18):
> staging: rtl8723au: hal: Remove useless intialisation
> staging: rtl8723au: core: rtw_wlan_util: Remove useless intialisation
> staging: rtl8723au: core: rtw_recv: Remove useless initialisation
> staging: rtl8723au: core: rtw_ap: Remove useless intialisation
> staging: media: lirc: Remove useless initialisation
> staging: media: davinci_vpfe: Remove useless intialisation
> staging: lustre: ptlrpc: Remove useless initialisation
> staging: skein: Remove useless initialisation
> staging: vt6655: Remove useless initialisation
> staging: vt6656: Remove useless initialisation
> staging: wilc1000: wilc_wfi_cfgoperations: Remove useless
> initialisation
> staging: wilc1000: coreconfigurator: Remove useless initialisation
> staging: rdma: ipath: ipath_eeprom: Remove useless intialisation
> staging: rdma: ipath: ipath_init_chip: Remove useless initialisation
> staging: rdma: hfi1: diag: Remove useless initialisation
> staging: rdma: hfi1: sysfs: Remove useless initialisation
> staging: dgnc: dgnc_tty: Remove useless initialisation
> staging: dgnc: dgnc_driver: Remove useless initialisation
>
> drivers/staging/dgnc/dgnc_driver.c | 2 +-
> drivers/staging/dgnc/dgnc_tty.c | 2 +-
> drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +-
> drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c | 2 +-
> drivers/staging/media/lirc/lirc_sasem.c | 2 +-
> drivers/staging/rdma/hfi1/diag.c | 4 ++--
> drivers/staging/rdma/hfi1/sysfs.c | 2 +-
> drivers/staging/rdma/ipath/ipath_eeprom.c | 2 +-
> drivers/staging/rdma/ipath/ipath_init_chip.c | 2 +-
> drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
> drivers/staging/rtl8723au/core/rtw_recv.c | 6 +++---
> drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +-
> drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 8 ++++----
> drivers/staging/skein/skein_api.c | 2 +-
> drivers/staging/vt6655/card.c | 2 +-
> drivers/staging/vt6656/card.c | 2 +-
> drivers/staging/wilc1000/coreconfigurator.c | 10 +++++-----
> drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
> 18 files changed, 29 insertions(+), 29 deletions(-)
>
> --
> 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/cover.1444895817.git.amitoj1606%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [Outreachy kernel] [PATCH 00/18] staging: Remove useless initialisation
2015-10-15 8:05 ` [Outreachy kernel] [PATCH 00/18] staging: Remove useless initialisation Julia Lawall
@ 2015-10-15 8:29 ` Amitoj Kaur Chawla
2015-10-15 10:05 ` Julia Lawall
0 siblings, 1 reply; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:29 UTC (permalink / raw)
To: Julia Lawall; +Cc: outreachy-kernel
On Thu, Oct 15, 2015 at 1:35 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Thu, 15 Oct 2015, Amitoj Kaur Chawla wrote:
>
>> This patchset removes multiple useless intialisations of variables
>> which are immediately reassigned.
>
> The patch is probably fine, but in general, you may find that it is more
> comfortable not to send quite so many patches at once.
>
> julia
>
Hi Julia,
Since all the patches were essentially doing the same thing, just in
different files I thought it would be okay to send them all in the
same patchset. But if you think it's better to divide and send I'll do
so in the future?
>>
>> The semantic patch used to find this is:
>>
>> // <smpl>
>> @@
>> type T;
>> identifier x;
>> constant C;
>> expression e;
>> @@
>>
>> T x
>> - = C
>> ;
>> x = e;
>> // </smpl>
>>
>>
>> Amitoj Kaur Chawla (18):
>> staging: rtl8723au: hal: Remove useless intialisation
>> staging: rtl8723au: core: rtw_wlan_util: Remove useless intialisation
>> staging: rtl8723au: core: rtw_recv: Remove useless initialisation
>> staging: rtl8723au: core: rtw_ap: Remove useless intialisation
>> staging: media: lirc: Remove useless initialisation
>> staging: media: davinci_vpfe: Remove useless intialisation
>> staging: lustre: ptlrpc: Remove useless initialisation
>> staging: skein: Remove useless initialisation
>> staging: vt6655: Remove useless initialisation
>> staging: vt6656: Remove useless initialisation
>> staging: wilc1000: wilc_wfi_cfgoperations: Remove useless
>> initialisation
>> staging: wilc1000: coreconfigurator: Remove useless initialisation
>> staging: rdma: ipath: ipath_eeprom: Remove useless intialisation
>> staging: rdma: ipath: ipath_init_chip: Remove useless initialisation
>> staging: rdma: hfi1: diag: Remove useless initialisation
>> staging: rdma: hfi1: sysfs: Remove useless initialisation
>> staging: dgnc: dgnc_tty: Remove useless initialisation
>> staging: dgnc: dgnc_driver: Remove useless initialisation
>>
>> drivers/staging/dgnc/dgnc_driver.c | 2 +-
>> drivers/staging/dgnc/dgnc_tty.c | 2 +-
>> drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +-
>> drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c | 2 +-
>> drivers/staging/media/lirc/lirc_sasem.c | 2 +-
>> drivers/staging/rdma/hfi1/diag.c | 4 ++--
>> drivers/staging/rdma/hfi1/sysfs.c | 2 +-
>> drivers/staging/rdma/ipath/ipath_eeprom.c | 2 +-
>> drivers/staging/rdma/ipath/ipath_init_chip.c | 2 +-
>> drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
>> drivers/staging/rtl8723au/core/rtw_recv.c | 6 +++---
>> drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +-
>> drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 8 ++++----
>> drivers/staging/skein/skein_api.c | 2 +-
>> drivers/staging/vt6655/card.c | 2 +-
>> drivers/staging/vt6656/card.c | 2 +-
>> drivers/staging/wilc1000/coreconfigurator.c | 10 +++++-----
>> drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
>> 18 files changed, 29 insertions(+), 29 deletions(-)
>>
>> --
>> 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/cover.1444895817.git.amitoj1606%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
--
Amitoj
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [Outreachy kernel] [PATCH 00/18] staging: Remove useless initialisation
2015-10-15 8:29 ` Amitoj Kaur Chawla
@ 2015-10-15 10:05 ` Julia Lawall
2015-10-15 14:10 ` Amitoj Kaur Chawla
0 siblings, 1 reply; 23+ messages in thread
From: Julia Lawall @ 2015-10-15 10:05 UTC (permalink / raw)
To: Amitoj Kaur Chawla; +Cc: outreachy-kernel
On Thu, 15 Oct 2015, Amitoj Kaur Chawla wrote:
> On Thu, Oct 15, 2015 at 1:35 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> > On Thu, 15 Oct 2015, Amitoj Kaur Chawla wrote:
> >
> >> This patchset removes multiple useless intialisations of variables
> >> which are immediately reassigned.
> >
> > The patch is probably fine, but in general, you may find that it is more
> > comfortable not to send quite so many patches at once.
> >
> > julia
> >
>
> Hi Julia,
>
> Since all the patches were essentially doing the same thing, just in
> different files I thought it would be okay to send them all in the
> same patchset. But if you think it's better to divide and send I'll do
> so in the future?
It's just a practical issue. The more patches you send at once, the
greater the chance that you will make a mistake. I start to feel
uncomfortable beyond 10. Even for things that are not too complicated.
But it's just something to keep in mind for the future. No problem with
this patch.
julia
> >>
> >> The semantic patch used to find this is:
> >>
> >> // <smpl>
> >> @@
> >> type T;
> >> identifier x;
> >> constant C;
> >> expression e;
> >> @@
> >>
> >> T x
> >> - = C
> >> ;
> >> x = e;
> >> // </smpl>
> >>
> >>
> >> Amitoj Kaur Chawla (18):
> >> staging: rtl8723au: hal: Remove useless intialisation
> >> staging: rtl8723au: core: rtw_wlan_util: Remove useless intialisation
> >> staging: rtl8723au: core: rtw_recv: Remove useless initialisation
> >> staging: rtl8723au: core: rtw_ap: Remove useless intialisation
> >> staging: media: lirc: Remove useless initialisation
> >> staging: media: davinci_vpfe: Remove useless intialisation
> >> staging: lustre: ptlrpc: Remove useless initialisation
> >> staging: skein: Remove useless initialisation
> >> staging: vt6655: Remove useless initialisation
> >> staging: vt6656: Remove useless initialisation
> >> staging: wilc1000: wilc_wfi_cfgoperations: Remove useless
> >> initialisation
> >> staging: wilc1000: coreconfigurator: Remove useless initialisation
> >> staging: rdma: ipath: ipath_eeprom: Remove useless intialisation
> >> staging: rdma: ipath: ipath_init_chip: Remove useless initialisation
> >> staging: rdma: hfi1: diag: Remove useless initialisation
> >> staging: rdma: hfi1: sysfs: Remove useless initialisation
> >> staging: dgnc: dgnc_tty: Remove useless initialisation
> >> staging: dgnc: dgnc_driver: Remove useless initialisation
> >>
> >> drivers/staging/dgnc/dgnc_driver.c | 2 +-
> >> drivers/staging/dgnc/dgnc_tty.c | 2 +-
> >> drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +-
> >> drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c | 2 +-
> >> drivers/staging/media/lirc/lirc_sasem.c | 2 +-
> >> drivers/staging/rdma/hfi1/diag.c | 4 ++--
> >> drivers/staging/rdma/hfi1/sysfs.c | 2 +-
> >> drivers/staging/rdma/ipath/ipath_eeprom.c | 2 +-
> >> drivers/staging/rdma/ipath/ipath_init_chip.c | 2 +-
> >> drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
> >> drivers/staging/rtl8723au/core/rtw_recv.c | 6 +++---
> >> drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +-
> >> drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 8 ++++----
> >> drivers/staging/skein/skein_api.c | 2 +-
> >> drivers/staging/vt6655/card.c | 2 +-
> >> drivers/staging/vt6656/card.c | 2 +-
> >> drivers/staging/wilc1000/coreconfigurator.c | 10 +++++-----
> >> drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
> >> 18 files changed, 29 insertions(+), 29 deletions(-)
> >>
> >> --
> >> 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/cover.1444895817.git.amitoj1606%40gmail.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
>
>
>
> --
> Amitoj
>
> --
> 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/CA%2B5yK5F%2BaegUFW3UVE1S%2Bj%3D9B28q_0NRQK%3DUHN93pd7jYLP0_A%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [Outreachy kernel] [PATCH 00/18] staging: Remove useless initialisation
2015-10-15 10:05 ` Julia Lawall
@ 2015-10-15 14:10 ` Amitoj Kaur Chawla
0 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 14:10 UTC (permalink / raw)
To: Julia Lawall; +Cc: outreachy-kernel
On Thu, Oct 15, 2015 at 3:35 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Thu, 15 Oct 2015, Amitoj Kaur Chawla wrote:
>
>> On Thu, Oct 15, 2015 at 1:35 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>> > On Thu, 15 Oct 2015, Amitoj Kaur Chawla wrote:
>> >
>> >> This patchset removes multiple useless intialisations of variables
>> >> which are immediately reassigned.
>> >
>> > The patch is probably fine, but in general, you may find that it is more
>> > comfortable not to send quite so many patches at once.
>> >
>> > julia
>> >
>>
>> Hi Julia,
>>
>> Since all the patches were essentially doing the same thing, just in
>> different files I thought it would be okay to send them all in the
>> same patchset. But if you think it's better to divide and send I'll do
>> so in the future?
>
> It's just a practical issue. The more patches you send at once, the
> greater the chance that you will make a mistake. I start to feel
> uncomfortable beyond 10. Even for things that are not too complicated.
>
> But it's just something to keep in mind for the future. No problem with
> this patch.
Oh yes. Okay will keep that in mind.
Thanks,
--
Amitoj
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 02/18] staging: rtl8723au: core: rtw_wlan_util: Remove useless intialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
2015-10-15 8:04 ` [PATCH 01/18] staging: rtl8723au: hal: Remove useless intialisation Amitoj Kaur Chawla
2015-10-15 8:05 ` [Outreachy kernel] [PATCH 00/18] staging: Remove useless initialisation Julia Lawall
@ 2015-10-15 8:05 ` Amitoj Kaur Chawla
2015-10-15 8:07 ` [PATCH 03/18] staging: rtl8723au: core: rtw_recv: Remove useless initialisation Amitoj Kaur Chawla
` (15 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:05 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/rtl8723au/core/rtw_wlan_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
index 3c1315fc..5e87360 100644
--- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
@@ -1212,7 +1212,7 @@ unsigned int update_supported_rate23a(unsigned char *ptn, unsigned int ptn_sz)
unsigned int update_MSC_rate23a(struct ieee80211_ht_cap *pHT_caps)
{
- unsigned int mask = 0;
+ unsigned int mask;
mask = pHT_caps->mcs.rx_mask[0] << 12 |
pHT_caps->mcs.rx_mask[1] << 20;
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 03/18] staging: rtl8723au: core: rtw_recv: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (2 preceding siblings ...)
2015-10-15 8:05 ` [PATCH 02/18] staging: rtl8723au: core: rtw_wlan_util: Remove useless intialisation Amitoj Kaur Chawla
@ 2015-10-15 8:07 ` Amitoj Kaur Chawla
2015-10-15 8:08 ` [PATCH 04/18] staging: rtl8723au: core: rtw_ap: Remove useless intialisation Amitoj Kaur Chawla
` (14 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:07 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/rtl8723au/core/rtw_recv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c
index ad0549c..404b618 100644
--- a/drivers/staging/rtl8723au/core/rtw_recv.c
+++ b/drivers/staging/rtl8723au/core/rtw_recv.c
@@ -626,7 +626,7 @@ void process23a_pwrbit_data(struct rtw_adapter *padapter,
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
struct sta_priv *pstapriv = &padapter->stapriv;
- struct sta_info *psta = NULL;
+ struct sta_info *psta;
psta = rtw_get_stainfo23a(pstapriv, pattrib->src);
@@ -653,7 +653,7 @@ void process_wmmps_data(struct rtw_adapter *padapter,
#ifdef CONFIG_8723AU_AP_MODE
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
struct sta_priv *pstapriv = &padapter->stapriv;
- struct sta_info *psta = NULL;
+ struct sta_info *psta;
psta = rtw_get_stainfo23a(pstapriv, pattrib->src);
@@ -2151,7 +2151,7 @@ int process_recv_indicatepkts(struct rtw_adapter *padapter,
static int recv_func_prehandle(struct rtw_adapter *padapter,
struct recv_frame *rframe)
{
- int ret = _SUCCESS;
+ int ret;
/* check the frame crtl field and decache */
ret = validate_recv_frame(padapter, rframe);
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 04/18] staging: rtl8723au: core: rtw_ap: Remove useless intialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (3 preceding siblings ...)
2015-10-15 8:07 ` [PATCH 03/18] staging: rtl8723au: core: rtw_recv: Remove useless initialisation Amitoj Kaur Chawla
@ 2015-10-15 8:08 ` Amitoj Kaur Chawla
2015-10-15 8:10 ` [PATCH 05/18] staging: media: lirc: Remove useless initialisation Amitoj Kaur Chawla
` (13 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:08 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c
index 65b209a..a7c8b73 100644
--- a/drivers/staging/rtl8723au/core/rtw_ap.c
+++ b/drivers/staging/rtl8723au/core/rtw_ap.c
@@ -403,7 +403,7 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l
init_rate = get_highest_rate_idx23a(tx_ra_bitmap&0x0fffffff)&0x3f;
if (psta->aid < NUM_STA) {
- u8 arg = 0;
+ u8 arg;
arg = psta->mac_id&0x1f;
@@ -487,7 +487,7 @@ static void update_bmc_sta(struct rtw_adapter *padapter)
rtl8723a_SetHalODMVar(padapter, HAL_ODM_STA_INFO, psta, true);
{
- u8 arg = 0;
+ u8 arg;
arg = psta->mac_id&0x1f;
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 05/18] staging: media: lirc: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (4 preceding siblings ...)
2015-10-15 8:08 ` [PATCH 04/18] staging: rtl8723au: core: rtw_ap: Remove useless intialisation Amitoj Kaur Chawla
@ 2015-10-15 8:10 ` Amitoj Kaur Chawla
2015-10-15 8:11 ` [PATCH 06/18] staging: media: davinci_vpfe: Remove useless intialisation Amitoj Kaur Chawla
` (12 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:10 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/media/lirc/lirc_sasem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c
index d3dedb8..bc78da0 100644
--- a/drivers/staging/media/lirc/lirc_sasem.c
+++ b/drivers/staging/media/lirc/lirc_sasem.c
@@ -244,7 +244,7 @@ exit:
*/
static long vfd_ioctl(struct file *file, unsigned cmd, unsigned long arg)
{
- struct sasem_context *context = NULL;
+ struct sasem_context *context;
context = (struct sasem_context *) file->private_data;
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 06/18] staging: media: davinci_vpfe: Remove useless intialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (5 preceding siblings ...)
2015-10-15 8:10 ` [PATCH 05/18] staging: media: lirc: Remove useless initialisation Amitoj Kaur Chawla
@ 2015-10-15 8:11 ` Amitoj Kaur Chawla
2015-10-15 8:12 ` [PATCH 07/18] staging: lustre: ptlrpc: Remove useless initialisation Amitoj Kaur Chawla
` (11 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:11 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
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 5742619..01df068 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
@@ -294,7 +294,7 @@ static void vpfe_detach_irq(struct vpfe_device *vpfe_dev)
*/
static int vpfe_attach_irq(struct vpfe_device *vpfe_dev)
{
- int ret = 0;
+ int ret;
ret = request_irq(vpfe_dev->ccdc_irq0, vpfe_isr, 0,
"vpfe_capture0", vpfe_dev);
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 07/18] staging: lustre: ptlrpc: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (6 preceding siblings ...)
2015-10-15 8:11 ` [PATCH 06/18] staging: media: davinci_vpfe: Remove useless intialisation Amitoj Kaur Chawla
@ 2015-10-15 8:12 ` Amitoj Kaur Chawla
2015-10-15 8:14 ` [PATCH 08/18] staging: skein: " Amitoj Kaur Chawla
` (10 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:12 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c
index 6aaa5dd..0c4df7e 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -696,7 +696,7 @@ static inline
struct ptlrpc_request *__ptlrpc_request_alloc(struct obd_import *imp,
struct ptlrpc_request_pool *pool)
{
- struct ptlrpc_request *request = NULL;
+ struct ptlrpc_request *request;
request = ptlrpc_request_cache_alloc(GFP_NOFS);
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 08/18] staging: skein: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (7 preceding siblings ...)
2015-10-15 8:12 ` [PATCH 07/18] staging: lustre: ptlrpc: Remove useless initialisation Amitoj Kaur Chawla
@ 2015-10-15 8:14 ` Amitoj Kaur Chawla
2015-10-15 8:15 ` [PATCH 09/18] staging: vt6655: " Amitoj Kaur Chawla
` (9 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:14 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/skein/skein_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/skein/skein_api.c b/drivers/staging/skein/skein_api.c
index 5bfce07..7f23803 100644
--- a/drivers/staging/skein/skein_api.c
+++ b/drivers/staging/skein/skein_api.c
@@ -128,7 +128,7 @@ int skein_mac_init(struct skein_ctx *ctx, const u8 *key, size_t key_len,
void skein_reset(struct skein_ctx *ctx)
{
size_t x_len = 0;
- u64 *x = NULL;
+ u64 *x;
/*
* The following two lines rely of the fact that the real Skein
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 09/18] staging: vt6655: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (8 preceding siblings ...)
2015-10-15 8:14 ` [PATCH 08/18] staging: skein: " Amitoj Kaur Chawla
@ 2015-10-15 8:15 ` Amitoj Kaur Chawla
2015-10-15 8:17 ` [PATCH 10/18] staging: vt6656: " Amitoj Kaur Chawla
` (8 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:15 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/vt6655/card.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index f842be6..4640b56 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -892,7 +892,7 @@ bool CARDbSoftwareReset(struct vnt_private *pDevice)
u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2)
{
u64 qwTSFOffset = 0;
- unsigned short wRxBcnTSFOffst = 0;
+ unsigned short wRxBcnTSFOffst;
wRxBcnTSFOffst = cwRXBCNTSFOff[byRxRate%MAX_RATE];
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 10/18] staging: vt6656: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (9 preceding siblings ...)
2015-10-15 8:15 ` [PATCH 09/18] staging: vt6655: " Amitoj Kaur Chawla
@ 2015-10-15 8:17 ` Amitoj Kaur Chawla
2015-10-15 8:18 ` [PATCH 11/18] staging: wilc1000: wilc_wfi_cfgoperations: " Amitoj Kaur Chawla
` (7 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:17 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/vt6656/card.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index a215563..167dca9 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -508,7 +508,7 @@ u8 vnt_get_pkt_type(struct vnt_private *priv)
u64 vnt_get_tsf_offset(u8 rx_rate, u64 tsf1, u64 tsf2)
{
u64 tsf_offset = 0;
- u16 rx_bcn_offset = 0;
+ u16 rx_bcn_offset;
rx_bcn_offset = cwRXBCNTSFOff[rx_rate % MAX_RATE];
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 11/18] staging: wilc1000: wilc_wfi_cfgoperations: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (10 preceding siblings ...)
2015-10-15 8:17 ` [PATCH 10/18] staging: vt6656: " Amitoj Kaur Chawla
@ 2015-10-15 8:18 ` Amitoj Kaur Chawla
2015-10-15 8:19 ` [PATCH 12/18] staging: wilc1000: coreconfigurator: " Amitoj Kaur Chawla
` (6 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:18 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 6472777..153ada8 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -550,7 +550,7 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
if (enuConnDisconnEvent == CONN_DISCONN_EVENT_CONN_RESP) {
/*Initialization*/
- u16 u16ConnectStatus = WLAN_STATUS_SUCCESS;
+ u16 u16ConnectStatus;
u16ConnectStatus = pstrConnectInfo->u16ConnectStatus;
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 12/18] staging: wilc1000: coreconfigurator: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (11 preceding siblings ...)
2015-10-15 8:18 ` [PATCH 11/18] staging: wilc1000: wilc_wfi_cfgoperations: " Amitoj Kaur Chawla
@ 2015-10-15 8:19 ` Amitoj Kaur Chawla
2015-10-15 8:20 ` [PATCH 13/18] staging: rdma: ipath: ipath_eeprom: Remove useless intialisation Amitoj Kaur Chawla
` (5 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:19 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/wilc1000/coreconfigurator.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 9f87d05..108d636 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -114,7 +114,7 @@ enum info_element_id {
/* response frame. */
static inline u16 get_beacon_period(u8 *data)
{
- u16 bcn_per = 0;
+ u16 bcn_per;
bcn_per = data[0];
bcn_per |= (data[1] << 8);
@@ -256,7 +256,7 @@ static inline u16 get_cap_info(u8 *data)
/* response frame. */
static inline u16 get_assoc_resp_cap_info(u8 *data)
{
- u16 cap_info = 0;
+ u16 cap_info;
cap_info = data[0];
cap_info |= (data[1] << 8);
@@ -268,7 +268,7 @@ static inline u16 get_assoc_resp_cap_info(u8 *data)
/* association response frame and returns association status code */
static inline u16 get_asoc_status(u8 *data)
{
- u16 asoc_status = 0;
+ u16 asoc_status;
asoc_status = data[3];
asoc_status = (asoc_status << 8) | data[2];
@@ -280,7 +280,7 @@ static inline u16 get_asoc_status(u8 *data)
/* response frame */
static inline u16 get_asoc_id(u8 *data)
{
- u16 asoc_id = 0;
+ u16 asoc_id;
asoc_id = data[4];
asoc_id |= (data[5] << 8);
@@ -290,7 +290,7 @@ static inline u16 get_asoc_id(u8 *data)
u8 *get_tim_elm(u8 *pu8msa, u16 u16RxLen, u16 u16TagParamOffset)
{
- u16 u16index = 0;
+ u16 u16index;
/*************************************************************************/
/* Beacon Frame - Frame Body */
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 13/18] staging: rdma: ipath: ipath_eeprom: Remove useless intialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (12 preceding siblings ...)
2015-10-15 8:19 ` [PATCH 12/18] staging: wilc1000: coreconfigurator: " Amitoj Kaur Chawla
@ 2015-10-15 8:20 ` Amitoj Kaur Chawla
2015-10-15 8:22 ` [PATCH 14/18] staging: rdma: ipath: ipath_init_chip: Remove useless initialisation Amitoj Kaur Chawla
` (4 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:20 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/rdma/ipath/ipath_eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rdma/ipath/ipath_eeprom.c b/drivers/staging/rdma/ipath/ipath_eeprom.c
index fc71819..ef84107 100644
--- a/drivers/staging/rdma/ipath/ipath_eeprom.c
+++ b/drivers/staging/rdma/ipath/ipath_eeprom.c
@@ -411,7 +411,7 @@ bail:
*/
static int i2c_probe(struct ipath_devdata *dd, int devaddr)
{
- int ret = 0;
+ int ret;
ret = eeprom_reset(dd);
if (ret) {
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 14/18] staging: rdma: ipath: ipath_init_chip: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (13 preceding siblings ...)
2015-10-15 8:20 ` [PATCH 13/18] staging: rdma: ipath: ipath_eeprom: Remove useless intialisation Amitoj Kaur Chawla
@ 2015-10-15 8:22 ` Amitoj Kaur Chawla
2015-10-15 8:23 ` [PATCH 15/18] staging: rdma: hfi1: diag: " Amitoj Kaur Chawla
` (3 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:22 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/rdma/ipath/ipath_init_chip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rdma/ipath/ipath_init_chip.c b/drivers/staging/rdma/ipath/ipath_init_chip.c
index e95af81..8b79d89 100644
--- a/drivers/staging/rdma/ipath/ipath_init_chip.c
+++ b/drivers/staging/rdma/ipath/ipath_init_chip.c
@@ -210,7 +210,7 @@ static int bringup_link(struct ipath_devdata *dd)
static struct ipath_portdata *create_portdata0(struct ipath_devdata *dd)
{
- struct ipath_portdata *pd = NULL;
+ struct ipath_portdata *pd;
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
if (pd) {
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 15/18] staging: rdma: hfi1: diag: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (14 preceding siblings ...)
2015-10-15 8:22 ` [PATCH 14/18] staging: rdma: ipath: ipath_init_chip: Remove useless initialisation Amitoj Kaur Chawla
@ 2015-10-15 8:23 ` Amitoj Kaur Chawla
2015-10-15 8:24 ` [PATCH 16/18] staging: rdma: hfi1: sysfs: " Amitoj Kaur Chawla
` (2 subsequent siblings)
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:23 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/rdma/hfi1/diag.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rdma/hfi1/diag.c b/drivers/staging/rdma/hfi1/diag.c
index 3e8d5ac..62c8cac 100644
--- a/drivers/staging/rdma/hfi1/diag.c
+++ b/drivers/staging/rdma/hfi1/diag.c
@@ -607,7 +607,7 @@ static int hfi1_snoop_add(struct hfi1_devdata *dd, const char *name)
static struct hfi1_devdata *hfi1_dd_from_sc_inode(struct inode *in)
{
int unit = iminor(in) - HFI1_SNOOP_CAPTURE_BASE;
- struct hfi1_devdata *dd = NULL;
+ struct hfi1_devdata *dd;
dd = hfi1_lookup(unit);
return dd;
@@ -1478,7 +1478,7 @@ static struct snoop_packet *allocate_snoop_packet(u32 hdr_len,
u32 md_len)
{
- struct snoop_packet *packet = NULL;
+ struct snoop_packet *packet;
packet = kzalloc(sizeof(struct snoop_packet) + hdr_len + data_len
+ md_len,
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 16/18] staging: rdma: hfi1: sysfs: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (15 preceding siblings ...)
2015-10-15 8:23 ` [PATCH 15/18] staging: rdma: hfi1: diag: " Amitoj Kaur Chawla
@ 2015-10-15 8:24 ` Amitoj Kaur Chawla
2015-10-15 8:25 ` [PATCH 17/18] staging: dgnc: dgnc_tty: " Amitoj Kaur Chawla
2015-10-15 8:26 ` [PATCH 18/18] staging: dgnc: dgnc_driver: " Amitoj Kaur Chawla
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:24 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/rdma/hfi1/sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rdma/hfi1/sysfs.c b/drivers/staging/rdma/hfi1/sysfs.c
index b78c728..1dd6727 100644
--- a/drivers/staging/rdma/hfi1/sysfs.c
+++ b/drivers/staging/rdma/hfi1/sysfs.c
@@ -555,7 +555,7 @@ static ssize_t show_tempsense(struct device *device,
container_of(device, struct hfi1_ibdev, ibdev.dev);
struct hfi1_devdata *dd = dd_from_dev(dev);
struct hfi1_temp temp;
- int ret = -ENXIO;
+ int ret;
ret = hfi1_tempsense_rd(dd, &temp);
if (!ret) {
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 17/18] staging: dgnc: dgnc_tty: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (16 preceding siblings ...)
2015-10-15 8:24 ` [PATCH 16/18] staging: rdma: hfi1: sysfs: " Amitoj Kaur Chawla
@ 2015-10-15 8:25 ` Amitoj Kaur Chawla
2015-10-15 8:26 ` [PATCH 18/18] staging: dgnc: dgnc_driver: " Amitoj Kaur Chawla
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:25 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/dgnc/dgnc_tty.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index a8d50a5..c764918 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -855,7 +855,7 @@ static void dgnc_set_custom_speed(struct channel_t *ch, uint newrate)
void dgnc_check_queue_flow_control(struct channel_t *ch)
{
- int qleft = 0;
+ int qleft;
/* Store how much space we have left in the queue */
qleft = ch->ch_r_tail - ch->ch_r_head - 1;
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 18/18] staging: dgnc: dgnc_driver: Remove useless initialisation
2015-10-15 8:02 [PATCH 00/18] staging: Remove useless initialisation Amitoj Kaur Chawla
` (17 preceding siblings ...)
2015-10-15 8:25 ` [PATCH 17/18] staging: dgnc: dgnc_tty: " Amitoj Kaur Chawla
@ 2015-10-15 8:26 ` Amitoj Kaur Chawla
18 siblings, 0 replies; 23+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-15 8:26 UTC (permalink / raw)
To: outreachy-kernel
Remove intialisation of a variable that is immediately reassigned.
The semantic patch used to find this is:
// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@
T x
- = C
;
x = e;
// </smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/dgnc/dgnc_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index ce2d1c7..6c39850 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -170,7 +170,7 @@ static void dgnc_cleanup_module(void)
*/
static int __init dgnc_init_module(void)
{
- int rc = 0;
+ int rc;
/*
* Initialize global stuff
--
1.9.1
^ permalink raw reply related [flat|nested] 23+ messages in thread