Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1303844
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] net-thunder: One check less in nicvf_register_interrupts() after error detection |
| Date | 2016-01-07 20:40 +0100 |
| Message-ID | <qOozE-4bb-3@gated-at.bofh.it> (permalink) |
| References | <qEuGl-43C-5@gated-at.bofh.it> <qLTgB-1mT-1@gated-at.bofh.it> <qOgC5-7hc-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
>> Adjust a jump target to eliminate a check before error logging.
>> Use the identifier "report_failure" instead of "err".
>
> I don't see much value in those changes.
Thanks for your feedback.
> Using the 'err' label is ok as it is not misleading and common use.
Is such a short jump label enough explanation for the information
"what" and "why"?
> And, there is no need to optimize the check since this is not the fast path
Really? - Is it a bit more efficient to avoid a double check for the
variable "ret" at the end of the current implementation for the
discussed function?
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/net/ethernet/cavium/thunder/nicvf_main.c?id=40fb5f8a60f33133d36afde35a9ad865d35e4423#n940
> and will be compiler optimized anyway.
How sure are you about automatic software optimisations?
Can it occasionally help to jump to the really intended source code
location directly?
>> @@ -944,13 +944,12 @@ static int nicvf_register_interrupts(struct nicvf *nic)
>> ret = request_irq(nic->msix_entries[irq].vector,
>> nicvf_qs_err_intr_handler,
>> 0, nic->irq_name[irq], nic);
>> - if (!ret)
>> + if (!ret) {
>> nic->irq_allocated[irq] = true;
>> -
>> -err:
>> - if (ret)
>> - netdev_err(nic->netdev, "request_irq failed, vector %d\n", irq);
>> -
>> + return 0;
>> + }
>> +report_failure:
>> + netdev_err(nic->netdev, "request_irq failed, vector %d\n", irq);
>> return ret;
>> }
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] net-thunder: One check less in nicvf_register_interrupts() after error detection Robert Richter <rric@kernel.org> - 2016-01-07 12:10 +0100
Re: [PATCH] net-thunder: One check less in nicvf_register_interrupts() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-07 20:40 +0100
Re: [PATCH] net-thunder: One check less in nicvf_register_interrupts() after error detection Joe Perches <joe@perches.com> - 2016-01-07 20:50 +0100
Re: net-thunder: One check less in nicvf_register_interrupts() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-07 21:00 +0100
Re: net-thunder: One check less in nicvf_register_interrupts() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-07 21:10 +0100
Re: net-thunder: One check less in nicvf_register_interrupts() after error detection Joe Perches <joe@perches.com> - 2016-01-07 21:30 +0100
Re: net-thunder: One check less in nicvf_register_interrupts() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-07 21:40 +0100
Re: net-thunder: One check less in nicvf_register_interrupts() after error detection Joe Perches <joe@perches.com> - 2016-01-07 21:50 +0100
Re: net-thunder: One check less in nicvf_register_interrupts() after error detection Joe Perches <joe@perches.com> - 2016-01-07 21:10 +0100
csiph-web