* [PATCH] scsi: Resolve some missing-field-initializers warnings
@ 2014-10-14 13:38 Jeff Kirsher
2014-10-17 13:26 ` Christoph Hellwig
2014-10-23 17:12 ` Christoph Hellwig
0 siblings, 2 replies; 5+ messages in thread
From: Jeff Kirsher @ 2014-10-14 13:38 UTC (permalink / raw)
To: JBottomley; +Cc: Mark Rustad, linux-kernel, linux-scsi, Jeff Kirsher
From: Mark Rustad <mark.d.rustad@intel.com>
Resolve some missing-field-initializers warnings by using
designated initialization.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/scsi/scsi_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index db8c449..4d59256 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -47,7 +47,7 @@ struct scsi_host_sg_pool {
mempool_t *pool;
};
-#define SP(x) { x, "sgpool-" __stringify(x) }
+#define SP(x) { .size = x, "sgpool-" __stringify(x) }
#if (SCSI_MAX_SG_SEGMENTS < 32)
#error SCSI_MAX_SG_SEGMENTS is too small (must be 32 or greater)
#endif
--
1.9.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: Resolve some missing-field-initializers warnings
2014-10-14 13:38 [PATCH] scsi: Resolve some missing-field-initializers warnings Jeff Kirsher
@ 2014-10-17 13:26 ` Christoph Hellwig
2014-10-17 22:44 ` Rustad, Mark D
2014-10-23 17:12 ` Christoph Hellwig
1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2014-10-17 13:26 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: JBottomley, Mark Rustad, linux-kernel, linux-scsi
On Tue, Oct 14, 2014 at 06:38:53AM -0700, Jeff Kirsher wrote:
> From: Mark Rustad <mark.d.rustad@intel.com>
>
> Resolve some missing-field-initializers warnings by using
> designated initialization.
What tool is warning about these? This construct is perfectly valid C.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: Resolve some missing-field-initializers warnings
2014-10-17 13:26 ` Christoph Hellwig
@ 2014-10-17 22:44 ` Rustad, Mark D
2014-10-18 15:15 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Rustad, Mark D @ 2014-10-17 22:44 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Kirsher, Jeffrey T, JBottomley, linux-kernel, linux-scsi
The warning appears in W=2 builds. I had another way to silence it by using diagnostic control macros, but those macros were not accepted. Using a single designated initialization also silences it.
Sent from my iPhone
> On Oct 17, 2014, at 8:26 AM, "Christoph Hellwig" <hch@infradead.org> wrote:
>
>> On Tue, Oct 14, 2014 at 06:38:53AM -0700, Jeff Kirsher wrote:
>> From: Mark Rustad <mark.d.rustad@intel.com>
>>
>> Resolve some missing-field-initializers warnings by using
>> designated initialization.
>
> What tool is warning about these? This construct is perfectly valid C.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: Resolve some missing-field-initializers warnings
2014-10-17 22:44 ` Rustad, Mark D
@ 2014-10-18 15:15 ` Christoph Hellwig
0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2014-10-18 15:15 UTC (permalink / raw)
To: Rustad, Mark D; +Cc: Kirsher, Jeffrey T, JBottomley, linux-kernel, linux-scsi
On Fri, Oct 17, 2014 at 10:44:36PM +0000, Rustad, Mark D wrote:
> The warning appears in W=2 builds. I had another way to silence it by using diagnostic control macros, but those macros were not accepted. Using a single designated initialization also silences it.
Oh well. I think the earlier version was slightly cleaner, but if it
helps people to catch real bugs better I'm happy to apply it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: Resolve some missing-field-initializers warnings
2014-10-14 13:38 [PATCH] scsi: Resolve some missing-field-initializers warnings Jeff Kirsher
2014-10-17 13:26 ` Christoph Hellwig
@ 2014-10-23 17:12 ` Christoph Hellwig
1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2014-10-23 17:12 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: JBottomley, Mark Rustad, linux-kernel, linux-scsi
Thanks,
applied to the core-for-3.19 branch.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-10-23 17:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-14 13:38 [PATCH] scsi: Resolve some missing-field-initializers warnings Jeff Kirsher
2014-10-17 13:26 ` Christoph Hellwig
2014-10-17 22:44 ` Rustad, Mark D
2014-10-18 15:15 ` Christoph Hellwig
2014-10-23 17:12 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®