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


Groups > linux.kernel > #1504079

Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection
Date 2016-10-19 18:30 +0200
Message-ID <su1UB-3KZ-7@gated-at.bofh.it> (permalink)
References (1 earlier) <qEuGl-43C-5@gated-at.bofh.it> <ss99T-JJ-1@gated-at.bofh.it> <ss99U-JJ-33@gated-at.bofh.it> <ssxlT-8f4-3@gated-at.bofh.it> <su02v-2rf-107@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>>>> + /* Set CEIR_EN */
>>>> + wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_CTL, 0x01, 0x01);
>>>> +set_irqmask:
>>>> /*
>>>> * ACPI will set the HW disable bit for SP3 which means that the
>>>> * output signals are left in an undefined state which may cause
>>>> @@ -876,6 +858,14 @@ wbcir_shutdown(struct pnp_dev *device)
>>>> */
>>>> wbcir_set_irqmask(data, WBCIR_IRQ_NONE);
>>>> disable_irq(data->irq);
>>>> + return;
>>>> +clear_bits:
>>>> + /* Clear BUFF_EN, Clear END_EN, Clear MATCH_EN */
>>>> + wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_EV_EN, 0x00, 0x07);
>>>> +
>>>> + /* Clear CEIR_EN */
>>>> + wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_CTL, 0x00, 0x01);
>>>> + goto set_irqmask;
>>>
>>> I'm not convinced that adding a goto which goes backwards is making this
>>> code any more readible, just so that a local variable can be dropped.
>>
>> Thanks for your feedback.
>>
>> Is such a "backward jump" usual and finally required when you would like
>> to move a bit of common error handling code to the end without using extra
>> local variables and a few statements should still be performed after it?
>>
> 
> I'm sorry, I can't parse this.

Can an other update suggestion like "[PATCH 6/6] crypto-caamhash:
Move common error handling code in two functions" explain this technique
a bit better in principle?
https://patchwork.kernel.org/patch/9333861/
https://lkml.kernel.org/r/<baa5db91-27e7-ecab-f2c9-29e549b6e5f0@users.sourceforge.net>

Regards,
Markus

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


Thread

[PATCH 0/5] [media] winbond-cir: Fine-tuning for four function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
  [PATCH 2/5] [media] winbond-cir: Move a variable assignment in  wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
    Re: [PATCH 2/5] [media] winbond-cir: Move a variable assignment  in wbcir_tx() "David Härdeman" <david@hardeman.nu> - 2016-10-19 17:40 +0200
      Re: [media] winbond-cir: Move a variable assignment in wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 18:30 +0200
  [PATCH 5/5] [media] winbond-cir: Move a variable assignment in two  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
    Re: [PATCH 5/5] [media] winbond-cir: Move a variable assignment  in two functions "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
  [PATCH 4/5] [media] winbond-cir: One variable and its check less in  wbcir_shutdown() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
    Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less  in wbcir_shutdown() after error detection Sean Young <sean@mess.org> - 2016-10-15 15:40 +0200
      Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less  in wbcir_shutdown() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-15 18:50 +0200
        Re: [PATCH 4/5] [media] winbond-cir: One variable and its check  less in wbcir_shutdown() after error detection "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
          Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less  in wbcir_shutdown() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 18:30 +0200
      Re: [PATCH 4/5] [media] winbond-cir: One variable and its check  less in wbcir_shutdown() after error detection "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
  [PATCH 1/5] [media] winbond-cir: Use kmalloc_array() in wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
    Re: [PATCH 1/5] [media] winbond-cir: Use kmalloc_array() in  wbcir_tx() "David Härdeman" <david@hardeman.nu> - 2016-10-19 17:40 +0200
  [PATCH 3/5] [media] winbond-cir: Move assignments for three variables  in wbcir_shutdown() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
    Re: [PATCH 3/5] [media] winbond-cir: Move assignments for three  variables in wbcir_shutdown() "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
      Re: [media] winbond-cir: Move assignments for three variables in  wbcir_shutdown() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:30 +0200
        Re: [media] winbond-cir: Move assignments for three variables in  wbcir_shutdown() "David Härdeman" <david@hardeman.nu> - 2016-10-19 17:50 +0200
  Re: [media] winbond-cir: Move a variable assignment in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:20 +0200
  Re: [media] winbond-cir: Move a variable assignment in wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:20 +0200
  Re: [media] winbond-cir: Move assignments for three variables in  wbcir_shutdown() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:20 +0200
  Re: [media] winbond-cir: Move a variable assignment in wbcir_tx() "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200

csiph-web