Skip to content

Commit 6a86a4c

Browse files
dhowellssmfrench
authored andcommitted
cifs: Fix specification of function pointers
Change the mid_receive_t, mid_callback_t and mid_handle_t function pointers to have the pointer marker in the typedef. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org> cc: linux-cifs@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 28405cb commit 6a86a4c

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

fs/smb/client/cifsglob.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,7 @@ static inline void cifs_stats_bytes_read(struct cifs_tcon *tcon,
16601660
* Returns zero on a successful receive, or an error. The receive state in
16611661
* the TCP_Server_Info will also be updated.
16621662
*/
1663-
typedef int (mid_receive_t)(struct TCP_Server_Info *server,
1663+
typedef int (*mid_receive_t)(struct TCP_Server_Info *server,
16641664
struct mid_q_entry *mid);
16651665

16661666
/*
@@ -1671,13 +1671,13 @@ typedef int (mid_receive_t)(struct TCP_Server_Info *server,
16711671
* - it will be called by cifsd, with no locks held
16721672
* - the mid will be removed from any lists
16731673
*/
1674-
typedef void (mid_callback_t)(struct mid_q_entry *mid);
1674+
typedef void (*mid_callback_t)(struct mid_q_entry *mid);
16751675

16761676
/*
16771677
* This is the protopyte for mid handle function. This is called once the mid
16781678
* has been recognized after decryption of the message.
16791679
*/
1680-
typedef int (mid_handle_t)(struct TCP_Server_Info *server,
1680+
typedef int (*mid_handle_t)(struct TCP_Server_Info *server,
16811681
struct mid_q_entry *mid);
16821682

16831683
/* one of these for every pending CIFS request to the server */
@@ -1696,9 +1696,9 @@ struct mid_q_entry {
16961696
unsigned long when_sent; /* time when smb send finished */
16971697
unsigned long when_received; /* when demux complete (taken off wire) */
16981698
#endif
1699-
mid_receive_t *receive; /* call receive callback */
1700-
mid_callback_t *callback; /* call completion callback */
1701-
mid_handle_t *handle; /* call handle mid callback */
1699+
mid_receive_t receive; /* call receive callback */
1700+
mid_callback_t callback; /* call completion callback */
1701+
mid_handle_t handle; /* call handle mid callback */
17021702
void *callback_data; /* general purpose pointer for callback */
17031703
struct task_struct *creator;
17041704
void *resp_buf; /* pointer to received SMB header */

fs/smb/client/cifsproto.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ extern int cifs_ipaddr_cmp(struct sockaddr *srcaddr, struct sockaddr *rhs);
9595
extern bool cifs_match_ipaddr(struct sockaddr *srcaddr, struct sockaddr *rhs);
9696
extern int cifs_discard_remaining_data(struct TCP_Server_Info *server);
9797
extern int cifs_call_async(struct TCP_Server_Info *server,
98-
struct smb_rqst *rqst,
99-
mid_receive_t *receive, mid_callback_t *callback,
100-
mid_handle_t *handle, void *cbdata, const int flags,
101-
const struct cifs_credits *exist_credits);
98+
struct smb_rqst *rqst,
99+
mid_receive_t receive, mid_callback_t callback,
100+
mid_handle_t handle, void *cbdata, const int flags,
101+
const struct cifs_credits *exist_credits);
102102
extern struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses);
103103
extern int cifs_send_recv(const unsigned int xid, struct cifs_ses *ses,
104104
struct TCP_Server_Info *server,

fs/smb/client/transport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,8 @@ int wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *mid)
664664
*/
665665
int
666666
cifs_call_async(struct TCP_Server_Info *server, struct smb_rqst *rqst,
667-
mid_receive_t *receive, mid_callback_t *callback,
668-
mid_handle_t *handle, void *cbdata, const int flags,
667+
mid_receive_t receive, mid_callback_t callback,
668+
mid_handle_t handle, void *cbdata, const int flags,
669669
const struct cifs_credits *exist_credits)
670670
{
671671
int rc;

0 commit comments

Comments
 (0)