Commit cb8caa3c authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by David S. Miller
Browse files

nfc: constify nci_driver_ops (prop_ops and core_ops)



Neither the core nor the drivers modify the passed pointer to struct
nci_driver_ops (consisting of function pointers), so make it a pointer
to const for correctness and safety.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d08ba0fd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -651,7 +651,7 @@ static int fdp_nci_core_get_config_rsp_packet(struct nci_dev *ndev,
	return 0;
}

static struct nci_driver_ops fdp_core_ops[] = {
static const struct nci_driver_ops fdp_core_ops[] = {
	{
		.opcode = NCI_OP_CORE_GET_CONFIG_RSP,
		.rsp = fdp_nci_core_get_config_rsp_packet,
@@ -662,7 +662,7 @@ static struct nci_driver_ops fdp_core_ops[] = {
	},
};

static struct nci_driver_ops fdp_prop_ops[] = {
static const struct nci_driver_ops fdp_prop_ops[] = {
	{
		.opcode = nci_opcode_pack(NCI_GID_PROP, NCI_OP_PROP_PATCH_OID),
		.rsp = fdp_nci_prop_patch_rsp_packet,
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ static int s3fwrn5_nci_prop_rsp(struct nci_dev *ndev, struct sk_buff *skb)
	return 0;
}

struct nci_driver_ops s3fwrn5_nci_prop_ops[4] = {
const struct nci_driver_ops s3fwrn5_nci_prop_ops[4] = {
	{
		.opcode = nci_opcode_pack(NCI_GID_PROPRIETARY,
				NCI_PROP_SET_RFREG),
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ struct nci_prop_fw_cfg_rsp {
	__u8 status;
};

extern struct nci_driver_ops s3fwrn5_nci_prop_ops[4];
extern const struct nci_driver_ops s3fwrn5_nci_prop_ops[4];
int s3fwrn5_nci_rf_configure(struct s3fwrn5_info *info, const char *fw_name);

#endif /* __LOCAL_S3FWRN5_NCI_H_ */
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ static int st_nci_prop_rsp_packet(struct nci_dev *ndev,
	return 0;
}

static struct nci_driver_ops st_nci_prop_ops[] = {
static const struct nci_driver_ops st_nci_prop_ops[] = {
	{
		.opcode = nci_opcode_pack(NCI_GID_PROPRIETARY,
					  ST_NCI_CORE_PROP),
+2 −2
Original line number Diff line number Diff line
@@ -82,10 +82,10 @@ struct nci_ops {
	void  (*hci_cmd_received)(struct nci_dev *ndev, u8 pipe, u8 cmd,
				  struct sk_buff *skb);

	struct nci_driver_ops *prop_ops;
	const struct nci_driver_ops *prop_ops;
	size_t n_prop_ops;

	struct nci_driver_ops *core_ops;
	const struct nci_driver_ops *core_ops;
	size_t n_core_ops;
};

Loading