* [PATCH] xfs: use memset to initialize xfs_scrub_agfl_info
@ 2018-02-07 22:23 Eric Sandeen
2018-02-07 23:23 ` Darrick J. Wong
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2018-02-07 22:23 UTC (permalink / raw)
To: linux-xfs
Apparently different gcc versions have competing and
incompatible notions of how to initialize at declaration,
so just give up and fall back to the time-tested memset().
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
index fd97552..05c66e0 100644
--- a/fs/xfs/scrub/agheader.c
+++ b/fs/xfs/scrub/agheader.c
@@ -767,7 +767,7 @@ struct xfs_scrub_agfl_info {
xfs_scrub_agfl(
struct xfs_scrub_context *sc)
{
- struct xfs_scrub_agfl_info sai = { 0 };
+ struct xfs_scrub_agfl_info sai;
struct xfs_agf *agf;
xfs_agnumber_t agno;
unsigned int agflcount;
@@ -795,6 +795,7 @@ struct xfs_scrub_agfl_info {
xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
goto out;
}
+ memset(&sai, 0, sizeof(sai));
sai.sz_entries = agflcount;
sai.entries = kmem_zalloc(sizeof(xfs_agblock_t) * agflcount, KM_NOFS);
if (!sai.entries) {
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] xfs: use memset to initialize xfs_scrub_agfl_info
2018-02-07 22:23 [PATCH] xfs: use memset to initialize xfs_scrub_agfl_info Eric Sandeen
@ 2018-02-07 23:23 ` Darrick J. Wong
0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2018-02-07 23:23 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs
On Wed, Feb 07, 2018 at 04:23:38PM -0600, Eric Sandeen wrote:
> Apparently different gcc versions have competing and
> incompatible notions of how to initialize at declaration,
> so just give up and fall back to the time-tested memset().
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>
> diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c
> index fd97552..05c66e0 100644
> --- a/fs/xfs/scrub/agheader.c
> +++ b/fs/xfs/scrub/agheader.c
> @@ -767,7 +767,7 @@ struct xfs_scrub_agfl_info {
> xfs_scrub_agfl(
> struct xfs_scrub_context *sc)
> {
> - struct xfs_scrub_agfl_info sai = { 0 };
> + struct xfs_scrub_agfl_info sai;
> struct xfs_agf *agf;
> xfs_agnumber_t agno;
> unsigned int agflcount;
> @@ -795,6 +795,7 @@ struct xfs_scrub_agfl_info {
> xfs_scrub_block_set_corrupt(sc, sc->sa.agf_bp);
> goto out;
> }
> + memset(&sai, 0, sizeof(sai));
> sai.sz_entries = agflcount;
> sai.entries = kmem_zalloc(sizeof(xfs_agblock_t) * agflcount, KM_NOFS);
> if (!sai.entries) {
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-07 23:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-07 22:23 [PATCH] xfs: use memset to initialize xfs_scrub_agfl_info Eric Sandeen
2018-02-07 23:23 ` Darrick J. Wong
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).