From: Jakub Kicinski <kuba@kernel.org>
To: Barry Song <song.bao.hua@hisilicon.com>
Cc: <davem@davemloft.net>, <yisen.zhuang@huawei.com>,
<salil.mehta@huawei.com>, <netdev@vger.kernel.org>,
<linyunsheng@huawei.com>, <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>
Subject: Re: [PATCH 2/5] net: hns3: pointer type of buffer should be void
Date: Thu, 18 Jun 2020 16:35:45 -0700 [thread overview]
Message-ID: <20200618163545.4544860d@kicinski-fedora-PC1C0HJN> (raw)
In-Reply-To: <20200618010211.75840-3-song.bao.hua@hisilicon.com>
On Thu, 18 Jun 2020 13:02:08 +1200 Barry Song wrote:
> Move the type of buffer address from unsigned char to void
>
> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
> ---
> drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
> drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> index 1817d7f2e5f6..61b5a849b162 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> @@ -3070,7 +3070,7 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring)
> return -ENXIO;
>
> if (!skb)
> - ring->va = (unsigned char *)desc_cb->buf + desc_cb->page_offset;
> + ring->va = desc_cb->buf + desc_cb->page_offset;
>
> /* Prefetch first cache line of first page
> * Idea is to cache few bytes of the header of the packet. Our L1 Cache
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
> index 66cd4395f781..9f64077ee834 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
> @@ -407,7 +407,7 @@ struct hns3_enet_ring {
>
> u32 pull_len; /* head length for current packet */
> u32 frag_num;
> - unsigned char *va; /* first buffer address for current packet */
> + void *va; /* first buffer address for current packet */
>
> u32 flag; /* ring attribute */
>
I think void pointer arithmetic is questionable in the eyes of the C
standard. But I'm not sure about kernel C.
Otherwise series looks good to me.
next prev parent reply other threads:[~2020-06-18 23:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 1:02 [PATCH 0/5] net: hns3: a bundle of minor cleanup and fixes Barry Song
2020-06-18 1:02 ` [PATCH 1/5] net: hns3: remove unnecessary devm_kfree Barry Song
2020-06-18 1:02 ` [PATCH 2/5] net: hns3: pointer type of buffer should be void Barry Song
2020-06-18 23:35 ` Jakub Kicinski [this message]
2020-06-18 1:02 ` [PATCH 3/5] net: hns3: rename buffer-related functions Barry Song
2020-06-18 1:02 ` [PATCH 4/5] net: hns3: replace disable_irq by IRQ_NOAUTOEN flag Barry Song
2020-06-18 1:02 ` [PATCH 5/5] net: hns3: streaming dma buffer sync between cpu and device Barry Song
2020-06-19 3:43 ` [PATCH 0/5] net: hns3: a bundle of minor cleanup and fixes David Miller
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=20200618163545.4544860d@kicinski-fedora-PC1C0HJN \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=linyunsheng@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=song.bao.hua@hisilicon.com \
--cc=yisen.zhuang@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
all inboxes | Powered by JetHome®