linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Luo bin <luobin9@huawei.com>
Cc: <davem@davemloft.net>, <linux-kernel@vger.kernel.org>,
	<netdev@vger.kernel.org>, <luoxianjun@huawei.com>,
	<yin.yinshi@huawei.com>, <cloud.wangxiaoyun@huawei.com>
Subject: Re: [PATCH net-next v2 5/5] hinic: add support to get eeprom information
Date: Tue, 23 Jun 2020 15:02:33 -0700	[thread overview]
Message-ID: <20200623150233.440583b8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20200623142409.19081-6-luobin9@huawei.com>

On Tue, 23 Jun 2020 22:24:09 +0800 Luo bin wrote:
> +int hinic_get_sfp_eeprom(struct hinic_hwdev *hwdev, u8 *data, u16 *len)
> +{
> +	struct hinic_cmd_get_std_sfp_info sfp_info = {0};
> +	u16 out_size = sizeof(sfp_info);
> +	u8 port_id;
> +	int err;
> +
> +	if (!hwdev || !data || !len)
> +		return -EINVAL;

> +int hinic_get_sfp_type(struct hinic_hwdev *hwdev, u8 *data0, u8 *data1)
> +{
> +	u8 sfp_data[STD_SFP_INFO_MAX_SIZE];
> +	u16 len;
> +	int err;
> +
> +	if (!hwdev || !data0 || !data1)
> +		return -EINVAL;

No need to check these, callers are correct. We don't do defensive
programming in the kernel.

> +	return  0;

double space

  reply	other threads:[~2020-06-23 22:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 14:24 [PATCH net-next v2 0/5] hinic: add some ethtool ops support Luo bin
2020-06-23 14:24 ` [PATCH net-next v2 1/5] hinic: add support to set and get pause params Luo bin
2020-06-23 21:54   ` Jakub Kicinski
2020-06-27  1:30     ` luobin (L)
2020-06-23 14:24 ` [PATCH net-next v2 2/5] hinic: add support to set and get irq coalesce Luo bin
2020-06-23 21:56   ` Jakub Kicinski
2020-06-23 14:24 ` [PATCH net-next v2 3/5] hinic: add self test support Luo bin
2020-06-23 14:24 ` [PATCH net-next v2 4/5] hinic: add support to identify physical device Luo bin
2020-06-23 21:58   ` Jakub Kicinski
2020-06-23 14:24 ` [PATCH net-next v2 5/5] hinic: add support to get eeprom information Luo bin
2020-06-23 22:02   ` Jakub Kicinski [this message]
2020-06-27  2:11     ` luobin (L)

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=20200623150233.440583b8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=cloud.wangxiaoyun@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luobin9@huawei.com \
    --cc=luoxianjun@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=yin.yinshi@huawei.com \
    /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).