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


Groups > linux.kernel > #1289503 > unrolled thread

Source code review around jump label usage

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2015-12-11 13:10 +0100
Last post2016-01-01 22:50 +0100
Articles 20 on this page of 184 — 21 participants

Back to article view | Back to linux.kernel


Contents

  Source code review around jump label usage SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-11 13:10 +0100
    Re: Source code review around jump label usage Julia Lawall <julia.lawall@lip6.fr> - 2015-12-11 13:20 +0100
    Re: Source code review around jump label usage Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-11 13:50 +0100
    Re: Source code review around jump label usage Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2015-12-11 19:10 +0100
    [PATCH 0/2] block: Fine-tuning for two function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-11 19:20 +0100
      [PATCH 2/2] z2ram: Delete a jump label in z2_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-11 19:30 +0100
        Re: [PATCH 2/2] z2ram: Delete a jump label in z2_init() Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-12-14 01:40 +0100
          Re: [PATCH 2/2] z2ram: Delete a jump label in z2_init() Geert Uytterhoeven <geert@linux-m68k.org> - 2015-12-14 10:20 +0100
      [PATCH 1/2] zram: Less checks in zram_bvec_write() after error  detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-11 19:30 +0100
        Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error  detection Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-12-14 01:30 +0100
          Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error  detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-14 08:00 +0100
            Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error  detection Julia Lawall <julia.lawall@lip6.fr> - 2015-12-14 08:20 +0100
            Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error  detection Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-12-14 11:10 +0100
              Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error  detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-14 15:10 +0100
    [PATCH] uinput: Rename a jump label in uinput_ioctl_handler() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 10:20 +0100
      Re: [PATCH] uinput: Rename a jump label in uinput_ioctl_handler() Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-12-12 23:30 +0100
    [PATCH 0/7] iSCSI-target: Fine-tuning for three function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 15:40 +0100
      [PATCH 1/7] iscsi-target: Use a variable initialisation in  iscsi_set_default_param() directly SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 15:40 +0100
        Re: [PATCH 1/7] iscsi-target: Use a variable initialisation in  iscsi_set_default_param() directly Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-12 21:00 +0100
          Re: [PATCH 1/7] iscsi-target: Use a variable initialisation in  iscsi_set_default_param() directly SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 22:30 +0100
          Re: [PATCH 1/7] iscsi-target: Use a variable initialisation in  iscsi_set_default_param() directly Johannes Thumshirn <jthumshirn@suse.de> - 2015-12-14 09:50 +0100
            Re: [PATCH 1/7] iscsi-target: Use a variable initialisation in  iscsi_set_default_param() directly SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-14 12:40 +0100
      [PATCH 2/7] iscsi-target: Less checks in iscsi_set_default_param()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 15:40 +0100
      [PATCH 3/7] iscsi-target: Delete an unnecessary variable  initialisation in iscsi_create_default_params() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 15:50 +0100
      Re: [PATCH 4/7] iscsi-target: Make a variable initialisation a bit  more obvious in iscsi_create_default_params() Julia Lawall <julia.lawall@lip6.fr> - 2015-12-12 15:50 +0100
        Re: [PATCH 4/7] iscsi-target: Make a variable initialisation a bit  more obvious in iscsi_create_default_params() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 16:10 +0100
      [PATCH 6/7] iscsi-target: Delete unnecessary variable initialisations  in iscsi_check_valuelist_for_support() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 15:50 +0100
      [PATCH 7/7] iscsi-target: Make two variable initialisations a bit  more obvious in iscsi_check_valuelist_for_support() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 15:50 +0100
        Re: [PATCH 7/7] iscsi-target: Make two variable initialisations a  bit more obvious in iscsi_check_valuelist_for_support() walter harms <wharms@bfs.de> - 2015-12-12 18:20 +0100
      [PATCH 4/7] iscsi-target: Make a variable initialisation a bit more  obvious in iscsi_create_default_params() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 15:50 +0100
      [PATCH 5/7] iscsi-target: Rename a jump label in  iscsi_create_default_params() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-12 15:50 +0100
    [PATCH 0/7] staging-Lustre: Fine-tuning for some function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-13 14:50 +0100
      [PATCH 2/7] staging: lustre: Rename a jump label for  ptlrpc_req_finished() calls SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-13 15:00 +0100
        Re: [PATCH 2/7] staging: lustre: Rename a jump label for  ptlrpc_req_finished() calls Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-14 08:00 +0100
          Re: [PATCH 2/7] staging: lustre: Rename a jump label for  ptlrpc_req_finished() calls SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-14 10:10 +0100
            Re: [PATCH 2/7] staging: lustre: Rename a jump label for  ptlrpc_req_finished() calls Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-14 10:40 +0100
              Re: staging: lustre: Rename a jump label for ptlrpc_req_finished()  calls SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-14 11:10 +0100
      [PATCH 1/7] staging: lustre: Delete unnecessary goto statements in  six functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-13 15:00 +0100
        Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements  in six functions Joe Perches <joe@perches.com> - 2015-12-15 15:30 +0100
          Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements  in six functions Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-15 15:50 +0100
            Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements  in six functions Joe Perches <joe@perches.com> - 2015-12-15 16:10 +0100
              Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements  in six functions Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-15 18:50 +0100
                Re: [PATCH 1/7] staging: lustre: Delete unnecessary goto statements  in six functions Joe Perches <joe@perches.com> - 2015-12-15 19:20 +0100
                  Re: staging: lustre: Delete unnecessary goto statements in six  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-15 19:30 +0100
                    Re: staging: lustre: Delete unnecessary goto statements in six  functions Joe Perches <joe@perches.com> - 2015-12-15 19:40 +0100
                      Re: staging: lustre: Delete unnecessary goto statements in six  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-15 20:00 +0100
                        Re: staging: lustre: Delete unnecessary goto statements in six  functions Joe Perches <joe@perches.com> - 2015-12-15 20:00 +0100
              Re: staging: lustre: Delete unnecessary goto statements in six  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-15 19:10 +0100
                Re: staging: lustre: Delete unnecessary goto statements in six  functions Joe Perches <joe@perches.com> - 2015-12-15 19:30 +0100
      [PATCH 3/7] staging: lustre: Rename a jump label for a kfree(key)  call SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-13 15:00 +0100
      [PATCH 6/7] staging: lustre: A few checks less in  mgc_process_recover_log() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-13 15:00 +0100
      [PATCH 5/7] staging: lustre: Less checks in mgc_process_recover_log()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-13 15:00 +0100
        Re: [PATCH 5/7] staging: lustre: Less checks in  mgc_process_recover_log() after error detection Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-14 12:10 +0100
          Re: [PATCH 5/7] staging: lustre: Less checks in  mgc_process_recover_log() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-14 13:10 +0100
            Re: [PATCH 5/7] staging: lustre: Less checks in  mgc_process_recover_log() after error detection Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-14 13:40 +0100
              Re: staging: lustre: Less checks in mgc_process_recover_log() after  error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-14 13:50 +0100
                Re: staging: lustre: Less checks in mgc_process_recover_log() after  error detection Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-14 15:00 +0100
                  Re: staging: lustre: Less checks in mgc_process_recover_log() after  error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-14 18:50 +0100
                    Re: staging: lustre: Less checks in mgc_process_recover_log() after  error detection Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-15 12:50 +0100
                      Re: staging: lustre: Less checks in mgc_process_recover_log() after  error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-15 16:10 +0100
      [PATCH 4/7] staging: lustre: Delete an unnecessary variable  initialisation in mgc_process_recover_log() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-13 15:00 +0100
      [PATCH 7/7] staging: lustre: Rename a jump label for module_put()  calls SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-13 15:10 +0100
      [PATCH v2 0/4] staging-Lustre: Fine-tuning for some function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-21 20:10 +0100
        [PATCH v2 1/4] staging: lustre: Delete unnecessary goto statements in  six functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-21 20:10 +0100
        [PATCH v2 4/4] staging: lustre: Fix a jump label position in  osc_get_info() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-21 20:20 +0100
        [PATCH v2 3/4] staging: lustre: Less checks in  mgc_process_recover_log() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-21 20:20 +0100
          Re: [PATCH v2 3/4] staging: lustre: Less checks in  mgc_process_recover_log() after error detection Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-12-22 00:50 +0100
            Re: [PATCH v2 3/4] staging: lustre: Less checks in  mgc_process_recover_log() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-22 08:20 +0100
            Re: [PATCH v2 3/4] staging: lustre: Less checks in  mgc_process_recover_log() after error detection Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-22 09:10 +0100
        [PATCH v2 2/4] staging: lustre: Delete an unnecessary variable  initialisation in mgc_process_recover_log() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-21 20:20 +0100
    [POWERPC] bootwrapper: One check less in fsl_get_immr() after error  detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-14 23:20 +0100
      Re: [POWERPC] bootwrapper: One check less in fsl_get_immr() after  error detection Scott Wood <scottwood@freescale.com> - 2015-12-14 23:40 +0100
    [PATCH] block-LDM: One function call less in ldm_validate_tocblocks()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-23 10:50 +0100
      Re: [PATCH] block-LDM: One function call less in ldm_validate_tocblocks()  after error detection Julia Lawall <julia.lawall@lip6.fr> - 2015-12-23 11:50 +0100
        [PATCH 0/5] block-LDM: Improvements for exception handling SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-23 19:10 +0100
          [PATCH 1/5] block-LDM: One function call less in  ldm_validate_tocblocks() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-23 19:10 +0100
          [PATCH 2/5] block-LDM: Delete extra log messages for memory  allocation failures SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-23 19:10 +0100
          [PATCH 3/5] block-LDM: One function call less in ldm_partition()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-23 19:20 +0100
          [PATCH 5/5] block-LDM: Fine-tuning for the source code formatting SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-23 19:20 +0100
          [PATCH 4/5] block-LDM: Less function calls in  ldm_validate_privheads() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-23 19:20 +0100
    [PATCH 0/3] Documentation-getdelays: Fine-tuning for two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-24 13:40 +0100
      [PATCH 2/3] Documentation-getdelays: Apply a recommendation from  "checkpatch.pl" in main() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-24 13:40 +0100
        Re: [PATCH 2/3] Documentation-getdelays: Apply a recommendation  from "checkpatch.pl" in main() Jonathan Corbet <corbet@lwn.net> - 2015-12-24 15:30 +0100
      [PATCH 1/3] Documentation-getdelays: Fix a check for container file  usage in main() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-24 13:40 +0100
        Re: [PATCH 1/3] Documentation-getdelays: Fix a check for container  file usage in main() Jonathan Corbet <corbet@lwn.net> - 2015-12-24 15:30 +0100
          Re: Documentation-getdelays: Fix a check for container file usage in  main() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-24 19:00 +0100
      [PATCH 3/3] Documentation-getdelays: Less function calls in usage() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-24 13:40 +0100
        Re: [PATCH 3/3] Documentation-getdelays: Less function calls in  usage() Jonathan Corbet <corbet@lwn.net> - 2015-12-24 15:30 +0100
          Re: Documentation-getdelays: Less function calls in usage() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-24 20:50 +0100
    ACPI-fan: Another source code review around null pointer handling? SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-25 11:40 +0100
    sata_mv: Another source code review around exception handling? SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-25 17:10 +0100
      Re: sata_mv: Another source code review around exception handling? Tejun Heo <tj@kernel.org> - 2015-12-28 17:20 +0100
    [PATCH] gpio-ucb1400: Delete an unnecessary variable initialisation  in ucb1400_gpio_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-25 20:00 +0100
    [PATCH] i2c-core: One function call less in acpi_i2c_space_handler()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 07:40 +0100
      Re: [PATCH] i2c-core: One function call less in  acpi_i2c_space_handler() after error detection kbuild test robot <lkp@intel.com> - 2015-12-26 07:50 +0100
        [PATCH v2] i2c-core: One function call less in  acpi_i2c_space_handler() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 08:10 +0100
          Re: [PATCH v2] i2c-core: One function call less in  acpi_i2c_space_handler() after error detection Wolfram Sang <wsa@the-dreams.de> - 2015-12-26 08:50 +0100
            Re: i2c-core: One function call less in acpi_i2c_space_handler()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 10:00 +0100
              Re: i2c-core: One function call less in acpi_i2c_space_handler()  after error detection Wolfram Sang <wsa@the-dreams.de> - 2015-12-26 19:50 +0100
                Re: i2c-core: One function call less in acpi_i2c_space_handler()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 20:40 +0100
    [PATCH 0/3] IDE-ACPI: Fine-tuning for a function SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 11:20 +0100
      [PATCH 2/3] IDE-ACPI: Delete unnecessary null pointer checks in  ide_get_dev_handle() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 11:20 +0100
      [PATCH 1/3] IDE-ACPI: One function call less in ide_get_dev_handle()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 11:20 +0100
      [PATCH 3/3] IDE-ACPI: Move an assignment for one variable in  ide_get_dev_handle() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 11:30 +0100
      Re: [PATCH 0/3] IDE-ACPI: Fine-tuning for a function David Miller <davem@davemloft.net> - 2015-12-26 19:20 +0100
        Re: [PATCH 0/3] IDE-ACPI: Fine-tuning for a function Joe Perches <joe@perches.com> - 2015-12-27 00:50 +0100
          Re: [PATCH 0/3] IDE-ACPI: Fine-tuning for a function Julia Lawall <julia.lawall@lip6.fr> - 2015-12-27 07:10 +0100
    [PATCH] iio: qcom-spmi-vadc: One check less in  vadc_measure_ref_points() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 14:10 +0100
    [PATCH 0/6] InfiniBand-ocrdma: Fine-tuning for some function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 19:40 +0100
      [PATCH 2/6] InfiniBand-ocrdma: Delete unnecessary variable  initialisations in 11 functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 19:50 +0100
      [PATCH 4/6] InfiniBand-ocrdma: Return a value from a function call in  _ocrdma_modify_qp() directly SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 19:50 +0100
      [PATCH 1/6] InfiniBand-ocrdma: One variable and jump label less in  ocrdma_alloc_ucontext_pd() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 19:50 +0100
        Re: [PATCH 1/6] InfiniBand-ocrdma: One variable and jump label less  in ocrdma_alloc_ucontext_pd() kbuild test robot <lkp@intel.com> - 2015-12-26 20:50 +0100
          [PATCH v2 1/6] InfiniBand-ocrdma: One jump label less in  ocrdma_alloc_ucontext_pd() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 22:30 +0100
      [PATCH 3/6] InfiniBand-ocrdma: Returning only value constants in  ocrdma_qp_state_change() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 19:50 +0100
      [PATCH 5/6] InfiniBand-ocrdma: Returning only value constants in  ocrdma_resize_cq() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 20:00 +0100
      [PATCH 6/6] InfiniBand-ocrdma: Delete an unnecessary variable in  ocrdma_dealloc_pd() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-26 20:00 +0100
    [PATCH 0/2] InfiniBand-iSER: Refactoring for two function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-27 13:40 +0100
      [PATCH 1/2] InfiniBand-iSER: One jump label less in iser_reg_sig_mr() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-27 13:50 +0100
      [PATCH 2/2] InfiniBand-iSER-target: One jump label less in  isert_reg_sig_mr() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-27 13:50 +0100
      Re: [PATCH 0/2] InfiniBand-iSER: Refactoring for two function  implementations Leon Romanovsky <leon@leon.nu> - 2015-12-27 13:50 +0100
      Re: [PATCH 0/2] InfiniBand-iSER: Refactoring for two function  implementations Leon Romanovsky <leon@leon.nu> - 2015-12-27 14:00 +0100
      Re: [PATCH 0/2] InfiniBand-iSER: Refactoring for two function  implementations Sagi Grimberg <sagig@dev.mellanox.co.il> - 2015-12-27 16:30 +0100
    [PATCH] [media] si2165: Refactoring for si2165_writereg_mask8() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 03:50 +0100
    [PATCH] [media] bttv: Returning only value constants in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 03:50 +0100
    [PATCH] [media] tuners: One check less in  m88rs6000t_get_rf_strength() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 10:20 +0100
      Re: [PATCH] [media] tuners: One check less in m88rs6000t_get_rf_strength()  after error detection Julia Lawall <julia.lawall@lip6.fr> - 2015-12-28 10:30 +0100
        Re: [media] tuners: One check less in m88rs6000t_get_rf_strength()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 11:40 +0100
          Re: [media] tuners: One check less in m88rs6000t_get_rf_strength()  after error detection Julia Lawall <julia.lawall@lip6.fr> - 2015-12-28 11:40 +0100
            [PATCH 0/2] [media] m88rs6000t: Fine-tuning for some function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 15:40 +0100
              [PATCH 1/2] [media] m88rs6000t: Better exception handling in five  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 15:40 +0100
                Re: [PATCH 1/2] [media] m88rs6000t: Better exception handling in  five functions Julia Lawall <julia.lawall@lip6.fr> - 2015-12-28 15:50 +0100
                  Re: [media] m88rs6000t: Better exception handling in five functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 16:10 +0100
                    Re: [media] m88rs6000t: Better exception handling in five  functions Julia Lawall <julia.lawall@lip6.fr> - 2015-12-28 16:20 +0100
              [PATCH 2/2] [media] tuners: Refactoring for m88rs6000t_sleep() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 15:50 +0100
    [PATCH 0/2] [media] r820t: Fine-tuning for generic_set_freq() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 17:30 +0100
      [PATCH 1/2] [media] r820t: Delete an unnecessary variable  initialisation in generic_set_freq() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 17:40 +0100
      [PATCH 2/2] [media] r820t: Better exception handling in  generic_set_freq() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 17:40 +0100
    [PATCH] [media] xc5000: Faster result reporting in  xc_load_fw_and_init_tuner() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 20:30 +0100
    [PATCH] [media] airspy: Better exception handling in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 22:20 +0100
    [PATCH] [media] au0828: Refactoring for start_urb_transfer() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-28 23:00 +0100
    [PATCH] [media] hdpvr: Refactoring for hdpvr_read() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 11:20 +0100
    [PATCH] [media] msi2500: Delete an unnecessary check in  msi2500_set_usb_adc() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 12:40 +0100
    [PATCH] mfd-dm355evm_msp: One function call less in add_child() after  error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 14:10 +0100
    [PATCH 2/2] mfd: smsc-ece1099: Refactoring for smsc_i2c_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 15:20 +0100
    [PATCH 1/2] mfd: smsc-ece1099: Delete an unnecessary variable  initialisation in smsc_i2c_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 15:20 +0100
    [PATCH 0/2] mfd: smsc-ece1099: Fine-tuning for smsc_i2c_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 15:20 +0100
    [PATCH] mfd: twl-core: One function call less in add_numbered_child()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 19:40 +0100
    [PATCH] mmc-core: One check less in mmc_select_hs200() after error  detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 21:00 +0100
    [PATCH 0/2] mmc-host: Fine-tuning for one function SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 22:00 +0100
      [PATCH 1/2] mmc-sdricoh_cs: Delete unnecessary variable  initialisations in sdricoh_init_mmc() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 22:10 +0100
      [PATCH 2/2] mmc-sdricoh_cs: Less checks in sdricoh_init_mmc() after,  error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-29 22:10 +0100
    [PATCH 3/3] mtd-rfd_ftl: Refactoring for erase_block() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-31 21:30 +0100
    [PATCH 1/3] mtd-rfd_ftl: Replace a variable initialisation by  assignments in move_block_contents() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-31 21:30 +0100
    [PATCH 2/3] mtd-rfd_ftl: Refactoring for move_block_contents() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-31 21:30 +0100
    [PATCH 0/3] mtd-rfd_ftl: Fine-tuning for two function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-31 21:30 +0100
    [PATCH] net-thunder: One check less in nicvf_register_interrupts()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-12-31 22:50 +0100
    [PATCH] be2net: Delete an unnecessary check in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 00:30 +0100
    [PATCH 0/3] net-gianfar: Fine-tuning for  gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 13:20 +0100
      [PATCH 2/3] net-gianfar: Delete unnecessary variable initialisations  in gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 13:30 +0100
      [PATCH 3/3] net-gianfar: Extend an initialisation clause of a for  loop in gfar_ethflow_to_filer_table() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 13:30 +0100
      [PATCH 1/3] net-gianfar: Less function calls in  gfar_ethflow_to_filer_table() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 13:30 +0100
        Re: [PATCH 1/3] net-gianfar: Less function calls in  gfar_ethflow_to_filer_table() after error detection Julia Lawall <julia.lawall@lip6.fr> - 2016-01-01 13:40 +0100
          Re: [PATCH 1/3] net-gianfar: Less function calls in  gfar_ethflow_to_filer_table() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 14:00 +0100
            Re: [PATCH 1/3] net-gianfar: Less function calls in  gfar_ethflow_to_filer_table() after error detection Julia Lawall <julia.lawall@lip6.fr> - 2016-01-01 14:10 +0100
              Re: [PATCH 1/3] net-gianfar: Less function calls in  gfar_ethflow_to_filer_table() after error detection Francois Romieu <romieu@fr.zoreil.com> - 2016-01-01 15:50 +0100
          [PATCH v2 1/3] net-gianfar: Less function calls in  gfar_ethflow_to_filer_table() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 14:10 +0100
    [PATCH] net-i40e: Replace variable initialisations by assignments in  i40e_vc_get_vf_resources_msg() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 15:40 +0100
    [PATCH] net-huawei_cdc_ncm: Delete an unnecessary variable  initialisation in huawei_cdc_ncm_bind() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 17:00 +0100
    [PATCH 0/2] net-qmi_wwan: Fine-tuning for two function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 18:00 +0100
      [PATCH 1/2] net-qmi_wwan: Refactoring for qmi_wwan_bind() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 18:00 +0100
      [PATCH 2/2] net-qmi_wwan: Delete an unnecessary variable  initialisation in qmi_wwan_register_subdriver() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 18:00 +0100
    [PATCH 0/2] net-ath9k_htc: Fine-tuning for two function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 19:30 +0100
      [PATCH 2/2] net-ath9k_htc: Replace a variable initialisation by an  assignment in ath9k_htc_set_channel() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 19:30 +0100
        Re: [PATCH 2/2] net-ath9k_htc: Replace a variable initialisation by  an assignment in ath9k_htc_set_channel() Oleksij Rempel <linux@rempel-privat.de> - 2016-01-01 20:20 +0100
      [PATCH 1/2] net-ath9k_htc: Delete an unnecessary variable  initialisation in ath9k_hif_usb_rx_stream() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 19:30 +0100
        Re: [PATCH 1/2] net-ath9k_htc: Delete an unnecessary variable  initialisation in ath9k_hif_usb_rx_stream() Oleksij Rempel <linux@rempel-privat.de> - 2016-01-01 20:20 +0100
    [PATCH] net-brcmfmac: Delete an unnecessary variable initialisation  in brcmf_sdio_download_firmware() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 20:30 +0100
    [PATCH 0/3] net-iwlegacy: Fine-tuning for il_eeprom_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 21:30 +0100
      [PATCH 2/3] net-iwlegacy: One check less in il_eeprom_init() after  error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 21:40 +0100
      [PATCH 1/3] net-iwlegacy: Refactoring for il_eeprom_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 21:40 +0100
      [PATCH 3/3] net-iwlegacy: Another refactoring for il_eeprom_init() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 21:40 +0100
    [PATCH] net-libertas: Better exception handling in  if_spi_host_to_card_worker() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-01-01 22:40 +0100
      Re: [PATCH] net-libertas: Better exception handling in  if_spi_host_to_card_worker() Julia Lawall <julia.lawall@lip6.fr> - 2016-01-01 22:50 +0100

Page 1 of 10  [1] 2 3 … 10  Next page →


#1289503 — Source code review around jump label usage

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-11 13:10 +0100
SubjectSource code review around jump label usage
Message-ID<qEuGl-43C-5@gated-at.bofh.it>
Hello,

I have tried another specific analysis out on the source files
of "Linux next-20151211" with help of the software "Coccinelle 1.0.4".
I have taken a more detailed look on the use of the goto statement
and corresponding jump labels.

Can statistics like the following support software evolution
and further constructive considerations?

╔═════════════════════════════════════════╤═══════════╗
║                 target                  │ incidence ║
╠═════════════════════════════════════════╪═══════════╣
║ out                                     │      9782 ║
║ done                                    │      1344 ║
║ exit                                    │       950 ║
║ out_unlock                              │       538 ║
║ unlock                                  │       509 ║
║ bail                                    │       486 ║
║ error                                   │       418 ║
║ retry                                   │       414 ║
║ err                                     │       400 ║
║ end                                     │       332 ║
║                 …                       │     …     ║
║ abts_pending                            │         1 ║
║ abts_err                                │         1 ║
║ absolute_address                        │         1 ║
║ abort2                                  │         1 ║
║ abort_fail                              │         1 ║
║ abort_end                               │         1 ║
║ abituguru_probe_error                   │         1 ║
║ abituguru_detect_no_pwms_exit           │         1 ║
║ abituguru_detect_bank1_sensor_type_exit │         1 ║
╚═════════════════════════════════════════╧═══════════╝


How often are different jump targets used within function implementations?
(Functions without jump labels were not searched for this analysis approach.)

╔═════════╤═══════════╗
║ counter │ incidence ║
╠═════════╪═══════════╣
║       1 │     18442 ║
║       2 │      2002 ║
║       3 │       356 ║
║       4 │       106 ║
║       5 │        31 ║
║       6 │         7 ║
║       7 │         2 ║
║       8 │         3 ║
╚═════════╧═══════════╝


How does the text length distribution look like for the used jump targets?

╔════════╤═══════════╗
║ length │ incidence ║
╠════════╪═══════════╣
║      1 │         2 ║
║      2 │        29 ║
║      3 │     10640 ║
║      4 │      3564 ║
║      5 │      1714 ║
║      6 │      1162 ║
║      7 │      1245 ║
║      8 │       881 ║
║      9 │       787 ║
║     10 │      1252 ║
║   …    │     …     ║
║     35 │         4 ║
║     36 │         1 ║
║     37 │         2 ║
║     38 │         1 ║
║     39 │         1 ║
╚════════╧═══════════╝


How often are jump targets called within specific function implementations?

╔══════════════════════════╤═════════════════════════════════════════╤══════╤══════════════════════╤═════════╗
║         function         │          source file                    │ line │      go to           │ counter ║
╠══════════════════════════╪═════════════════════════════════════════╪══════╪══════════════════════╪═════════╣
║ do_ipv6_setsockopt       │ net/ipv6/ipv6_sockglue.c                │  140 │ e_inval              │      52 ║
║ dvb_register             │ drivers/media/pci/cx88/cx88-dvb.c       │ 1005 │ frontend_detach      │      43 ║
║ dvb_init                 │ drivers/media/pci/saa7134/saa7134-dvb.c │ 1210 │ detach_frontend      │      40 ║
║ gdbstub_single_step      │ arch/mn10300/kernel/gdb-stub.c          │  491 │ fault                │      38 ║
║ uinput_ioctl_handler     │ drivers/input/misc/uinput.c             │  701 │ out                  │      32 ║
║         …                │               …                         │  …   │        …             │    …    ║
║ kvm_vm_compat_ioctl      │ virt/kvm/kvm_main.c                     │ 2916 │ out                  │       1 ║
║ kvm_vm_ioctl             │ virt/kvm/kvm_main.c                     │ 2742 │ out_free_irq_routing │       1 ║
║ kvm_vm_ioctl_create_vcpu │ virt/kvm/kvm_main.c                     │ 2257 │ vcpu_destroy         │       1 ║
╚══════════════════════════╧═════════════════════════════════════════╧══════╧══════════════════════╧═════════╝


Do any of these numbers indicate update candidates which correspond to the
"one error jump label bug" symptom that is mentioned in the Linux coding
style documentation?

Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1289510

FromJulia Lawall <julia.lawall@lip6.fr>
Date2015-12-11 13:20 +0100
Message-ID<qEuQ1-486-9@gated-at.bofh.it>
In reply to#1289503
> Do any of these numbers indicate update candidates which correspond to the
> "one error jump label bug" symptom that is mentioned in the Linux coding
> style documentation?

I don't think that numbers could indicate that.  The point of that is a
single label followed by a bunch of ifs, or by calls to functions that
perform tests on input validity.  That is, it is the content of the code
that causes the problem, not its size.  Dan also discourages the use of
labels like out, that don't indicate anything about anything, or
kmalloc_err, which don't indicate anything about what happens at the label
target.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1289527

FromDan Carpenter <dan.carpenter@oracle.com>
Date2015-12-11 13:50 +0100
Message-ID<qEvj4-4o4-7@gated-at.bofh.it>
In reply to#1289503
I hate out labels but a lot of people like them and they're not
prohibited by kernel style. I only complain about them when they
introduce bugs.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1289793

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2015-12-11 19:10 +0100
Message-ID<qEAiK-7Yl-27@gated-at.bofh.it>
In reply to#1289503
Le 11/12/2015 13:08, SF Markus Elfring a écrit :
> How does the text length distribution look like for the used jump targets?
>
> ╔════════╤═══════════╗
> ║ length │ incidence ║
> ╠════════╪═══════════╣
> ║      1 │         2 ║
> ║      2 │        29 ║
> ║      3 │     10640 ║
> ║      4 │      3564 ║
> ║      5 │      1714 ║
> ║      6 │      1162 ║
> ║      7 │      1245 ║
> ║      8 │       881 ║
> ║      9 │       787 ║
> ║     10 │      1252 ║
> ║   …    │     …     ║
> ║     35 │         4 ║
> ║     36 │         1 ║
> ║     37 │         2 ║
> ║     38 │         1 ║
> ║     39 │         1 ║
> ╚════════╧═══════════╝
>

Maybe having a look at the 1 or 2 chars long labels would make sense.
They are likely to be too short for being of any use.

IMHO, too long labels may also reduce readability.

Best regards,
CJ

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1289807 — [PATCH 0/2] block: Fine-tuning for two function implementations

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-11 19:20 +0100
Subject[PATCH 0/2] block: Fine-tuning for two function implementations
Message-ID<qEAsq-81R-25@gated-at.bofh.it>
In reply to#1289503
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 11 Dec 2015 19:12:34 +0100

A few update suggestions were taken into account from static
source code analysis.

Markus Elfring (2):
  zram: Less checks in zram_bvec_write() after error detection
  z2ram: Delete a jump label in z2_init()

 drivers/block/z2ram.c         |  4 +---
 drivers/block/zram/zram_drv.c | 26 +++++++++++++-------------
 2 files changed, 14 insertions(+), 16 deletions(-)

-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1289811 — [PATCH 2/2] z2ram: Delete a jump label in z2_init()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-11 19:30 +0100
Subject[PATCH 2/2] z2ram: Delete a jump label in z2_init()
Message-ID<qEAC5-862-1@gated-at.bofh.it>
In reply to#1289807
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 11 Dec 2015 18:48:14 +0100

This issue was detected by using the Coccinelle software.

* Let us return directly if a call of the function "register_blkdev" failed.

* Remove the jump label "err" then.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/block/z2ram.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 968f9e5..b07581d 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -345,9 +345,8 @@ z2_init(void)
     if (!MACH_IS_AMIGA)
 	return -ENODEV;
 
-    ret = -EBUSY;
     if (register_blkdev(Z2RAM_MAJOR, DEVICE_NAME))
-	goto err;
+	return -EBUSY;
 
     ret = -ENOMEM;
     z2ram_gendisk = alloc_disk(1);
@@ -374,7 +373,6 @@ out_queue:
     put_disk(z2ram_gendisk);
 out_disk:
     unregister_blkdev(Z2RAM_MAJOR, DEVICE_NAME);
-err:
     return ret;
 }
 
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290764 — Re: [PATCH 2/2] z2ram: Delete a jump label in z2_init()

FromSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date2015-12-14 01:40 +0100
SubjectRe: [PATCH 2/2] z2ram: Delete a jump label in z2_init()
Message-ID<qFplg-79i-5@gated-at.bofh.it>
In reply to#1289811
Cc Jens, Andrew, Geert

On (12/11/15 19:26), SF Markus Elfring wrote:
>
> This issue was detected by using the Coccinelle software.
> 
> * Let us return directly if a call of the function "register_blkdev" failed.
> 
> * Remove the jump label "err" then.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/block/z2ram.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
> index 968f9e5..b07581d 100644
> --- a/drivers/block/z2ram.c
> +++ b/drivers/block/z2ram.c
> @@ -345,9 +345,8 @@ z2_init(void)
>      if (!MACH_IS_AMIGA)
>  	return -ENODEV;
>  
> -    ret = -EBUSY;
>      if (register_blkdev(Z2RAM_MAJOR, DEVICE_NAME))
> -	goto err;
> +	return -EBUSY;
>  
>      ret = -ENOMEM;
>      z2ram_gendisk = alloc_disk(1);
> @@ -374,7 +373,6 @@ out_queue:
>      put_disk(z2ram_gendisk);
>  out_disk:
>      unregister_blkdev(Z2RAM_MAJOR, DEVICE_NAME);
> -err:
>      return ret;
>  }

z2ram and zram are different drivers, but the change looks
ok to me.

z2ram can be improved in many ways, so my question is - do
people still use it?

	-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290998 — Re: [PATCH 2/2] z2ram: Delete a jump label in z2_init()

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2015-12-14 10:20 +0100
SubjectRe: [PATCH 2/2] z2ram: Delete a jump label in z2_init()
Message-ID<qFxst-47d-13@gated-at.bofh.it>
In reply to#1290764
On Mon, Dec 14, 2015 at 1:36 AM, Sergey Senozhatsky
<sergey.senozhatsky.work@gmail.com> wrote:
> Cc Jens, Andrew, Geert
>
> On (12/11/15 19:26), SF Markus Elfring wrote:
>>
>> This issue was detected by using the Coccinelle software.
>>
>> * Let us return directly if a call of the function "register_blkdev" failed.
>>
>> * Remove the jump label "err" then.
>>
>> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

>> ---
>>  drivers/block/z2ram.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
>> index 968f9e5..b07581d 100644
>> --- a/drivers/block/z2ram.c
>> +++ b/drivers/block/z2ram.c
>> @@ -345,9 +345,8 @@ z2_init(void)
>>      if (!MACH_IS_AMIGA)
>>       return -ENODEV;
>>
>> -    ret = -EBUSY;
>>      if (register_blkdev(Z2RAM_MAJOR, DEVICE_NAME))
>> -     goto err;
>> +     return -EBUSY;
>>
>>      ret = -ENOMEM;
>>      z2ram_gendisk = alloc_disk(1);
>> @@ -374,7 +373,6 @@ out_queue:
>>      put_disk(z2ram_gendisk);
>>  out_disk:
>>      unregister_blkdev(Z2RAM_MAJOR, DEVICE_NAME);
>> -err:
>>      return ret;
>>  }
>
> z2ram and zram are different drivers, but the change looks
> ok to me.
>
> z2ram can be improved in many ways, so my question is - do
> people still use it?

I think it's still used.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1289816 — [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-11 19:30 +0100
Subject[PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection
Message-ID<qEAC6-862-19@gated-at.bofh.it>
In reply to#1289807
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 11 Dec 2015 18:20:59 +0100

This issue was detected by using the Coccinelle software.

A few checks could be repeated by the zram_bvec_write() function
at two places even if the passed variables contained a null pointer.

* This implementation detail could be improved by adjustments
  for jump targets according to the Linux coding style convention.

* Let us return directly if a memory allocation failed.

* Drop unnecessary initialisations for the variables "uncmem"
  and "zstrm" then.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/block/zram/zram_drv.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 47915d7..69d7fcd 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -652,9 +652,9 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 	size_t clen;
 	unsigned long handle;
 	struct page *page;
-	unsigned char *user_mem, *cmem, *src, *uncmem = NULL;
+	unsigned char *user_mem, *cmem, *src, *uncmem;
 	struct zram_meta *meta = zram->meta;
-	struct zcomp_strm *zstrm = NULL;
+	struct zcomp_strm *zstrm;
 	unsigned long alloced_pages;
 
 	page = bvec->bv_page;
@@ -664,13 +664,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 		 * before to write the changes.
 		 */
 		uncmem = kmalloc(PAGE_SIZE, GFP_NOIO);
-		if (!uncmem) {
-			ret = -ENOMEM;
-			goto out;
-		}
+		if (!uncmem)
+			return -ENOMEM;
 		ret = zram_decompress_page(zram, uncmem, index);
 		if (ret)
-			goto out;
+			goto free_uncmem;
 	}
 
 	zstrm = zcomp_strm_find(zram->comp);
@@ -696,7 +694,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 
 		atomic64_inc(&zram->stats.zero_pages);
 		ret = 0;
-		goto out;
+		goto check_strm;
 	}
 
 	ret = zcomp_compress(zram->comp, zstrm, uncmem, &clen);
@@ -708,7 +706,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 
 	if (unlikely(ret)) {
 		pr_err("Compression failed! err=%d\n", ret);
-		goto out;
+		goto check_strm;
 	}
 	src = zstrm->buffer;
 	if (unlikely(clen > max_zpage_size)) {
@@ -722,7 +720,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 		pr_err("Error allocating memory for compressed page: %u, size=%zu\n",
 			index, clen);
 		ret = -ENOMEM;
-		goto out;
+		goto check_strm;
 	}
 
 	alloced_pages = zs_get_total_pages(meta->mem_pool);
@@ -731,7 +729,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 	if (zram->limit_pages && alloced_pages > zram->limit_pages) {
 		zs_free(meta->mem_pool, handle);
 		ret = -ENOMEM;
-		goto out;
+		goto check_strm;
 	}
 
 	cmem = zs_map_object(meta->mem_pool, handle, ZS_MM_WO);
@@ -762,11 +760,13 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 	/* Update stats */
 	atomic64_add(clen, &zram->stats.compr_data_size);
 	atomic64_inc(&zram->stats.pages_stored);
-out:
+check_strm:
 	if (zstrm)
 		zcomp_strm_release(zram->comp, zstrm);
-	if (is_partial_io(bvec))
+	if (is_partial_io(bvec)) {
+free_uncmem:
 		kfree(uncmem);
+	}
 	return ret;
 }
 
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290761 — Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

FromSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date2015-12-14 01:30 +0100
SubjectRe: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection
Message-ID<qFpbz-74M-3@gated-at.bofh.it>
In reply to#1289816
On (12/11/15 19:24), SF Markus Elfring wrote:
[..]
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 47915d7..69d7fcd 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -652,9 +652,9 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>  	size_t clen;
>  	unsigned long handle;
>  	struct page *page;
> -	unsigned char *user_mem, *cmem, *src, *uncmem = NULL;
> +	unsigned char *user_mem, *cmem, *src, *uncmem;
>  	struct zram_meta *meta = zram->meta;
> -	struct zcomp_strm *zstrm = NULL;
> +	struct zcomp_strm *zstrm;
>  	unsigned long alloced_pages;
>  
>  	page = bvec->bv_page;
> @@ -664,13 +664,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>  		 * before to write the changes.
>  		 */
>  		uncmem = kmalloc(PAGE_SIZE, GFP_NOIO);
> -		if (!uncmem) {
> -			ret = -ENOMEM;
> -			goto out;
> -		}
> +		if (!uncmem)
> +			return -ENOMEM;

ok.

>  		ret = zram_decompress_page(zram, uncmem, index);
>  		if (ret)
> -			goto out;
> +			goto free_uncmem;

here and later, I don't want to split `out' label.
you still need to do both 'if zstrm' and 'if is_partial_io' checks anyway, what's the gain?
the more labels we have the trickier it may get.

>  	}
>  
>  	zstrm = zcomp_strm_find(zram->comp);
> @@ -696,7 +694,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>  
>  		atomic64_inc(&zram->stats.zero_pages);
>  		ret = 0;
> -		goto out;
> +		goto check_strm;
>  	}
>  
>  	ret = zcomp_compress(zram->comp, zstrm, uncmem, &clen);
> @@ -708,7 +706,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>  
>  	if (unlikely(ret)) {
>  		pr_err("Compression failed! err=%d\n", ret);
> -		goto out;
> +		goto check_strm;
>  	}
>  	src = zstrm->buffer;
>  	if (unlikely(clen > max_zpage_size)) {
> @@ -722,7 +720,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>  		pr_err("Error allocating memory for compressed page: %u, size=%zu\n",
>  			index, clen);
>  		ret = -ENOMEM;
> -		goto out;
> +		goto check_strm;
>  	}
>  
>  	alloced_pages = zs_get_total_pages(meta->mem_pool);
> @@ -731,7 +729,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>  	if (zram->limit_pages && alloced_pages > zram->limit_pages) {
>  		zs_free(meta->mem_pool, handle);
>  		ret = -ENOMEM;
> -		goto out;
> +		goto check_strm;
>  	}
>  
>  	cmem = zs_map_object(meta->mem_pool, handle, ZS_MM_WO);
> @@ -762,11 +760,13 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>  	/* Update stats */
>  	atomic64_add(clen, &zram->stats.compr_data_size);
>  	atomic64_inc(&zram->stats.pages_stored);
> -out:
> +check_strm:
>  	if (zstrm)
>  		zcomp_strm_release(zram->comp, zstrm);
> -	if (is_partial_io(bvec))
> +	if (is_partial_io(bvec)) {
> +free_uncmem:
>  		kfree(uncmem);
> +	}

a label inside of `if'?   no.
keep it the way it is please.

>  	return ret;
>  }

	-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290892 — Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-14 08:00 +0100
SubjectRe: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection
Message-ID<qFvh0-2xT-17@gated-at.bofh.it>
In reply to#1290761
>> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
>> index 47915d7..69d7fcd 100644
>> --- a/drivers/block/zram/zram_drv.c
>> +++ b/drivers/block/zram/zram_drv.c
>> @@ -652,9 +652,9 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>>  	size_t clen;
>>  	unsigned long handle;
>>  	struct page *page;
>> -	unsigned char *user_mem, *cmem, *src, *uncmem = NULL;
>> +	unsigned char *user_mem, *cmem, *src, *uncmem;
>>  	struct zram_meta *meta = zram->meta;
>> -	struct zcomp_strm *zstrm = NULL;
>> +	struct zcomp_strm *zstrm;
>>  	unsigned long alloced_pages;
>>  
>>  	page = bvec->bv_page;
>> @@ -664,13 +664,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>>  		 * before to write the changes.
>>  		 */
>>  		uncmem = kmalloc(PAGE_SIZE, GFP_NOIO);
>> -		if (!uncmem) {
>> -			ret = -ENOMEM;
>> -			goto out;
>> -		}
>> +		if (!uncmem)
>> +			return -ENOMEM;
> 
> ok.

Thanks for your terse acknowledgement.


>>  		ret = zram_decompress_page(zram, uncmem, index);
>>  		if (ret)
>> -			goto out;
>> +			goto free_uncmem;
> 
> here and later, I don't want to split `out' label.

I guess that corresponding software design concerns can evolve a bit.


> you still need to do both 'if zstrm' and 'if is_partial_io' checks anyway, what's the gain?

How are the chances to reduce the number of dispensable sanity checks?


> the more labels we have the trickier it may get.

I hope that more unique jump labels can make the involved exception handling also clearer.


>> @@ -762,11 +760,13 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>>  	/* Update stats */
>>  	atomic64_add(clen, &zram->stats.compr_data_size);
>>  	atomic64_inc(&zram->stats.pages_stored);
>> -out:
>> +check_strm:
>>  	if (zstrm)
>>  		zcomp_strm_release(zram->comp, zstrm);
>> -	if (is_partial_io(bvec))
>> +	if (is_partial_io(bvec)) {
>> +free_uncmem:
>>  		kfree(uncmem);
>> +	}
> 
> a label inside of `if'?   no.

Do any more software developers find such an use case interesting?


> keep it the way it is please.

I suggest to make the affected exception handling a bit more efficient.
Such source code fine-tuning has got a few special consequences.

Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290897 — Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

FromJulia Lawall <julia.lawall@lip6.fr>
Date2015-12-14 08:20 +0100
SubjectRe: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection
Message-ID<qFvAm-2Tv-9@gated-at.bofh.it>
In reply to#1290892
> I suggest to make the affected exception handling a bit more efficient.
> Such source code fine-tuning has got a few special consequences.

Exception handling is by definition exceptional, and thus its efficiency 
is rarely important.  What is important is that it should be correct, and 
ideally clearly correct, so that someone can check its correctness easily.  
Optimizations, if they have any effect at all, typically make the 
correctness less obvious.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1291033 — Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

FromSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date2015-12-14 11:10 +0100
SubjectRe: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection
Message-ID<qFyeU-4Fp-25@gated-at.bofh.it>
In reply to#1290892
On (12/14/15 07:58), SF Markus Elfring wrote:
[..]
> > keep it the way it is please.
> 
> I suggest to make the affected exception handling a bit more efficient.
> Such source code fine-tuning has got a few special consequences.

by 'more efficient' you mean saving cpu cycles on 'bvec->bv_len != PAGE_SIZE'
comparison in exception/error path?

...
check_strm:
	if (zstrm)
		zcomp_strm_release(zram->comp, zstrm);
	if (is_partial_io(bvec)) {
free_uncmem:
		kfree(uncmem);
	}
...


no.

	-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1291213 — Re: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-14 15:10 +0100
SubjectRe: [PATCH 1/2] zram: Less checks in zram_bvec_write() after error detection
Message-ID<qFBZ9-7d6-29@gated-at.bofh.it>
In reply to#1291033
>> I suggest to make the affected exception handling a bit more efficient.
>> Such source code fine-tuning has got a few special consequences.
> 
> by 'more efficient' you mean saving cpu cycles on 'bvec->bv_len != PAGE_SIZE'
> comparison in exception/error path?

Yes …


> ...
> check_strm:
> 	if (zstrm)
> 		zcomp_strm_release(zram->comp, zstrm);
> 	if (is_partial_io(bvec)) {
> free_uncmem:
> 		kfree(uncmem);
> 	}
> ...

I propose to jump over two sanity checks.


> no.

Thanks for your feedback.

Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290149 — [PATCH] uinput: Rename a jump label in uinput_ioctl_handler()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-12 10:20 +0100
Subject[PATCH] uinput: Rename a jump label in uinput_ioctl_handler()
Message-ID<qEOvo-eT-5@gated-at.bofh.it>
In reply to#1289503
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 12 Dec 2015 10:06:00 +0100

This issue was detected by using the Coccinelle software.

Choose a jump label according to the current Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/input/misc/uinput.c | 66 ++++++++++++++++++++++-----------------------
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 5adbced..466f62d 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -717,7 +717,7 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd,
 	if (!udev->dev) {
 		retval = uinput_allocate_device(udev);
 		if (retval)
-			goto out;
+			goto unlock;
 	}
 
 	switch (cmd) {
@@ -725,82 +725,82 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd,
 			if (put_user(UINPUT_VERSION,
 				     (unsigned int __user *)p))
 				retval = -EFAULT;
-			goto out;
+			goto unlock;
 
 		case UI_DEV_CREATE:
 			retval = uinput_create_device(udev);
-			goto out;
+			goto unlock;
 
 		case UI_DEV_DESTROY:
 			uinput_destroy_device(udev);
-			goto out;
+			goto unlock;
 
 		case UI_SET_EVBIT:
 			retval = uinput_set_bit(arg, evbit, EV_MAX);
-			goto out;
+			goto unlock;
 
 		case UI_SET_KEYBIT:
 			retval = uinput_set_bit(arg, keybit, KEY_MAX);
-			goto out;
+			goto unlock;
 
 		case UI_SET_RELBIT:
 			retval = uinput_set_bit(arg, relbit, REL_MAX);
-			goto out;
+			goto unlock;
 
 		case UI_SET_ABSBIT:
 			retval = uinput_set_bit(arg, absbit, ABS_MAX);
-			goto out;
+			goto unlock;
 
 		case UI_SET_MSCBIT:
 			retval = uinput_set_bit(arg, mscbit, MSC_MAX);
-			goto out;
+			goto unlock;
 
 		case UI_SET_LEDBIT:
 			retval = uinput_set_bit(arg, ledbit, LED_MAX);
-			goto out;
+			goto unlock;
 
 		case UI_SET_SNDBIT:
 			retval = uinput_set_bit(arg, sndbit, SND_MAX);
-			goto out;
+			goto unlock;
 
 		case UI_SET_FFBIT:
 			retval = uinput_set_bit(arg, ffbit, FF_MAX);
-			goto out;
+			goto unlock;
 
 		case UI_SET_SWBIT:
 			retval = uinput_set_bit(arg, swbit, SW_MAX);
-			goto out;
+			goto unlock;
 
 		case UI_SET_PROPBIT:
 			retval = uinput_set_bit(arg, propbit, INPUT_PROP_MAX);
-			goto out;
+			goto unlock;
 
 		case UI_SET_PHYS:
 			if (udev->state == UIST_CREATED) {
 				retval = -EINVAL;
-				goto out;
+				goto unlock;
 			}
 
 			phys = strndup_user(p, 1024);
 			if (IS_ERR(phys)) {
 				retval = PTR_ERR(phys);
-				goto out;
+				goto unlock;
 			}
 
 			kfree(udev->dev->phys);
 			udev->dev->phys = phys;
-			goto out;
+			goto unlock;
 
 		case UI_BEGIN_FF_UPLOAD:
 			retval = uinput_ff_upload_from_user(p, &ff_up);
 			if (retval)
-				goto out;
+				goto unlock;
 
 			req = uinput_request_find(udev, ff_up.request_id);
 			if (!req || req->code != UI_FF_UPLOAD ||
 			    !req->u.upload.effect) {
 				retval = -EINVAL;
-				goto out;
+				goto unlock;
 			}
 
 			ff_up.retval = 0;
@@ -811,60 +811,60 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd,
 				memset(&ff_up.old, 0, sizeof(struct ff_effect));
 
 			retval = uinput_ff_upload_to_user(p, &ff_up);
-			goto out;
+			goto unlock;
 
 		case UI_BEGIN_FF_ERASE:
 			if (copy_from_user(&ff_erase, p, sizeof(ff_erase))) {
 				retval = -EFAULT;
-				goto out;
+				goto unlock;
 			}
 
 			req = uinput_request_find(udev, ff_erase.request_id);
 			if (!req || req->code != UI_FF_ERASE) {
 				retval = -EINVAL;
-				goto out;
+				goto unlock;
 			}
 
 			ff_erase.retval = 0;
 			ff_erase.effect_id = req->u.effect_id;
 			if (copy_to_user(p, &ff_erase, sizeof(ff_erase))) {
 				retval = -EFAULT;
-				goto out;
+				goto unlock;
 			}
 
-			goto out;
+			goto unlock;
 
 		case UI_END_FF_UPLOAD:
 			retval = uinput_ff_upload_from_user(p, &ff_up);
 			if (retval)
-				goto out;
+				goto unlock;
 
 			req = uinput_request_find(udev, ff_up.request_id);
 			if (!req || req->code != UI_FF_UPLOAD ||
 			    !req->u.upload.effect) {
 				retval = -EINVAL;
-				goto out;
+				goto unlock;
 			}
 
 			req->retval = ff_up.retval;
 			uinput_request_done(udev, req);
-			goto out;
+			goto unlock;
 
 		case UI_END_FF_ERASE:
 			if (copy_from_user(&ff_erase, p, sizeof(ff_erase))) {
 				retval = -EFAULT;
-				goto out;
+				goto unlock;
 			}
 
 			req = uinput_request_find(udev, ff_erase.request_id);
 			if (!req || req->code != UI_FF_ERASE) {
 				retval = -EINVAL;
-				goto out;
+				goto unlock;
 			}
 
 			req->retval = ff_erase.retval;
 			uinput_request_done(udev, req);
-			goto out;
+			goto unlock;
 	}
 
 	size = _IOC_SIZE(cmd);
@@ -874,15 +874,15 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd,
 	case UI_GET_SYSNAME(0):
 		if (udev->state != UIST_CREATED) {
 			retval = -ENOENT;
-			goto out;
+			goto unlock;
 		}
 		name = dev_name(&udev->dev->dev);
 		retval = uinput_str_to_user(p, name, size);
-		goto out;
+		goto unlock;
 	}
 
 	retval = -EINVAL;
- out:
+ unlock:
 	mutex_unlock(&udev->mutex);
 	return retval;
 }
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290479 — Re: [PATCH] uinput: Rename a jump label in uinput_ioctl_handler()

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2015-12-12 23:30 +0100
SubjectRe: [PATCH] uinput: Rename a jump label in uinput_ioctl_handler()
Message-ID<qF0PU-8gf-15@gated-at.bofh.it>
In reply to#1290149
Hi Markus,

On Sat, Dec 12, 2015 at 10:16:34AM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 12 Dec 2015 10:06:00 +0100
> 
> This issue was detected by using the Coccinelle software.
> 
> Choose a jump label according to the current Linux coding style convention.

While I am mildly curious where you  found this Coccinelle script
complaining about label names I find the current name is perfectly fine.

Thanks.

> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/input/misc/uinput.c | 66 ++++++++++++++++++++++-----------------------
>  1 file changed, 33 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
> index 5adbced..466f62d 100644
> --- a/drivers/input/misc/uinput.c
> +++ b/drivers/input/misc/uinput.c
> @@ -717,7 +717,7 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd,
>  	if (!udev->dev) {
>  		retval = uinput_allocate_device(udev);
>  		if (retval)
> -			goto out;
> +			goto unlock;
>  	}
>  
>  	switch (cmd) {
> @@ -725,82 +725,82 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd,
>  			if (put_user(UINPUT_VERSION,
>  				     (unsigned int __user *)p))
>  				retval = -EFAULT;
> -			goto out;
> +			goto unlock;
>  
>  		case UI_DEV_CREATE:
>  			retval = uinput_create_device(udev);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_DEV_DESTROY:
>  			uinput_destroy_device(udev);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_EVBIT:
>  			retval = uinput_set_bit(arg, evbit, EV_MAX);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_KEYBIT:
>  			retval = uinput_set_bit(arg, keybit, KEY_MAX);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_RELBIT:
>  			retval = uinput_set_bit(arg, relbit, REL_MAX);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_ABSBIT:
>  			retval = uinput_set_bit(arg, absbit, ABS_MAX);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_MSCBIT:
>  			retval = uinput_set_bit(arg, mscbit, MSC_MAX);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_LEDBIT:
>  			retval = uinput_set_bit(arg, ledbit, LED_MAX);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_SNDBIT:
>  			retval = uinput_set_bit(arg, sndbit, SND_MAX);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_FFBIT:
>  			retval = uinput_set_bit(arg, ffbit, FF_MAX);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_SWBIT:
>  			retval = uinput_set_bit(arg, swbit, SW_MAX);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_PROPBIT:
>  			retval = uinput_set_bit(arg, propbit, INPUT_PROP_MAX);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_SET_PHYS:
>  			if (udev->state == UIST_CREATED) {
>  				retval = -EINVAL;
> -				goto out;
> +				goto unlock;
>  			}
>  
>  			phys = strndup_user(p, 1024);
>  			if (IS_ERR(phys)) {
>  				retval = PTR_ERR(phys);
> -				goto out;
> +				goto unlock;
>  			}
>  
>  			kfree(udev->dev->phys);
>  			udev->dev->phys = phys;
> -			goto out;
> +			goto unlock;
>  
>  		case UI_BEGIN_FF_UPLOAD:
>  			retval = uinput_ff_upload_from_user(p, &ff_up);
>  			if (retval)
> -				goto out;
> +				goto unlock;
>  
>  			req = uinput_request_find(udev, ff_up.request_id);
>  			if (!req || req->code != UI_FF_UPLOAD ||
>  			    !req->u.upload.effect) {
>  				retval = -EINVAL;
> -				goto out;
> +				goto unlock;
>  			}
>  
>  			ff_up.retval = 0;
> @@ -811,60 +811,60 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd,
>  				memset(&ff_up.old, 0, sizeof(struct ff_effect));
>  
>  			retval = uinput_ff_upload_to_user(p, &ff_up);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_BEGIN_FF_ERASE:
>  			if (copy_from_user(&ff_erase, p, sizeof(ff_erase))) {
>  				retval = -EFAULT;
> -				goto out;
> +				goto unlock;
>  			}
>  
>  			req = uinput_request_find(udev, ff_erase.request_id);
>  			if (!req || req->code != UI_FF_ERASE) {
>  				retval = -EINVAL;
> -				goto out;
> +				goto unlock;
>  			}
>  
>  			ff_erase.retval = 0;
>  			ff_erase.effect_id = req->u.effect_id;
>  			if (copy_to_user(p, &ff_erase, sizeof(ff_erase))) {
>  				retval = -EFAULT;
> -				goto out;
> +				goto unlock;
>  			}
>  
> -			goto out;
> +			goto unlock;
>  
>  		case UI_END_FF_UPLOAD:
>  			retval = uinput_ff_upload_from_user(p, &ff_up);
>  			if (retval)
> -				goto out;
> +				goto unlock;
>  
>  			req = uinput_request_find(udev, ff_up.request_id);
>  			if (!req || req->code != UI_FF_UPLOAD ||
>  			    !req->u.upload.effect) {
>  				retval = -EINVAL;
> -				goto out;
> +				goto unlock;
>  			}
>  
>  			req->retval = ff_up.retval;
>  			uinput_request_done(udev, req);
> -			goto out;
> +			goto unlock;
>  
>  		case UI_END_FF_ERASE:
>  			if (copy_from_user(&ff_erase, p, sizeof(ff_erase))) {
>  				retval = -EFAULT;
> -				goto out;
> +				goto unlock;
>  			}
>  
>  			req = uinput_request_find(udev, ff_erase.request_id);
>  			if (!req || req->code != UI_FF_ERASE) {
>  				retval = -EINVAL;
> -				goto out;
> +				goto unlock;
>  			}
>  
>  			req->retval = ff_erase.retval;
>  			uinput_request_done(udev, req);
> -			goto out;
> +			goto unlock;
>  	}
>  
>  	size = _IOC_SIZE(cmd);
> @@ -874,15 +874,15 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd,
>  	case UI_GET_SYSNAME(0):
>  		if (udev->state != UIST_CREATED) {
>  			retval = -ENOENT;
> -			goto out;
> +			goto unlock;
>  		}
>  		name = dev_name(&udev->dev->dev);
>  		retval = uinput_str_to_user(p, name, size);
> -		goto out;
> +		goto unlock;
>  	}
>  
>  	retval = -EINVAL;
> - out:
> + unlock:
>  	mutex_unlock(&udev->mutex);
>  	return retval;
>  }
> -- 
> 2.6.3
> 

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290194 — [PATCH 0/7] iSCSI-target: Fine-tuning for three function implementations

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-12 15:40 +0100
Subject[PATCH 0/7] iSCSI-target: Fine-tuning for three function implementations
Message-ID<qETv3-3kN-1@gated-at.bofh.it>
In reply to#1289503
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 12 Dec 2015 15:25:20 +0100

Some update suggestions were taken into account from static
source code analysis.

Markus Elfring (7):
  Use a variable initialisation in iscsi_set_default_param() directly
  Less checks in iscsi_set_default_param() after error detection
  Delete an unnecessary variable initialisation in iscsi_create_default_params()
  Make a variable initialisation a bit more obvious in iscsi_create_default_params()
  Rename a jump label in iscsi_create_default_params()
  Delete unnecessary variable initialisations in iscsi_check_valuelist_for_support()
  Make two variable initialisations a bit more obvious in iscsi_check_valuelist_for_support()

 drivers/target/iscsi/iscsi_target_parameters.c | 100 ++++++++++++-------------
 1 file changed, 47 insertions(+), 53 deletions(-)

-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290196 — [PATCH 1/7] iscsi-target: Use a variable initialisation in iscsi_set_default_param() directly

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-12 15:40 +0100
Subject[PATCH 1/7] iscsi-target: Use a variable initialisation in iscsi_set_default_param() directly
Message-ID<qETv4-3kN-7@gated-at.bofh.it>
In reply to#1290194
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 12 Dec 2015 11:36:02 +0100

Omit the unnecessary setting to a null pointer for the variable "param"
at the beginning of the function "iscsi_set_default_param"
because it can be directly initialized with the return value
from the function "kzalloc".

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/target/iscsi/iscsi_target_parameters.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c
index 3a1f9a7..0a8bd3f 100644
--- a/drivers/target/iscsi/iscsi_target_parameters.c
+++ b/drivers/target/iscsi/iscsi_target_parameters.c
@@ -127,9 +127,8 @@ static struct iscsi_param *iscsi_set_default_param(struct iscsi_param_list *para
 		char *name, char *value, u8 phase, u8 scope, u8 sender,
 		u16 type_range, u8 use)
 {
-	struct iscsi_param *param = NULL;
+	struct iscsi_param *param = kzalloc(sizeof(*param), GFP_KERNEL);
 
-	param = kzalloc(sizeof(struct iscsi_param), GFP_KERNEL);
 	if (!param) {
 		pr_err("Unable to allocate memory for parameter.\n");
 		goto out;
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290310 — Re: [PATCH 1/7] iscsi-target: Use a variable initialisation in iscsi_set_default_param() directly

FromDan Carpenter <dan.carpenter@oracle.com>
Date2015-12-12 21:00 +0100
SubjectRe: [PATCH 1/7] iscsi-target: Use a variable initialisation in iscsi_set_default_param() directly
Message-ID<qEYuJ-6u7-9@gated-at.bofh.it>
In reply to#1290196
On Sat, Dec 12, 2015 at 03:34:50PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sat, 12 Dec 2015 11:36:02 +0100
> 
> Omit the unnecessary setting to a null pointer for the variable "param"
> at the beginning of the function "iscsi_set_default_param"
> because it can be directly initialized with the return value
> from the function "kzalloc".
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/target/iscsi/iscsi_target_parameters.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c
> index 3a1f9a7..0a8bd3f 100644
> --- a/drivers/target/iscsi/iscsi_target_parameters.c
> +++ b/drivers/target/iscsi/iscsi_target_parameters.c
> @@ -127,9 +127,8 @@ static struct iscsi_param *iscsi_set_default_param(struct iscsi_param_list *para
>  		char *name, char *value, u8 phase, u8 scope, u8 sender,
>  		u16 type_range, u8 use)
>  {
> -	struct iscsi_param *param = NULL;
> +	struct iscsi_param *param = kzalloc(sizeof(*param), GFP_KERNEL);
>  
> -	param = kzalloc(sizeof(struct iscsi_param), GFP_KERNEL);
>  	if (!param) {
>  		pr_err("Unable to allocate memory for parameter.\n");
>  		goto out;

It's better to just get rid of the initialization but leave the
kzalloc() as-is for two reasons.

1)  Initializer code normally contains more bugs per line than other
    code.  I am thinking about dereferencing pointers before checking
    for NULL or not checking the allocation for failure.

2)  It puts a blank line between the allocation and the check for
    failure.  It's like a new paragraph.  The allocation and the check
    should be next to each other.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1290454 — Re: [PATCH 1/7] iscsi-target: Use a variable initialisation in iscsi_set_default_param() directly

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-12-12 22:30 +0100
SubjectRe: [PATCH 1/7] iscsi-target: Use a variable initialisation in iscsi_set_default_param() directly
Message-ID<qEZTP-7DN-15@gated-at.bofh.it>
In reply to#1290310
>> @@ -127,9 +127,8 @@ static struct iscsi_param *iscsi_set_default_param(struct iscsi_param_list *para
>>  		char *name, char *value, u8 phase, u8 scope, u8 sender,
>>  		u16 type_range, u8 use)
>>  {
>> -	struct iscsi_param *param = NULL;
>> +	struct iscsi_param *param = kzalloc(sizeof(*param), GFP_KERNEL);
>>  
>> -	param = kzalloc(sizeof(struct iscsi_param), GFP_KERNEL);
>>  	if (!param) {
>>  		pr_err("Unable to allocate memory for parameter.\n");
>>  		goto out;
> 
> It's better to just get rid of the initialization but leave the
> kzalloc() as-is for two reasons.
> 
> 1)  Initializer code normally contains more bugs per line than other
>     code.  I am thinking about dereferencing pointers before checking
>     for NULL or not checking the allocation for failure.

I can follow your concerns a bit.


> 2)  It puts a blank line between the allocation and the check for failure.

Is there a target conflict between "convenient" variable initialisation
in the declaration section and the function outline that seems to be checked
by the script "checkpatch.pl" to some degree while corresponding preferences
or recommendations are not mentioned in the document "CodingStyle"?


>     It's like a new paragraph.

I do not see the separation in a strict way so far.


>     The allocation and the check should be next to each other.

I find that these actions are still close enough in the discussed use case.

Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


Page 1 of 10  [1] 2 3 … 10  Next page →

Back to top | Article view | linux.kernel


csiph-web