.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2014-2015 Hisilicon Limited. |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms of the GNU General Public License as published by |
---|
6 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
7 | | - * (at your option) any later version. |
---|
8 | 4 | */ |
---|
9 | 5 | |
---|
10 | 6 | #include <linux/cdev.h> |
---|
.. | .. |
---|
38 | 34 | /** |
---|
39 | 35 | *hns_rcb_wait_fbd_clean - clean fbd |
---|
40 | 36 | *@qs: ring struct pointer array |
---|
41 | | - *@qnum: num of array |
---|
| 37 | + *@q_num: num of array |
---|
42 | 38 | *@flag: tx or rx flag |
---|
43 | 39 | */ |
---|
44 | 40 | void hns_rcb_wait_fbd_clean(struct hnae_queue **qs, int q_num, u32 flag) |
---|
.. | .. |
---|
195 | 191 | |
---|
196 | 192 | /** |
---|
197 | 193 | *hns_rcb_ring_enable_hw - enable ring |
---|
198 | | - *@ring: rcb ring |
---|
| 194 | + *@q: rcb ring |
---|
| 195 | + *@val: value to write |
---|
199 | 196 | */ |
---|
200 | 197 | void hns_rcb_ring_enable_hw(struct hnae_queue *q, u32 val) |
---|
201 | 198 | { |
---|
.. | .. |
---|
458 | 455 | mdnum_ppkt = HNS_RCB_RING_MAX_BD_PER_PKT; |
---|
459 | 456 | } else { |
---|
460 | 457 | ring = &q->tx_ring; |
---|
461 | | - ring->io_base = (u8 __iomem *)ring_pair_cb->q.io_base + |
---|
| 458 | + ring->io_base = ring_pair_cb->q.io_base + |
---|
462 | 459 | HNS_RCB_TX_REG_OFFSET; |
---|
463 | 460 | irq_idx = HNS_RCB_IRQ_IDX_TX; |
---|
464 | 461 | mdnum_ppkt = is_ver1 ? HNS_RCB_RING_MAX_TXBD_PER_PKT : |
---|
.. | .. |
---|
764 | 761 | } |
---|
765 | 762 | } |
---|
766 | 763 | |
---|
767 | | -static void __iomem *hns_rcb_common_get_vaddr(struct rcb_common_cb *rcb_common) |
---|
| 764 | +static u8 __iomem *hns_rcb_common_get_vaddr(struct rcb_common_cb *rcb_common) |
---|
768 | 765 | { |
---|
769 | 766 | struct dsaf_device *dsaf_dev = rcb_common->dsaf_dev; |
---|
770 | 767 | |
---|
.. | .. |
---|
788 | 785 | int ring_num = hns_rcb_get_ring_num(dsaf_dev); |
---|
789 | 786 | |
---|
790 | 787 | rcb_common = |
---|
791 | | - devm_kzalloc(dsaf_dev->dev, sizeof(*rcb_common) + |
---|
792 | | - ring_num * sizeof(struct ring_pair_cb), GFP_KERNEL); |
---|
| 788 | + devm_kzalloc(dsaf_dev->dev, |
---|
| 789 | + struct_size(rcb_common, ring_pair_cb, ring_num), |
---|
| 790 | + GFP_KERNEL); |
---|
793 | 791 | if (!rcb_common) { |
---|
794 | 792 | dev_err(dsaf_dev->dev, "rcb common devm_kzalloc fail!\n"); |
---|
795 | 793 | return -ENOMEM; |
---|
.. | .. |
---|
847 | 845 | |
---|
848 | 846 | /** |
---|
849 | 847 | *hns_rcb_get_stats - get rcb statistic |
---|
850 | | - *@ring: rcb ring |
---|
| 848 | + *@queue: rcb ring |
---|
851 | 849 | *@data:statistic value |
---|
852 | 850 | */ |
---|
853 | 851 | void hns_rcb_get_stats(struct hnae_queue *queue, u64 *data) |
---|