Re: [PATCH] staging: gdm72xx: remove unneeded test

From: Julia Lawall
Date: Thu May 28 2015 - 01:43:21 EST


On Wed, 27 May 2015, Joe Perches wrote:

> On Wed, 2015-05-27 at 22:25 +0200, Laurent Navet wrote:
> > The same code is executed regardless ret value, so this test can be
> > removed.
> []
> > diff --git a/drivers/staging/gdm72xx/usb_boot.c b/drivers/staging/gdm72xx/usb_boot.c
> []
> > @@ -255,8 +255,6 @@ static int em_wait_ack(struct usb_device *usbdev, int send_zlp)
> >
> > /*Wait for ACK*/
> > ret = gdm_wibro_recv(usbdev, &ack, sizeof(ack));
> > - if (ret < 0)
> > - goto out;
> > out:
> > return ret;
> > }
>
> Perhaps all of the uses like:
>
> goto <foo>;
> <foo>:
>
> could be modified. There are ~150 in the kernel.

I wrote a semantic patch recently for that as well... Maybe I can take
care of it.

julia

>
> $ grep-2.5.4 -rP --include=*.[ch] -n "\bgoto\s+(\w+)\s*;\s*\1\s*:" * | \
> grep -P "^[\w/\.:]+\d+:"
> arch/x86/xen/enlighten.c:1018: case MSR_GS_BASE: which = SEGBASE_GS_KERNEL; goto set;
> arch/m68k/amiga/config.c:258: goto Generic;
> arch/s390/net/bpf_jit_comp.c:1078: goto call_fn;
> arch/sparc/kernel/pci_msi.c:67: goto err_out;
> drivers/gpu/drm/radeon/atombios_dp.c:882: goto done;
> drivers/gpu/drm/nouveau/nouveau_bo.c:1225: goto out;
> drivers/gpu/drm/nouveau/nv50_display.c:1476: goto out;
> drivers/gpu/drm/i915/intel_display.c:12678: goto out;
> drivers/isdn/mISDN/dsp_cmx.c:1572: goto send_packet;
> drivers/input/mouse/cyapa_gen5.c:1772: goto resume_scanning;
> drivers/input/mouse/cyapa_gen5.c:2340: goto resume_scanning;
> drivers/mmc/host/s3cmci.c:798: goto irq_out;
> drivers/mmc/host/ushc.c:313: goto out;
> drivers/mmc/card/mmc_test.c:2918: goto err;
> drivers/staging/lustre/lustre/mdc/mdc_request.c:1271: goto out;
> drivers/staging/lustre/lustre/mdc/mdc_request.c:1305: goto out;
> drivers/staging/lustre/lustre/mdc/mdc_request.c:1372: goto out;
> drivers/staging/lustre/lustre/mdc/mdc_request.c:1455: goto out;
> drivers/staging/lustre/lustre/mdc/mdc_request.c:1518: goto out;
> drivers/staging/lustre/lustre/mdc/mdc_request.c:1815: goto out;
> drivers/staging/lustre/lustre/llite/file.c:691: goto out_och_free;
> drivers/staging/lustre/lustre/llite/file.c:1161: goto out;
> drivers/staging/lustre/lustre/llite/file.c:1301: goto out;
> drivers/staging/lustre/lustre/llite/xattr_cache.c:452: goto out_maybe_drop;
> drivers/staging/lustre/lustre/llite/xattr_cache.c:532: goto out;
> drivers/staging/lustre/lustre/llite/dir.c:683: goto err_exit;
> drivers/staging/lustre/lustre/llite/dir.c:1941: goto out;
> drivers/staging/lustre/lustre/llite/namei.c:556: goto out;
> drivers/staging/lustre/lustre/llite/llite_lib.c:2115: goto out_statfs;
> drivers/staging/lustre/lustre/llite/rw.c:1204: goto out;
> drivers/staging/lustre/lustre/obdecho/echo_client.c:2130: goto out;
> drivers/staging/lustre/lustre/fld/fld_request.c:377: goto out;
> drivers/staging/lustre/lustre/obdclass/obd_mount.c:1225: goto out;
> drivers/staging/lustre/lustre/obdclass/dt_object.c:734: goto out;
> drivers/staging/lustre/lustre/obdclass/dt_object.c:934: goto out;
> drivers/staging/lustre/lustre/ldlm/ldlm_lock.c:1857: goto out;
> drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c:310: goto out;
> drivers/staging/iio/meter/ade7758_core.c:436: goto error_ret;
> drivers/staging/iio/meter/ade7854.c:430: goto error_ret;
> drivers/staging/iio/meter/ade7754.c:360: goto error_ret;
> drivers/staging/gdm72xx/usb_boot.c:259: goto out;
> drivers/staging/gdm72xx/usb_boot.c:324: goto out;
> drivers/target/target_core_spc.c:745: goto out;
> drivers/target/target_core_spc.c:884: goto out;
> drivers/uwb/reset.c:389: goto out;
> drivers/bluetooth/btrtl.c:314: goto out;
> drivers/iio/imu/inv_mpu6050/inv_mpu_core.c:568: goto fifo_rate_fail;
> drivers/iio/gyro/itg3200_buffer.c:96: goto error_ret;
> drivers/base/regmap/regmap.c:2587: goto out;
> drivers/base/core.c:1838: goto out;
> drivers/char/ipmi/ipmi_poweroff.c:434: goto out;
> drivers/char/xilinx_hwicap/xilinx_hwicap.c:581: goto error;
> drivers/nfc/st21nfcb/st21nfcb_se.c:558: goto free_dest_params;
> drivers/scsi/lpfc/lpfc_hbadisc.c:2416: goto read_next_fcf;
> drivers/scsi/qla2xxx/qla_bsg.c:399: goto done_free_fcport;
> drivers/scsi/qla4xxx/ql4_nx.c:1913: goto exit_ipmdio_wr_reg;
> drivers/scsi/bfa/bfad_bsg.c:1948: goto out;
> drivers/scsi/device_handler/scsi_dh_emc.c:556: goto done;
> drivers/scsi/device_handler/scsi_dh_alua.c:695: goto out;
> drivers/scsi/megaraid/megaraid_mm.c:295: goto new_packet;
> drivers/scsi/ufs/ufshcd.c:4377: goto out;
> drivers/net/ethernet/qlogic/qlge/qlge_mpi.c:85: goto exit;
> drivers/net/ethernet/intel/i40e/i40e_hmc.c:302: goto exit;
> drivers/net/ethernet/intel/i40e/i40e_hmc.c:356: goto exit;
> drivers/net/ethernet/mellanox/mlx4/mcg.c:1181: goto out;
> drivers/net/ethernet/rocker/rocker.c:584: goto unmap;
> drivers/net/wan/dscc4.c:983: goto done;
> drivers/net/wireless/cw1200/sta.c:89: goto out;
> drivers/net/wireless/b43legacy/debugfs.c:312: goto out_freepage;
> drivers/net/wireless/b43legacy/main.c:1676: goto error;
> drivers/net/wireless/ath/carl9170/debug.c:156: goto out_unlock;
> drivers/net/wireless/ath/carl9170/debug.c:747: goto out;
> drivers/net/wireless/rtlwifi/rtl8192cu/trx.c:216: goto err_out;
> drivers/net/wireless/p54/p54usb.c:619: goto err_upload_failed;
> drivers/net/wireless/p54/p54pci.c:519: goto out;
> drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c:3847: goto cleanup;
> drivers/net/wireless/libertas/if_spi.c:828: goto out;
> drivers/net/wireless/libertas/if_spi.c:1091: goto out;
> drivers/net/wireless/ti/wl1251/boot.c:551: goto out;
> drivers/net/wireless/ti/wl1251/acx.c:57: goto out;
> drivers/net/wireless/ti/wl1251/main.c:1334: goto out_sleep;
> drivers/net/wireless/ti/wlcore/cmd.c:2057: goto out;
> drivers/net/wireless/ti/wlcore/testmode.c:203: goto out_free;
> drivers/net/wireless/ti/wlcore/testmode.c:352: goto out;
> drivers/net/wireless/ti/wlcore/boot.c:78: goto out;
> drivers/net/wireless/ti/wlcore/boot.c:165: goto out_free;
> drivers/net/wireless/ti/wlcore/debugfs.c:1028: goto out_sleep;
> drivers/net/wireless/ti/wlcore/debugfs.c:1094: goto read_err;
> drivers/net/wireless/ti/wlcore/debugfs.c:1098: goto part_err;
> drivers/net/wireless/ti/wlcore/debugfs.c:1177: goto write_err;
> drivers/net/wireless/ti/wlcore/debugfs.c:1181: goto part_err;
> drivers/net/wireless/ti/wlcore/main.c:192: goto out_sleep;
> drivers/net/wireless/ti/wlcore/main.c:1125: goto out;
> drivers/net/wireless/ti/wlcore/main.c:1710: goto out;
> drivers/net/wireless/ti/wlcore/main.c:1806: goto out_sleep;
> drivers/net/wireless/ti/wlcore/main.c:1906: goto out_sleep;
> drivers/net/wireless/ti/wlcore/main.c:4080: goto out;
> drivers/net/wireless/ti/wlcore/main.c:4891: goto out_sleep;
> drivers/net/wireless/ti/wl12xx/main.c:752: goto out;
> drivers/net/wireless/ti/wl12xx/main.c:1150: goto out;
> drivers/net/wireless/ti/wl18xx/main.c:810: goto out;
> drivers/net/wireless/b43/debugfs.c:605: goto out_freepage;
> drivers/net/wireless/b43/main.c:2545: goto error;
> drivers/net/wimax/i2400m/fw.c:295: goto error_add;
> drivers/s390/net/qeth_core_main.c:5090: goto retriable;
> drivers/hwmon/applesmc.c:732: goto out;
> drivers/infiniband/hw/qib/qib_iba6120.c:3340: goto bail;
> drivers/infiniband/hw/amso1100/c2_cm.c:282: goto bail1;
> drivers/infiniband/hw/ocrdma/ocrdma_hw.c:1888: goto mbx_err;
> drivers/infiniband/hw/ocrdma/ocrdma_hw.c:1968: goto mbx_err;
> drivers/infiniband/hw/ocrdma/ocrdma_hw.c:2631: goto mbx_err;
> drivers/infiniband/hw/ocrdma/ocrdma_hw.c:2648: goto mbx_err;
> drivers/infiniband/hw/ocrdma/ocrdma_hw.c:3059: goto mbx_err;
> drivers/infiniband/hw/mthca/mthca_provider.c:222: goto out;
> drivers/media/tuners/e4000.c:106: goto err;
> drivers/media/tuners/e4000.c:250: goto err;
> drivers/media/tuners/fc0013.c:221: goto error_out;
> drivers/media/usb/airspy/airspy.c:940: goto err;
> drivers/media/usb/msi2500/msi2500.c:819: goto err;
> drivers/ssb/pci.c:1185: goto out;
> fs/ocfs2/cluster/nodemanager.c:692: goto out;
> fs/ocfs2/cluster/tcp.c:876: goto out;
> fs/ocfs2/dlm/dlmdomain.c:1849: goto bail;
> fs/gfs2/inode.c:1536: goto out_end_trans;
> fs/xfs/xfs_ioctl.c:311: goto out_kfree;
> fs/ubifs/recovery.c:221: goto out;
> fs/pipe.c:937: goto err;
> fs/exofs/dir.c:142: goto bad_entry;
> fs/hfsplus/attributes.c:332: goto out;
> fs/btrfs/volumes.c:1538: goto out;
> fs/btrfs/send.c:2662: goto out;
> fs/aio.c:1418: goto rw_common;
> fs/nfs/nfs4idmap.c:500: goto out;
> ipc/kdbus/names.c:518: goto exit_dec;
> net/mac80211/tx.c:2637: goto out;
> net/ceph/messenger.c:1684: goto out;
> net/ipv6/raw.c:1334: goto out;
> net/ipv6/esp6.c:481: goto error;
> net/nfc/nci/hci.c:671: goto exit;
> net/ipv4/esp4.c:539: goto error;
> net/sched/sch_api.c:1794: goto done;
> net/llc/llc_proc.c:74: goto out;
> security/selinux/ss/services.c:359: goto mls_ops;
> sound/pci/hda/patch_ca0132.c:943: goto exit;
> sound/pci/hda/patch_ca0132.c:991: goto exit;
> sound/core/seq/seq_midi_emul.c:372: goto notyet;
> sound/spi/at73c213.c:1063: goto out;
> sound/usb/mixer_quirks.c:683: goto err;
> sound/usb/mixer_quirks.c:1592: goto end;
> tools/perf/util/python.c:330: goto out;
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/