Re: [PATCH iwl-next v2 5/5] iavf: Add VIRTCHNL Opcodes Support for Queue bw Setting

Simon Horman
2023-08-08T20:54:15Z

On Tue, Aug 08, 2023 at 09:57:34AM +0800, Wenjun Wu wrote:
> From: Jun Zhang <xuejun.zhang@intel.com>

...

> @@ -2471,6 +2687,16 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
> if (!v_retval)
> iavf_netdev_features_vlan_strip_set(netdev, false);
> break;
> + case VIRTCHNL_OP_GET_QOS_CAPS:
> + u16 len = struct_size(adapter->qos_caps, cap,
> + IAVF_MAX_QOS_TC_NUM);

Hi Jun Zhang and Wenju Wu,

clang-16 complains about this quite a lot.
I think it is because it wants the declaration of len - and thus
the rest of this case - inside a block ({}).

.../iavf_virtchnl.c:2691:3: error: expected expression
u16 len = struct_size(adapter->qos_caps, cap,
^
.../iavf_virtchnl.c:2693:46: error: use of undeclared identifier 'len'
memcpy(adapter->qos_caps, msg, min(msglen, len));
^
.../iavf_virtchnl.c:2693:46: error: use of undeclared identifier 'len'

> + memcpy(adapter->qos_caps, msg, min(msglen, len));
> + break;
> + case VIRTCHNL_OP_CONFIG_QUANTA:
> + iavf_notify_queue_config_complete(adapter);
> + break;
> + case VIRTCHNL_OP_CONFIG_QUEUE_BW:
> + break;
> default:
> if (adapter->current_op && (v_opcode != adapter->current_op))
> dev_warn(&adapter->pdev->dev, "Expected response %d from PF, received %d\n",
> --
> 2.34.1
>
>