Skip to content

Commit

Permalink
nfc: s3fwrn5: Constify s3fwrn5_fw_info when not modified
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
krzk authored and davem330 committed Sep 10, 2020
1 parent 4aa62c6 commit 171a700
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/nfc/s3fwrn5/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ static int s3fwrn5_fw_get_base_addr(
}

static inline bool
s3fwrn5_fw_is_custom(struct s3fwrn5_fw_cmd_get_bootinfo_rsp *bootinfo)
s3fwrn5_fw_is_custom(const struct s3fwrn5_fw_cmd_get_bootinfo_rsp *bootinfo)
{
return !!bootinfo->hw_version[2];
}
Expand Down Expand Up @@ -399,7 +399,7 @@ int s3fwrn5_fw_setup(struct s3fwrn5_fw_info *fw_info)
return ret;
}

bool s3fwrn5_fw_check_version(struct s3fwrn5_fw_info *fw_info, u32 version)
bool s3fwrn5_fw_check_version(const struct s3fwrn5_fw_info *fw_info, u32 version)
{
struct s3fwrn5_fw_version *new = (void *) &fw_info->fw.version;
struct s3fwrn5_fw_version *old = (void *) &version;
Expand Down
2 changes: 1 addition & 1 deletion drivers/nfc/s3fwrn5/firmware.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct s3fwrn5_fw_info {

void s3fwrn5_fw_init(struct s3fwrn5_fw_info *fw_info, const char *fw_name);
int s3fwrn5_fw_setup(struct s3fwrn5_fw_info *fw_info);
bool s3fwrn5_fw_check_version(struct s3fwrn5_fw_info *fw_info, u32 version);
bool s3fwrn5_fw_check_version(const struct s3fwrn5_fw_info *fw_info, u32 version);
int s3fwrn5_fw_download(struct s3fwrn5_fw_info *fw_info);
void s3fwrn5_fw_cleanup(struct s3fwrn5_fw_info *fw_info);

Expand Down

0 comments on commit 171a700

Please sign in to comment.