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


Groups > linux.kernel > #1514896

Re: [PATCH] staging: lustre: fixed shadowed variable in socklnd_cb.c

From Andrew Kanner <andrew.kanner@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: lustre: fixed shadowed variable in socklnd_cb.c
Date 2016-11-03 23:30 +0100
Message-ID <szyGd-1ul-1@gated-at.bofh.it> (permalink)
References <szydc-11E-23@gated-at.bofh.it> <szywy-1rk-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2016-11-04 1:12 GMT+03:00 Dilger, Andreas <andreas.dilger@intel.com>:
> On Nov 3, 2016, at 15:54, Andrew Kanner <andrew.kanner@gmail.com> wrote:
>>
>> Changed variable 'tx' name in local scope
>> Fixed: sparse warning:
>> socklnd_cb.c:2476:41: warning: symbol 'tx' shadows an earlier one
>> socklnd_cb.c:2435:25: originally declared here
>
> Looking at this more closely (or from a greater distance, hard to say),
> the outer-scope "tx" is used only after this inner-scope "tx", so in
> fact there is no benefit to having the inner-scope declaration at all.
>
> Removing it may save a stack variable (depending on how the compiler
> optimizes), and shouldn't affect functionality.
>
> Cheers, Andreas

I see, I'll correct it and resend as PATCH v2. Thank you.

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


Thread

[PATCH] staging: lustre: fixed shadowed variable in socklnd_cb.c Andrew Kanner <andrew.kanner@gmail.com> - 2016-11-03 23:00 +0100
  Re: [PATCH] staging: lustre: fixed shadowed variable in socklnd_cb.c "Dilger, Andreas" <andreas.dilger@intel.com> - 2016-11-03 23:20 +0100
    Re: [PATCH] staging: lustre: fixed shadowed variable in socklnd_cb.c Andrew Kanner <andrew.kanner@gmail.com> - 2016-11-03 23:30 +0100

csiph-web