2021-04-11 18:05:29

by Julia Lawall

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8192u: Remove variable set but not used



On Sun, 11 Apr 2021, Fabio M. De Francesco wrote:

> Remove variable "int ret" which is instantiated but not used.

instantiated -> declared? I thought instantiated could mean initialized,
but that doesn't seem to be the case.

julia

>
> Signed-off-by: Fabio M. De Francesco <[email protected]>
> ---
> drivers/staging/rtl8192u/r8192U_core.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index f48186a89fa1..30055de66239 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -902,7 +902,6 @@ static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
> int rate)
> {
> struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
> - int ret;
> unsigned long flags;
> struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
> u8 queue_index = tcb_desc->queue_index;
> --
> 2.31.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 [email protected].
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20210411174143.31618-1-fmdefrancesco%40gmail.com.
>


2021-04-11 18:14:06

by Fabio M. De Francesco

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8192u: Remove variable set but not used

On Sunday, April 11, 2021 7:43:57 PM CEST Julia Lawall wrote:
> On Sun, 11 Apr 2021, Fabio M. De Francesco wrote:
> > Remove variable "int ret" which is instantiated but not used.
>
> instantiated -> declared? I thought instantiated could mean initialized,
> but that doesn't seem to be the case.
>
> julia
Please, help me to remind...

If a local variable is declared but not set to any value, does it take
space on the stack?

If I understand your message, it does not. Therefore it is only declared
but no memory is allocated for it (i.e., it is not instantiated). Right?

If you confirm I've understood this topic, I can send a v2 patch.

Thanks for your review,

Fabio
>
> > Signed-off-by: Fabio M. De Francesco <[email protected]>
> > ---
> >
> > drivers/staging/rtl8192u/r8192U_core.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/staging/rtl8192u/r8192U_core.c
> > b/drivers/staging/rtl8192u/r8192U_core.c index
> > f48186a89fa1..30055de66239 100644
> > --- a/drivers/staging/rtl8192u/r8192U_core.c
> > +++ b/drivers/staging/rtl8192u/r8192U_core.c
> > @@ -902,7 +902,6 @@ static void rtl8192_hard_data_xmit(struct sk_buff
> > *skb, struct net_device *dev,>
> > int rate)
> >
> > {
> >
> > struct r8192_priv *priv = (struct r8192_priv
*)ieee80211_priv(dev);
> >
> > - int ret;
> >
> > unsigned long flags;
> > struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb +
> > MAX_DEV_ADDR_SIZE); u8 queue_index = tcb_desc->queue_index;
> >
> > --
> > 2.31.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
> > [email protected]. To view this discussion
> > on the web visit
> > https://groups.google.com/d/msgid/outreachy-kernel/20210411174143.3161
> > 8-1-fmdefrancesco%40gmail.com.




2021-04-12 09:48:30

by Greg KH

[permalink] [raw]
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8192u: Remove variable set but not used

On Sun, Apr 11, 2021 at 08:12:05PM +0200, Fabio M. De Francesco wrote:
> On Sunday, April 11, 2021 7:43:57 PM CEST Julia Lawall wrote:
> > On Sun, 11 Apr 2021, Fabio M. De Francesco wrote:
> > > Remove variable "int ret" which is instantiated but not used.
> >
> > instantiated -> declared? I thought instantiated could mean initialized,
> > but that doesn't seem to be the case.
> >
> > julia
> Please, help me to remind...
>
> If a local variable is declared but not set to any value, does it take
> space on the stack?

Maybe, maybe not, doesn't matter either way.

> If I understand your message, it does not. Therefore it is only declared
> but no memory is allocated for it (i.e., it is not instantiated). Right?
>
> If you confirm I've understood this topic, I can send a v2 patch.

That's not the issue here at all...

confused,

greg k-h