Skip to content

Commit 171a700

Browse files
krzkdavem330
authored andcommitted
nfc: s3fwrn5: Constify s3fwrn5_fw_info when not modified
Two functions accept pointer to struct s3fwrn5_fw_info but do not modify the contents. Make them const so the code is a little bit safer. Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4aa62c6 commit 171a700

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/nfc/s3fwrn5/firmware.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static int s3fwrn5_fw_get_base_addr(
348348
}
349349

350350
static inline bool
351-
s3fwrn5_fw_is_custom(struct s3fwrn5_fw_cmd_get_bootinfo_rsp *bootinfo)
351+
s3fwrn5_fw_is_custom(const struct s3fwrn5_fw_cmd_get_bootinfo_rsp *bootinfo)
352352
{
353353
return !!bootinfo->hw_version[2];
354354
}
@@ -399,7 +399,7 @@ int s3fwrn5_fw_setup(struct s3fwrn5_fw_info *fw_info)
399399
return ret;
400400
}
401401

402-
bool s3fwrn5_fw_check_version(struct s3fwrn5_fw_info *fw_info, u32 version)
402+
bool s3fwrn5_fw_check_version(const struct s3fwrn5_fw_info *fw_info, u32 version)
403403
{
404404
struct s3fwrn5_fw_version *new = (void *) &fw_info->fw.version;
405405
struct s3fwrn5_fw_version *old = (void *) &version;

drivers/nfc/s3fwrn5/firmware.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct s3fwrn5_fw_info {
9191

9292
void s3fwrn5_fw_init(struct s3fwrn5_fw_info *fw_info, const char *fw_name);
9393
int s3fwrn5_fw_setup(struct s3fwrn5_fw_info *fw_info);
94-
bool s3fwrn5_fw_check_version(struct s3fwrn5_fw_info *fw_info, u32 version);
94+
bool s3fwrn5_fw_check_version(const struct s3fwrn5_fw_info *fw_info, u32 version);
9595
int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info);
9696
void s3fwrn5_fw_cleanup(struct s3fwrn5_fw_info *fw_info);
9797

0 commit comments

Comments
 (0)