From: Joe Perches <joe@perches.com>
To: Jens Axboe <axboe@kernel.dk>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Jing Xiangfeng <jingxiangfeng@huawei.com>
Cc: jejb@linux.ibm.com, martin.petersen@oracle.com,
lee.jones@linaro.org, colin.king@canonical.com,
mchehab+huawei@kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org,
kernel-janitors <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] scsi: arcmsr: Remove the superfluous break
Date: Fri, 18 Sep 2020 19:07:46 +0000 [thread overview]
Message-ID: <47b5bed0fc61fd9a4789816a5a836c7c3c2d41d2.camel@perches.com> (raw)
In-Reply-To: <2ce1124d-7f83-d9aa-f62a-519c8914ad98@kernel.dk>
On Fri, 2020-09-18 at 11:17 -0600, Jens Axboe wrote:
> On 9/18/20 11:13 AM, Joe Perches wrote:
> > On Fri, 2020-09-18 at 09:56 -0500, Gustavo A. R. Silva wrote:
> > > On Fri, Sep 18, 2020 at 05:32:30PM +0800, Jing Xiangfeng wrote:
> > > > Remove the superfluous break, as there is a 'return' before it.
> > > >
> > >
> > > Apparently, the change is correct. Please, just add a proper Fixes tag by
> > > yourself this time.
> >
> > There's no need for a "Fixes:" here, it's purely cosmetic.
> >
> > btw:
> >
> > There are at least 150 instances of
> > return foo(...);
> > break;
> > still in the kernel tree:
>
> A lot of these are false positives, since they follow a pattern of:
>
> if (some_condition)
> return func();
> break;
Ah, right. Thanks.
Refining the test a bit to make sure the number of tabs before the
return and before the break are the same appears to show 42 instances.
$ grep-2.5.4 -rP --include=*.[ch] -n "^([\t]+)\breturn\s+\w+\s*\([^\)]+\)\s*;[ \t]*\n\1break\s*;\s*(case\s+\w+|default)\s*:" * | grep return | wc -l
42
(the line numbering seems screwed up below,
but the instances listed seem right)
$ grep-2.5.4 -rP --include=*.[ch] -n "^([\t]+)\breturn\s+\w+\s*\([^\)]+\)\s*;[ \t]*\n\1break\s*;\s*(case\s+\w+|default)\s*:" * | grep return
arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:275: return pci_isa_read_bar(0);
arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:276: return pci_isa_read_bar(1);
arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:277: return pci_isa_read_bar(2);
arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:280: return pci_isa_read_bar(4);
arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:281: return pci_isa_read_bar(5);
arch/x86/kvm/emulate.c:1863: return segmented_write(ctxt,
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c:2091: return __rtl8821ae_phy_config_with_headerfile(hw,
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c:2092: return __rtl8821ae_phy_config_with_headerfile(hw,
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c:2114: return __rtl8821ae_phy_config_with_headerfile(hw,
drivers/net/wireless/marvell/mwifiex/cfg80211.c:1210: return mwifiex_change_vif_to_sta_adhoc(dev, curr_iftype,
drivers/net/wireless/marvell/mwifiex/cfg80211.c:1246: return mwifiex_change_vif_to_sta_adhoc(dev, curr_iftype,
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c:1200: return iwl_mvm_mac_ctxt_cmd_sta(mvm, vif, action,
drivers/net/hyperv/netvsc.c:1275: return netvsc_receive(ndev, net_device, nvchan,
drivers/media/dvb-frontends/si21xx.c:466: return si21_writereg(state, LNB_CTRL_REG_1, val | 0x40);
drivers/media/usb/ttusb-dec/ttusb_dec.c:1104: return ttusb_dec_start_ts_feed(dvbdmxfeed);
drivers/media/usb/ttusb-dec/ttusb_dec.c:1105: return ttusb_dec_start_sec_feed(dvbdmxfeed);
drivers/media/usb/ttusb-dec/ttusb_dec.c:1153: return ttusb_dec_stop_ts_feed(dvbdmxfeed);
drivers/scsi/bfa/bfa_ioc.h:1000: return bfi_image_cb_get_chunk(off);
drivers/scsi/bfa/bfa_ioc.h:1001: return bfi_image_ct_get_chunk(off);
drivers/scsi/bfa/bfa_ioc.h:1002: return bfi_image_ct2_get_chunk(off);
drivers/scsi/be2iscsi/be_mgmt.c:1245: return snprintf(buf, PAGE_SIZE,
drivers/scsi/be2iscsi/be_mgmt.c:1247: return snprintf(buf, PAGE_SIZE, "BE3-R Adapter Family\n");
drivers/scsi/be2iscsi/be_mgmt.c:1248: return snprintf(buf, PAGE_SIZE, "Skyhawk-R Adapter Family\n");
drivers/scsi/arcmsr/arcmsr_hba.c:2701: return arcmsr_hbaA_handle_isr(acb);
drivers/scsi/arcmsr/arcmsr_hba.c:2702: return arcmsr_hbaB_handle_isr(acb);
drivers/iio/adc/meson_saradc.c:594: return meson_sar_adc_get_sample(indio_dev, chan, NO_AVERAGING,
drivers/iio/adc/meson_saradc.c:595: return meson_sar_adc_get_sample(indio_dev, chan,
drivers/s390/char/tape_34xx.c:653: return tape_34xx_done(request);
drivers/s390/char/tape_3590.c:945: return tape_3590_erp_failed(device, request, irb, -EIO);
drivers/nfc/st21nfca/core.c:792: return nfc_hci_send_cmd_async(hdev, target->hci_reader_gate,
drivers/gpu/drm/mgag200/mgag200_mode.c:796: return mga_g200se_set_plls(mdev, clock);
drivers/gpu/drm/mgag200/mgag200_mode.c:798: return mga_g200wb_set_plls(mdev, clock);
drivers/gpu/drm/mgag200/mgag200_mode.c:799: return mga_g200ev_set_plls(mdev, clock);
drivers/gpu/drm/mgag200/mgag200_mode.c:801: return mga_g200eh_set_plls(mdev, clock);
sound/soc/intel/skylake/skl-pcm.c:504: return skl_run_pipe(skl, mconfig->pipe);
sound/oss/dmasound/dmasound_core.c:1005: return IOCTL_OUT(arg, fmt);
sound/oss/dmasound/dmasound_core.c:1020: return IOCTL_OUT(arg, size);
sound/oss/dmasound/dmasound_core.c:1121: return IOCTL_OUT(arg, data);
tools/perf/ui/stdio/hist.c:392: return callchain__fprintf_graph(fp, &he->sorted_chain, total_samples,
tools/perf/ui/stdio/hist.c:393: return callchain__fprintf_graph(fp, &he->sorted_chain, total_samples,
tools/perf/ui/stdio/hist.c:394: return callchain__fprintf_flat(fp, &he->sorted_chain, total_samples);
tools/perf/ui/stdio/hist.c:395: return callchain__fprintf_folded(fp, &he->sorted_chain, total_samples);
next prev parent reply other threads:[~2020-09-18 19:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200918093230.49050-1-jingxiangfeng@huawei.com>
[not found] ` <20200918145619.GA25599@embeddedor>
2020-09-18 17:13 ` [PATCH] scsi: arcmsr: Remove the superfluous break Joe Perches
2020-09-18 17:17 ` Jens Axboe
2020-09-18 19:07 ` Joe Perches [this message]
2020-09-18 18:00 ` Dan Carpenter
2020-09-18 18:03 ` Colin Ian King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47b5bed0fc61fd9a4789816a5a836c7c3c2d41d2.camel@perches.com \
--to=joe@perches.com \
--cc=axboe@kernel.dk \
--cc=colin.king@canonical.com \
--cc=gustavoars@kernel.org \
--cc=jejb@linux.ibm.com \
--cc=jingxiangfeng@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mchehab+huawei@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).