2010-08-04 03:13:11

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build warning after merge of the scsi tree

Hi James,

After merging the scsi tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:

drivers/scsi/scsi_sysfs.c:384: warning: dereferencing 'void *' pointer

Introduced by commit db5bd1e0b505c54ff492172ce4abc245cf6cd639 ("[SCSI]
convert to the new PM framework"). This build does not have
CONFIG_PM_OPS set.

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (442.00 B)
(No filename) (490.00 B)
Download all attachments

2010-08-04 04:18:12

by James Bottomley

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the scsi tree

cc linux-scsi added

On Wed, 2010-08-04 at 13:13 +1000, Stephen Rothwell wrote:
> Hi James,
>
> After merging the scsi tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> drivers/scsi/scsi_sysfs.c:384: warning: dereferencing 'void *' pointer
>
> Introduced by commit db5bd1e0b505c54ff492172ce4abc245cf6cd639 ("[SCSI]
> convert to the new PM framework"). This build does not have
> CONFIG_PM_OPS set.

So this one looks to be a compiler error. in the none CONFIG_PM_OPS
case, we have

scsi_priv.h:#define scsi_bus_pm_ops (*NULL)

So &scsi_bus_pm_ops should be NULL (not a deref of null).

James

2011-05-18 02:14:15

by Nicholas A. Bellinger

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the scsi tree

On Wed, 2011-05-18 at 11:49 +1000, Stephen Rothwell wrote:
> Hi James,
>
> After merging the scsi tree, today's linux-next build (x86_64 allmodconfig)
> produced this warning:
>
> drivers/target/tcm_fc/tfc_io.c: In function 'ft_queue_data_in':
> drivers/target/tcm_fc/tfc_io.c:209: warning: format '%x' expects type 'unsigned int', but argument 5 has type 'size_t'
>
> Introduced by commit 3699d92a4d7b ("[SCSI] tcm_fc: Adding FC_FC4 provider
> (tcm_fc) for FCoE target (TCM - target core) support").
>

Hi Stephen,

It appears that this warning was fixed in LIO upstream a while back, but
did not make it into this morning scsi-misc merge. Please apply.

Thanks!

--nab


>From b830de5068d0c3745e83393f81d87f745ef7a4f2 Mon Sep 17 00:00:00 2001
From: Nicholas Bellinger <[email protected]>
Date: Thu, 17 Feb 2011 21:56:16 +0000
Subject: [PATCH] tcm_fc: Fix conversion spec compile warning in ft_queue_data_in
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch fixes the following compile warning in ft_queue_data_in():

drivers/target/tcm_fc/tfc_io.c: In function ‘ft_queue_data_in’:
drivers/target/tcm_fc/tfc_io.c:209: warning: format ‘%x’ expects type ‘unsigned int’, but argument 5 has type ‘size_t’

Signed-off-by: Nicholas A. Bellinger <[email protected]>
---
drivers/target/tcm_fc/tfc_io.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
index 4c3c0ef..3936bb1 100644
--- a/drivers/target/tcm_fc/tfc_io.c
+++ b/drivers/target/tcm_fc/tfc_io.c
@@ -206,7 +206,8 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
"xid <0x%x>, remaining <0x%x>, "
"lso_max <0x%x>\n",
__func__, fp, ep->xid,
- remaining, lport->lso_max);
+ (unsigned int)remaining,
+ lport->lso_max);
}
}
return ft_queue_status(se_cmd);
--
1.7.5.1

2011-05-18 03:58:41

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the scsi tree

Hi Nicholas,

On Tue, 17 May 2011 19:06:02 -0700 "Nicholas A. Bellinger" <[email protected]> wrote:
>
> On Wed, 2011-05-18 at 11:49 +1000, Stephen Rothwell wrote:
> >
> > After merging the scsi tree, today's linux-next build (x86_64 allmodconfig)
> > produced this warning:
> >
> > drivers/target/tcm_fc/tfc_io.c: In function 'ft_queue_data_in':
> > drivers/target/tcm_fc/tfc_io.c:209: warning: format '%x' expects type 'unsigned int', but argument 5 has type 'size_t'
> >
> > Introduced by commit 3699d92a4d7b ("[SCSI] tcm_fc: Adding FC_FC4 provider
> > (tcm_fc) for FCoE target (TCM - target core) support").
> >
>
> It appears that this warning was fixed in LIO upstream a while back, but
> did not make it into this morning scsi-misc merge. Please apply.
>
> >From b830de5068d0c3745e83393f81d87f745ef7a4f2 Mon Sep 17 00:00:00 2001
> From: Nicholas Bellinger <[email protected]>
> Date: Thu, 17 Feb 2011 21:56:16 +0000
> Subject: [PATCH] tcm_fc: Fix conversion spec compile warning in ft_queue_data_in
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> This patch fixes the following compile warning in ft_queue_data_in():
>
> drivers/target/tcm_fc/tfc_io.c: In function ‘ft_queue_data_in’:
> drivers/target/tcm_fc/tfc_io.c:209: warning: format ‘%x’ expects type ‘unsigned int’, but argument 5 has type ‘size_t’
>
> Signed-off-by: Nicholas A. Bellinger <[email protected]>
> ---
> drivers/target/tcm_fc/tfc_io.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
> index 4c3c0ef..3936bb1 100644
> --- a/drivers/target/tcm_fc/tfc_io.c
> +++ b/drivers/target/tcm_fc/tfc_io.c
> @@ -206,7 +206,8 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
> "xid <0x%x>, remaining <0x%x>, "
> "lso_max <0x%x>\n",
> __func__, fp, ep->xid,
> - remaining, lport->lso_max);
> + (unsigned int)remaining,
> + lport->lso_max);

Given that "remaining" really is a length, surely it makes more sense to
print it with %zd than to cast it and print it with %x ...

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (2.44 kB)
(No filename) (490.00 B)
Download all attachments

2011-05-19 03:03:03

by Nicholas A. Bellinger

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the scsi tree

On Wed, 2011-05-18 at 13:58 +1000, Stephen Rothwell wrote:
> Hi Nicholas,
>
> On Tue, 17 May 2011 19:06:02 -0700 "Nicholas A. Bellinger" <[email protected]> wrote:
> >
> > On Wed, 2011-05-18 at 11:49 +1000, Stephen Rothwell wrote:
> > >
> > > After merging the scsi tree, today's linux-next build (x86_64 allmodconfig)
> > > produced this warning:
> > >
> > > drivers/target/tcm_fc/tfc_io.c: In function 'ft_queue_data_in':
> > > drivers/target/tcm_fc/tfc_io.c:209: warning: format '%x' expects type 'unsigned int', but argument 5 has type 'size_t'
> > >
> > > Introduced by commit 3699d92a4d7b ("[SCSI] tcm_fc: Adding FC_FC4 provider
> > > (tcm_fc) for FCoE target (TCM - target core) support").
> > >
> >
> > It appears that this warning was fixed in LIO upstream a while back, but
> > did not make it into this morning scsi-misc merge. Please apply.
> >
> > >From b830de5068d0c3745e83393f81d87f745ef7a4f2 Mon Sep 17 00:00:00 2001
> > From: Nicholas Bellinger <[email protected]>
> > Date: Thu, 17 Feb 2011 21:56:16 +0000
> > Subject: [PATCH] tcm_fc: Fix conversion spec compile warning in ft_queue_data_in
> > MIME-Version: 1.0
> > Content-Type: text/plain; charset=UTF-8
> > Content-Transfer-Encoding: 8bit
> >
> > This patch fixes the following compile warning in ft_queue_data_in():
> >
> > drivers/target/tcm_fc/tfc_io.c: In function ‘ft_queue_data_in’:
> > drivers/target/tcm_fc/tfc_io.c:209: warning: format ‘%x’ expects type ‘unsigned int’, but argument 5 has type ‘size_t’
> >
> > Signed-off-by: Nicholas A. Bellinger <[email protected]>
> > ---
> > drivers/target/tcm_fc/tfc_io.c | 3 ++-
> > 1 files changed, 2 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
> > index 4c3c0ef..3936bb1 100644
> > --- a/drivers/target/tcm_fc/tfc_io.c
> > +++ b/drivers/target/tcm_fc/tfc_io.c
> > @@ -206,7 +206,8 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
> > "xid <0x%x>, remaining <0x%x>, "
> > "lso_max <0x%x>\n",
> > __func__, fp, ep->xid,
> > - remaining, lport->lso_max);
> > + (unsigned int)remaining,
> > + lport->lso_max);
>
> Given that "remaining" really is a length, surely it makes more sense to
> print it with %zd than to cast it and print it with %x ...
>

This is fine with me. Bad habit of explictly casting conversion
specifications from sector_t type usage..

Kiran, would you mind fixing this to use %zd in your tree, and include
this along with the TMR LUN_RESET bugfix for James to include in
scsi-misc..?

Thanks,

--nab

2011-05-19 16:18:26

by Patil, Kiran

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the scsi tree

Hi All,

Sorry, I should have fixed that issue. Anyways, I will fix it and send
patch out.


On 5/18/2011 7:54 PM, Nicholas A. Bellinger wrote:
> On Wed, 2011-05-18 at 13:58 +1000, Stephen Rothwell wrote:
>> Hi Nicholas,
>>
>> On Tue, 17 May 2011 19:06:02 -0700 "Nicholas A. Bellinger"<[email protected]> wrote:
>>> On Wed, 2011-05-18 at 11:49 +1000, Stephen Rothwell wrote:
>>>> After merging the scsi tree, today's linux-next build (x86_64 allmodconfig)
>>>> produced this warning:
>>>>
>>>> drivers/target/tcm_fc/tfc_io.c: In function 'ft_queue_data_in':
>>>> drivers/target/tcm_fc/tfc_io.c:209: warning: format '%x' expects type 'unsigned int', but argument 5 has type 'size_t'
>>>>
>>>> Introduced by commit 3699d92a4d7b ("[SCSI] tcm_fc: Adding FC_FC4 provider
>>>> (tcm_fc) for FCoE target (TCM - target core) support").
>>>>
>>> It appears that this warning was fixed in LIO upstream a while back, but
>>> did not make it into this morning scsi-misc merge. Please apply.
>>>
>>> > From b830de5068d0c3745e83393f81d87f745ef7a4f2 Mon Sep 17 00:00:00 2001
>>> From: Nicholas Bellinger<[email protected]>
>>> Date: Thu, 17 Feb 2011 21:56:16 +0000
>>> Subject: [PATCH] tcm_fc: Fix conversion spec compile warning in ft_queue_data_in
>>> MIME-Version: 1.0
>>> Content-Type: text/plain; charset=UTF-8
>>> Content-Transfer-Encoding: 8bit
>>>
>>> This patch fixes the following compile warning in ft_queue_data_in():
>>>
>>> drivers/target/tcm_fc/tfc_io.c: In function ‘ft_queue_data_in’:
>>> drivers/target/tcm_fc/tfc_io.c:209: warning: format ‘%x’ expects type ‘unsigned int’, but argument 5 has type ‘size_t’
>>>
>>> Signed-off-by: Nicholas A. Bellinger<[email protected]>
>>> ---
>>> drivers/target/tcm_fc/tfc_io.c | 3 ++-
>>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
>>> index 4c3c0ef..3936bb1 100644
>>> --- a/drivers/target/tcm_fc/tfc_io.c
>>> +++ b/drivers/target/tcm_fc/tfc_io.c
>>> @@ -206,7 +206,8 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
>>> "xid<0x%x>, remaining<0x%x>, "
>>> "lso_max<0x%x>\n",
>>> __func__, fp, ep->xid,
>>> - remaining, lport->lso_max);
>>> + (unsigned int)remaining,
>>> + lport->lso_max);
>> Given that "remaining" really is a length, surely it makes more sense to
>> print it with %zd than to cast it and print it with %x ...
>>
> This is fine with me. Bad habit of explictly casting conversion
> specifications from sector_t type usage..
>
> Kiran, would you mind fixing this to use %zd in your tree, and include
> this along with the TMR LUN_RESET bugfix for James to include in
> scsi-misc..?
>
> Thanks,
>
> --nab
>
No problem. I will fix it and get it out along with my other patch
series for offload, big fixes, etc.. via. Open-FCoE which has been
rebased to scsi-misc yesterday (scsi-misc now has tcm_fc)

Thanks,
-- Kiran P.

2011-05-19 16:23:03

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the scsi tree

On Wed, May 18, 2011 at 05:58, Stephen Rothwell <[email protected]> wrote:
>> --- a/drivers/target/tcm_fc/tfc_io.c
>> +++ b/drivers/target/tcm_fc/tfc_io.c
>> @@ -206,7 +206,8 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
>>                                                 "xid <0x%x>, remaining <0x%x>, "
>>                                                 "lso_max <0x%x>\n",
>>                                                 __func__, fp, ep->xid,
>> -                                               remaining, lport->lso_max);
>> +                                               (unsigned int)remaining,
>> +                                               lport->lso_max);
>
> Given that "remaining" really is a length, surely it makes more sense to

Exactly my comments ...

> print it with %zd than to cast it and print it with %x ...

... except that size_t is unsigned, so %zu would be a little bit better.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2011-06-23 17:03:08

by Randy Dunlap

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the scsi tree

On Thu, 19 May 2011 18:22:59 +0200 Geert Uytterhoeven wrote:

> On Wed, May 18, 2011 at 05:58, Stephen Rothwell <[email protected]> wrote:
> >> --- a/drivers/target/tcm_fc/tfc_io.c
> >> +++ b/drivers/target/tcm_fc/tfc_io.c
> >> @@ -206,7 +206,8 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "xid <0x%x>, remaining <0x%x>, "
> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "lso_max <0x%x>\n",
> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? __func__, fp, ep->xid,
> >> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? remaining, lport->lso_max);
> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (unsigned int)remaining,
> >> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? lport->lso_max);
> >
> > Given that "remaining" really is a length, surely it makes more sense to
>
> Exactly my comments ...
>
> > print it with %zd than to cast it and print it with %x ...
>
> ... except that size_t is unsigned, so %zu would be a little bit better.


This still needs to be fixed in linux-next (20110623).

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***