linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <chip.programmer@gmail.com>
To: "Chunfeng Yun" <chunfeng.yun@mediatek.com>, <Charles.Hyde@dellteam.com>
Cc: <oliver@neukum.org>, <rjw@rjwysocki.net>, <lenb@kernel.org>,
	<Mario.Limonciello@dell.com>, <nic_swsd@realtek.com>,
	<linux-usb@vger.kernel.org>, <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH 3/3] net: cdc_ncm: Add ACPI MAC address pass through functionality
Date: Fri, 6 Sep 2019 08:25:23 -0500	[thread overview]
Message-ID: <5A2ADDC81DB5421290EB97D1178C0BBE@chip> (raw)
In-Reply-To: <1567736007.7317.71.camel@mhfsdcap03>

>> + if (strstr(dev->udev->product, "D6000")) {
>> + sa.sa_family = dev->net->type;
>> + if (get_acpi_mac_passthru(sa.sa_data)) {
>> + if (!memcmp(dev->net->dev_addr, sa.sa_data,
>> +     ETH_ALEN)) {
>> + if (!cdc_ncm_set_ethernet_address(dev, &sa))

> How about use one if-statement instead of these three if-statement?

While using a single compound if statement is possible, my experience is 
that using multiple if statements will make the code easier to debug and 
maintain by others who come after me.  What is possible to do with code is 
not necessarily what should be done.


  reply	other threads:[~2019-09-06 13:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 21:01 [PATCH 3/3] net: cdc_ncm: Add ACPI MAC address pass through functionality Charles.Hyde
2019-09-06  2:13 ` Chunfeng Yun
2019-09-06 13:25   ` chip.programmer [this message]
2019-09-06  7:59 ` Bjørn Mork
2019-09-06 15:23   ` Dan Williams
  -- strict thread matches above, loose matches on Subject: below --
2019-08-30 19:38 Charles.Hyde
2019-09-02  9:49 ` Oliver Neukum
2019-09-03 17:50   ` Charles.Hyde
2019-09-03 17:57     ` Mario.Limonciello

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=5A2ADDC81DB5421290EB97D1178C0BBE@chip \
    --to=chip.programmer@gmail.com \
    --cc=Charles.Hyde@dellteam.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=oliver@neukum.org \
    --cc=rjw@rjwysocki.net \
    /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).