linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/cifs/smb2transport.c: Make some functions static
@ 2019-09-21  6:22 zhengbin
  2019-09-23  5:07 ` Steve French
  0 siblings, 1 reply; 6+ messages in thread
From: zhengbin @ 2019-09-21  6:22 UTC (permalink / raw)
  To: sfrench, linux-cifs; +Cc: yi.zhang, zhengbin13

Fix sparse warnings:

fs/cifs/smb2transport.c:52:1: warning: symbol 'smb3_crypto_shash_allocate' was not declared. Should it be static?
fs/cifs/smb2transport.c:101:4: warning: symbol 'smb2_find_chan_signkey' was not declared. Should it be static?
fs/cifs/smb2transport.c:121:17: warning: symbol 'smb2_find_global_smb_ses' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 fs/cifs/smb2transport.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
index 12988df..7cc8641 100644
--- a/fs/cifs/smb2transport.c
+++ b/fs/cifs/smb2transport.c
@@ -48,7 +48,7 @@ smb2_crypto_shash_allocate(struct TCP_Server_Info *server)
 			       &server->secmech.sdeschmacsha256);
 }

-int
+static int
 smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
 {
 	struct cifs_secmech *p = &server->secmech;
@@ -98,7 +98,8 @@ smb311_crypto_shash_allocate(struct TCP_Server_Info *server)
 	return rc;
 }

-u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
+static u8 *
+smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
 {
 	int i;
 	struct cifs_chan *chan;
@@ -118,7 +119,7 @@ u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
 	return NULL;
 }

-struct cifs_ses *
+static struct cifs_ses *
 smb2_find_global_smb_ses(__u64 ses_id)
 {
 	struct TCP_Server_Info *server;
--
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] fs/cifs/smb2transport.c: Make some functions static
  2019-09-21  6:22 [PATCH] fs/cifs/smb2transport.c: Make some functions static zhengbin
@ 2019-09-23  5:07 ` Steve French
  2019-09-23  6:07   ` zhengbin (A)
  0 siblings, 1 reply; 6+ messages in thread
From: Steve French @ 2019-09-23  5:07 UTC (permalink / raw)
  To: zhengbin, Aurélien Aptel; +Cc: Steve French, CIFS, yi.zhang

Thanks - merged into cifs-2.6.git for-next

Aurélien -
FYI - it makes minor update to code you changed to remove the warning.


On Sun, Sep 22, 2019 at 2:13 PM zhengbin <zhengbin13@huawei.com> wrote:
>
> Fix sparse warnings:
>
> fs/cifs/smb2transport.c:52:1: warning: symbol 'smb3_crypto_shash_allocate' was not declared. Should it be static?
> fs/cifs/smb2transport.c:101:4: warning: symbol 'smb2_find_chan_signkey' was not declared. Should it be static?
> fs/cifs/smb2transport.c:121:17: warning: symbol 'smb2_find_global_smb_ses' was not declared. Should it be static?
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> ---
>  fs/cifs/smb2transport.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
> index 12988df..7cc8641 100644
> --- a/fs/cifs/smb2transport.c
> +++ b/fs/cifs/smb2transport.c
> @@ -48,7 +48,7 @@ smb2_crypto_shash_allocate(struct TCP_Server_Info *server)
>                                &server->secmech.sdeschmacsha256);
>  }
>
> -int
> +static int
>  smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
>  {
>         struct cifs_secmech *p = &server->secmech;
> @@ -98,7 +98,8 @@ smb311_crypto_shash_allocate(struct TCP_Server_Info *server)
>         return rc;
>  }
>
> -u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
> +static u8 *
> +smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
>  {
>         int i;
>         struct cifs_chan *chan;
> @@ -118,7 +119,7 @@ u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
>         return NULL;
>  }
>
> -struct cifs_ses *
> +static struct cifs_ses *
>  smb2_find_global_smb_ses(__u64 ses_id)
>  {
>         struct TCP_Server_Info *server;
> --
> 2.7.4
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fs/cifs/smb2transport.c: Make some functions static
  2019-09-23  5:07 ` Steve French
@ 2019-09-23  6:07   ` zhengbin (A)
  2019-09-23  6:33     ` Steve French
  0 siblings, 1 reply; 6+ messages in thread
From: zhengbin (A) @ 2019-09-23  6:07 UTC (permalink / raw)
  To: Steve French; +Cc: zhangyi (F), CIFS


On 2019/9/23 13:07, Steve French wrote:
> Thanks - merged into cifs-2.6.git for-next
>
> Aurélien -
> FYI - it makes minor update to code you changed to remove the warning.

We have a similar warning in fs/cifs/smb2pdu.c

fs/cifs/smb2pdu.c:3184:1: warning: symbol 'SMB2_notify_init' was not declared. Should it be static?
fs/cifs/smb2pdu.c:3213:1: warning: symbol 'SMB2_change_notify' was not declared. Should it be static?


while these two functions are introduced by commit af8d46ab49b8

("smb3: add missing worker function for SMB3 change notify"). SMB2_notify_init is called by SMB2_change_notify

No one calls  SMB2_change_notify? Or we will call SMB2_change_notify in the future?

>
>
> On Sun, Sep 22, 2019 at 2:13 PM zhengbin <zhengbin13@huawei.com> wrote:
>> Fix sparse warnings:
>>
>> fs/cifs/smb2transport.c:52:1: warning: symbol 'smb3_crypto_shash_allocate' was not declared. Should it be static?
>> fs/cifs/smb2transport.c:101:4: warning: symbol 'smb2_find_chan_signkey' was not declared. Should it be static?
>> fs/cifs/smb2transport.c:121:17: warning: symbol 'smb2_find_global_smb_ses' was not declared. Should it be static?
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: zhengbin <zhengbin13@huawei.com>
>> ---
>>  fs/cifs/smb2transport.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
>> index 12988df..7cc8641 100644
>> --- a/fs/cifs/smb2transport.c
>> +++ b/fs/cifs/smb2transport.c
>> @@ -48,7 +48,7 @@ smb2_crypto_shash_allocate(struct TCP_Server_Info *server)
>>                                &server->secmech.sdeschmacsha256);
>>  }
>>
>> -int
>> +static int
>>  smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
>>  {
>>         struct cifs_secmech *p = &server->secmech;
>> @@ -98,7 +98,8 @@ smb311_crypto_shash_allocate(struct TCP_Server_Info *server)
>>         return rc;
>>  }
>>
>> -u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
>> +static u8 *
>> +smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
>>  {
>>         int i;
>>         struct cifs_chan *chan;
>> @@ -118,7 +119,7 @@ u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
>>         return NULL;
>>  }
>>
>> -struct cifs_ses *
>> +static struct cifs_ses *
>>  smb2_find_global_smb_ses(__u64 ses_id)
>>  {
>>         struct TCP_Server_Info *server;
>> --
>> 2.7.4
>>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fs/cifs/smb2transport.c: Make some functions static
  2019-09-23  6:07   ` zhengbin (A)
@ 2019-09-23  6:33     ` Steve French
  2019-09-23  6:47       ` zhengbin (A)
  0 siblings, 1 reply; 6+ messages in thread
From: Steve French @ 2019-09-23  6:33 UTC (permalink / raw)
  To: zhengbin (A); +Cc: zhangyi (F), CIFS

The code to call SMB2_change_notify (from an ioctl) should make it in
pretty soon (let's hope we can finish testing it this  week).   The
fix to inotify to allow inotify to call into a network file system
will be helpful in the long run, but in the short term at least a GUI
should be able to call into a cifs.ko specific ioctl soon for it.

On Mon, Sep 23, 2019 at 1:08 AM zhengbin (A) <zhengbin13@huawei.com> wrote:
>
>
> On 2019/9/23 13:07, Steve French wrote:
> > Thanks - merged into cifs-2.6.git for-next
> >
> > Aurélien -
> > FYI - it makes minor update to code you changed to remove the warning.
>
> We have a similar warning in fs/cifs/smb2pdu.c
>
> fs/cifs/smb2pdu.c:3184:1: warning: symbol 'SMB2_notify_init' was not declared. Should it be static?
> fs/cifs/smb2pdu.c:3213:1: warning: symbol 'SMB2_change_notify' was not declared. Should it be static?
>
>
> while these two functions are introduced by commit af8d46ab49b8
>
> ("smb3: add missing worker function for SMB3 change notify"). SMB2_notify_init is called by SMB2_change_notify
>
> No one calls  SMB2_change_notify? Or we will call SMB2_change_notify in the future?
>
> >
> >
> > On Sun, Sep 22, 2019 at 2:13 PM zhengbin <zhengbin13@huawei.com> wrote:
> >> Fix sparse warnings:
> >>
> >> fs/cifs/smb2transport.c:52:1: warning: symbol 'smb3_crypto_shash_allocate' was not declared. Should it be static?
> >> fs/cifs/smb2transport.c:101:4: warning: symbol 'smb2_find_chan_signkey' was not declared. Should it be static?
> >> fs/cifs/smb2transport.c:121:17: warning: symbol 'smb2_find_global_smb_ses' was not declared. Should it be static?
> >>
> >> Reported-by: Hulk Robot <hulkci@huawei.com>
> >> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> >> ---
> >>  fs/cifs/smb2transport.c | 7 ++++---
> >>  1 file changed, 4 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
> >> index 12988df..7cc8641 100644
> >> --- a/fs/cifs/smb2transport.c
> >> +++ b/fs/cifs/smb2transport.c
> >> @@ -48,7 +48,7 @@ smb2_crypto_shash_allocate(struct TCP_Server_Info *server)
> >>                                &server->secmech.sdeschmacsha256);
> >>  }
> >>
> >> -int
> >> +static int
> >>  smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
> >>  {
> >>         struct cifs_secmech *p = &server->secmech;
> >> @@ -98,7 +98,8 @@ smb311_crypto_shash_allocate(struct TCP_Server_Info *server)
> >>         return rc;
> >>  }
> >>
> >> -u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
> >> +static u8 *
> >> +smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
> >>  {
> >>         int i;
> >>         struct cifs_chan *chan;
> >> @@ -118,7 +119,7 @@ u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
> >>         return NULL;
> >>  }
> >>
> >> -struct cifs_ses *
> >> +static struct cifs_ses *
> >>  smb2_find_global_smb_ses(__u64 ses_id)
> >>  {
> >>         struct TCP_Server_Info *server;
> >> --
> >> 2.7.4
> >>
> >
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fs/cifs/smb2transport.c: Make some functions static
  2019-09-23  6:33     ` Steve French
@ 2019-09-23  6:47       ` zhengbin (A)
  2019-09-23  6:52         ` Steve French
  0 siblings, 1 reply; 6+ messages in thread
From: zhengbin (A) @ 2019-09-23  6:47 UTC (permalink / raw)
  To: Steve French; +Cc: zhangyi (F), CIFS


On 2019/9/23 14:33, Steve French wrote:
> The code to call SMB2_change_notify (from an ioctl) should make it in
> pretty soon (let's hope we can finish testing it this  week).   The
> fix to inotify to allow inotify to call into a network file system
> will be helpful in the long run, but in the short term at least a GUI
> should be able to call into a cifs.ko specific ioctl soon for it.
Thus SMB2_notify_init should be static? I send a patch later?
>
> On Mon, Sep 23, 2019 at 1:08 AM zhengbin (A) <zhengbin13@huawei.com> wrote:
>>
>> On 2019/9/23 13:07, Steve French wrote:
>>> Thanks - merged into cifs-2.6.git for-next
>>>
>>> Aurélien -
>>> FYI - it makes minor update to code you changed to remove the warning.
>> We have a similar warning in fs/cifs/smb2pdu.c
>>
>> fs/cifs/smb2pdu.c:3184:1: warning: symbol 'SMB2_notify_init' was not declared. Should it be static?
>> fs/cifs/smb2pdu.c:3213:1: warning: symbol 'SMB2_change_notify' was not declared. Should it be static?
>>
>>
>> while these two functions are introduced by commit af8d46ab49b8
>>
>> ("smb3: add missing worker function for SMB3 change notify"). SMB2_notify_init is called by SMB2_change_notify
>>
>> No one calls  SMB2_change_notify? Or we will call SMB2_change_notify in the future?
>>
>>>
>>> On Sun, Sep 22, 2019 at 2:13 PM zhengbin <zhengbin13@huawei.com> wrote:
>>>> Fix sparse warnings:
>>>>
>>>> fs/cifs/smb2transport.c:52:1: warning: symbol 'smb3_crypto_shash_allocate' was not declared. Should it be static?
>>>> fs/cifs/smb2transport.c:101:4: warning: symbol 'smb2_find_chan_signkey' was not declared. Should it be static?
>>>> fs/cifs/smb2transport.c:121:17: warning: symbol 'smb2_find_global_smb_ses' was not declared. Should it be static?
>>>>
>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>> Signed-off-by: zhengbin <zhengbin13@huawei.com>
>>>> ---
>>>>  fs/cifs/smb2transport.c | 7 ++++---
>>>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
>>>> index 12988df..7cc8641 100644
>>>> --- a/fs/cifs/smb2transport.c
>>>> +++ b/fs/cifs/smb2transport.c
>>>> @@ -48,7 +48,7 @@ smb2_crypto_shash_allocate(struct TCP_Server_Info *server)
>>>>                                &server->secmech.sdeschmacsha256);
>>>>  }
>>>>
>>>> -int
>>>> +static int
>>>>  smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
>>>>  {
>>>>         struct cifs_secmech *p = &server->secmech;
>>>> @@ -98,7 +98,8 @@ smb311_crypto_shash_allocate(struct TCP_Server_Info *server)
>>>>         return rc;
>>>>  }
>>>>
>>>> -u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
>>>> +static u8 *
>>>> +smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
>>>>  {
>>>>         int i;
>>>>         struct cifs_chan *chan;
>>>> @@ -118,7 +119,7 @@ u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
>>>>         return NULL;
>>>>  }
>>>>
>>>> -struct cifs_ses *
>>>> +static struct cifs_ses *
>>>>  smb2_find_global_smb_ses(__u64 ses_id)
>>>>  {
>>>>         struct TCP_Server_Info *server;
>>>> --
>>>> 2.7.4
>>>>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fs/cifs/smb2transport.c: Make some functions static
  2019-09-23  6:47       ` zhengbin (A)
@ 2019-09-23  6:52         ` Steve French
  0 siblings, 0 replies; 6+ messages in thread
From: Steve French @ 2019-09-23  6:52 UTC (permalink / raw)
  To: zhengbin (A); +Cc: zhangyi (F), CIFS

Yes - notify init should be static - but not SMB2_notify

On Mon, Sep 23, 2019 at 1:48 AM zhengbin (A) <zhengbin13@huawei.com> wrote:
>
>
> On 2019/9/23 14:33, Steve French wrote:
> > The code to call SMB2_change_notify (from an ioctl) should make it in
> > pretty soon (let's hope we can finish testing it this  week).   The
> > fix to inotify to allow inotify to call into a network file system
> > will be helpful in the long run, but in the short term at least a GUI
> > should be able to call into a cifs.ko specific ioctl soon for it.
> Thus SMB2_notify_init should be static? I send a patch later?
> >
> > On Mon, Sep 23, 2019 at 1:08 AM zhengbin (A) <zhengbin13@huawei.com> wrote:
> >>
> >> On 2019/9/23 13:07, Steve French wrote:
> >>> Thanks - merged into cifs-2.6.git for-next
> >>>
> >>> Aurélien -
> >>> FYI - it makes minor update to code you changed to remove the warning.
> >> We have a similar warning in fs/cifs/smb2pdu.c
> >>
> >> fs/cifs/smb2pdu.c:3184:1: warning: symbol 'SMB2_notify_init' was not declared. Should it be static?
> >> fs/cifs/smb2pdu.c:3213:1: warning: symbol 'SMB2_change_notify' was not declared. Should it be static?
> >>
> >>
> >> while these two functions are introduced by commit af8d46ab49b8
> >>
> >> ("smb3: add missing worker function for SMB3 change notify"). SMB2_notify_init is called by SMB2_change_notify
> >>
> >> No one calls  SMB2_change_notify? Or we will call SMB2_change_notify in the future?
> >>
> >>>
> >>> On Sun, Sep 22, 2019 at 2:13 PM zhengbin <zhengbin13@huawei.com> wrote:
> >>>> Fix sparse warnings:
> >>>>
> >>>> fs/cifs/smb2transport.c:52:1: warning: symbol 'smb3_crypto_shash_allocate' was not declared. Should it be static?
> >>>> fs/cifs/smb2transport.c:101:4: warning: symbol 'smb2_find_chan_signkey' was not declared. Should it be static?
> >>>> fs/cifs/smb2transport.c:121:17: warning: symbol 'smb2_find_global_smb_ses' was not declared. Should it be static?
> >>>>
> >>>> Reported-by: Hulk Robot <hulkci@huawei.com>
> >>>> Signed-off-by: zhengbin <zhengbin13@huawei.com>
> >>>> ---
> >>>>  fs/cifs/smb2transport.c | 7 ++++---
> >>>>  1 file changed, 4 insertions(+), 3 deletions(-)
> >>>>
> >>>> diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
> >>>> index 12988df..7cc8641 100644
> >>>> --- a/fs/cifs/smb2transport.c
> >>>> +++ b/fs/cifs/smb2transport.c
> >>>> @@ -48,7 +48,7 @@ smb2_crypto_shash_allocate(struct TCP_Server_Info *server)
> >>>>                                &server->secmech.sdeschmacsha256);
> >>>>  }
> >>>>
> >>>> -int
> >>>> +static int
> >>>>  smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
> >>>>  {
> >>>>         struct cifs_secmech *p = &server->secmech;
> >>>> @@ -98,7 +98,8 @@ smb311_crypto_shash_allocate(struct TCP_Server_Info *server)
> >>>>         return rc;
> >>>>  }
> >>>>
> >>>> -u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
> >>>> +static u8 *
> >>>> +smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
> >>>>  {
> >>>>         int i;
> >>>>         struct cifs_chan *chan;
> >>>> @@ -118,7 +119,7 @@ u8 *smb2_find_chan_signkey(struct cifs_ses *ses, struct TCP_Server_Info *server)
> >>>>         return NULL;
> >>>>  }
> >>>>
> >>>> -struct cifs_ses *
> >>>> +static struct cifs_ses *
> >>>>  smb2_find_global_smb_ses(__u64 ses_id)
> >>>>  {
> >>>>         struct TCP_Server_Info *server;
> >>>> --
> >>>> 2.7.4
> >>>>
> >
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-23  6:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-21  6:22 [PATCH] fs/cifs/smb2transport.c: Make some functions static zhengbin
2019-09-23  5:07 ` Steve French
2019-09-23  6:07   ` zhengbin (A)
2019-09-23  6:33     ` Steve French
2019-09-23  6:47       ` zhengbin (A)
2019-09-23  6:52         ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).