Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1310065

Re: [PATCH v3 2/3] gianfar: Delete unnecessary variable initialisations in gfar_ethflow_to_filer_table()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject Re: [PATCH v3 2/3] gianfar: Delete unnecessary variable initialisations in gfar_ethflow_to_filer_table()
Date 2016-01-15 12:40 +0100
Message-ID <qRaTw-5pO-19@gated-at.bofh.it> (permalink)
References <qEuGl-43C-5@gated-at.bofh.it> <qM6Qy-2kR-5@gated-at.bofh.it> <qR9ut-4CR-55@gated-at.bofh.it> <qR9E7-4Gx-33@gated-at.bofh.it> <qR9Xs-4OZ-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
>> @@ -768,12 +768,12 @@ static void ethflow_to_filer_rules (struct gfar_private *priv, u64 ethflow)
>>  static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow,
>>  				       u64 class)
>>  {
>> -	unsigned int last_rule_idx = priv->cur_filer_idx;
>> +	unsigned int last_rule_idx;
> 
> This is a write only variable.  We can just remove it.

Can a static source code analysis tool like the software "http://smatch.sourceforge.net/"
detect that such a variable is not read by this function implementation so far?
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/net/ethernet/freescale/gianfar_ethtool.c?id=b75ec3af27bf011a760e2f44eb25a99b6fbb0fb3#n850

Does this place indicate an unwanted value assignment as a leftover,
or are there any other actions missing?

Regards,
Markus

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/3] gianfar: Fine-tuning for gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 11:10 +0100
  [PATCH v3 3/3] gianfar: Extend an initialisation clause of a for loop  in gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 11:20 +0100
  [PATCH v3 2/3] gianfar: Delete unnecessary variable initialisations  in gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 11:20 +0100
    Re: [PATCH v3 2/3] gianfar: Delete unnecessary variable  initialisations in gfar_ethflow_to_filer_table() Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-15 11:40 +0100
      Re: [PATCH v3 2/3] gianfar: Delete unnecessary variable  initialisations in gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 12:40 +0100
        Re: [PATCH v3 2/3] gianfar: Delete unnecessary variable  initialisations in gfar_ethflow_to_filer_table() Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-15 13:20 +0100
        Re: [PATCH v3 2/3] gianfar: Delete unnecessary variable  initialisations in gfar_ethflow_to_filer_table() David Miller <davem@davemloft.net> - 2016-01-15 17:50 +0100
          Re: gianfar: Delete unnecessary variable initialisations in  gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 18:20 +0100
  [PATCH v3 1/3] gianfar: Less function calls in  gfar_ethflow_to_filer_table() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 11:20 +0100
    Re: [PATCH v3 1/3] gianfar: Less function calls in  gfar_ethflow_to_filer_table() after error detection Joe Perches <joe@perches.com> - 2016-01-15 11:40 +0100
      Re: gianfar: Less function calls in gfar_ethflow_to_filer_table()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 12:50 +0100
        Re: gianfar: Less function calls in gfar_ethflow_to_filer_table()  after error detection Joe Perches <joe@perches.com> - 2016-01-15 13:10 +0100
          Re: gianfar: Less function calls in gfar_ethflow_to_filer_table()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-15 18:40 +0100
            RE: gianfar: Less function calls in gfar_ethflow_to_filer_table()  after error detection Claudiu Manoil <claudiu.manoil@nxp.com> - 2016-01-18 15:50 +0100

csiph-web