Skip to content

Commit c6b5df0

Browse files
JuliaLawallSamuel Ortiz
authored andcommitted
nfc: s3fwrn5: constify s3fwrn5_phy_ops structures
The s3fwrn5_phy_ops structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 59df9bb commit c6b5df0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

drivers/nfc/s3fwrn5/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static struct nci_ops s3fwrn5_nci_ops = {
147147
};
148148

149149
int s3fwrn5_probe(struct nci_dev **ndev, void *phy_id, struct device *pdev,
150-
struct s3fwrn5_phy_ops *phy_ops, unsigned int max_payload)
150+
const struct s3fwrn5_phy_ops *phy_ops, unsigned int max_payload)
151151
{
152152
struct s3fwrn5_info *info;
153153
int ret;

drivers/nfc/s3fwrn5/i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int s3fwrn5_i2c_write(void *phy_id, struct sk_buff *skb)
125125
return 0;
126126
}
127127

128-
static struct s3fwrn5_phy_ops i2c_phy_ops = {
128+
static const struct s3fwrn5_phy_ops i2c_phy_ops = {
129129
.set_wake = s3fwrn5_i2c_set_wake,
130130
.set_mode = s3fwrn5_i2c_set_mode,
131131
.get_mode = s3fwrn5_i2c_get_mode,

drivers/nfc/s3fwrn5/s3fwrn5.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct s3fwrn5_info {
4444
void *phy_id;
4545
struct device *pdev;
4646

47-
struct s3fwrn5_phy_ops *phy_ops;
47+
const struct s3fwrn5_phy_ops *phy_ops;
4848
unsigned int max_payload;
4949

5050
struct s3fwrn5_fw_info fw_info;
@@ -90,7 +90,7 @@ static inline int s3fwrn5_write(struct s3fwrn5_info *info, struct sk_buff *skb)
9090
}
9191

9292
int s3fwrn5_probe(struct nci_dev **ndev, void *phy_id, struct device *pdev,
93-
struct s3fwrn5_phy_ops *phy_ops, unsigned int max_payload);
93+
const struct s3fwrn5_phy_ops *phy_ops, unsigned int max_payload);
9494
void s3fwrn5_remove(struct nci_dev *ndev);
9595

9696
int s3fwrn5_recv_frame(struct nci_dev *ndev, struct sk_buff *skb,

0 commit comments

Comments
 (0)