From: Oded Gabbay <oded.gabbay@gmail.com>
To: David Laight <David.Laight@aculab.com>
Cc: Oded Gabbay <ogabbay@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Koby Elbaz <kelbaz@habana.ai>
Subject: Re: [PATCH 2/9] habanalabs: zero complex structures using memset
Date: Tue, 15 Jun 2021 11:31:24 +0300 [thread overview]
Message-ID: <CAFCwf10WzmED-c3ofsXxx309prcpo-wma_i+hcOdG3Ckg_a8DQ@mail.gmail.com> (raw)
In-Reply-To: <0ad1aa7cc1504b759f997028c80a6bd6@AcuMS.aculab.com>
On Tue, Jun 15, 2021 at 11:27 AM David Laight <David.Laight@aculab.com> wrote:
>
> From: Oded Gabbay
> > Sent: 14 June 2021 13:51
> >
> > From: Koby Elbaz <kelbaz@habana.ai>
> >
> > fix the following sparse warnings:
> > 'warning: Using plain integer as NULL pointer'
> > 'warning: missing braces around initializer'
>
> Sparse is being over-enthusiastic.
>
> ...
> > diff --git a/drivers/misc/habanalabs/common/firmware_if.c
> > b/drivers/misc/habanalabs/common/firmware_if.c
> > index 14e70422af25..d5d0db7fd6ef 100644
> > --- a/drivers/misc/habanalabs/common/firmware_if.c
> > +++ b/drivers/misc/habanalabs/common/firmware_if.c
> > @@ -392,10 +392,11 @@ void hl_fw_cpu_accessible_dma_pool_free(struct hl_device *hdev, size_t size,
> >
> > int hl_fw_send_heartbeat(struct hl_device *hdev)
> > {
> > - struct cpucp_packet hb_pkt = {0};
> > + struct cpucp_packet hb_pkt;
>
> Try just deleting the 0?
> I think modern compilers allow {}.
The problem is we sometimes run on less-than-modern compilers...
So I prefer this method (memset). No harm is done here in any case.
Oded
>
> David
>
> > u64 result;
> > int rc;
> >
> > + memset(&hb_pkt, 0, sizeof(hb_pkt));
> > hb_pkt.ctl = cpu_to_le32(CPUCP_PACKET_TEST <<
> > CPUCP_PKT_CTL_OPCODE_SHIFT);
> > hb_pkt.value = cpu_to_le64(CPUCP_PACKET_FENCE_VAL);
> > --
> > 2.25.1
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
next prev parent reply other threads:[~2021-06-15 8:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-14 12:50 [PATCH 1/9] habanalabs: print more info when failing to pin user memory Oded Gabbay
2021-06-14 12:50 ` [PATCH 2/9] habanalabs: zero complex structures using memset Oded Gabbay
2021-06-15 8:27 ` David Laight
2021-06-15 8:31 ` Oded Gabbay [this message]
2021-06-14 12:50 ` [PATCH 3/9] habanalabs: set rc as 'valid' in case of intentional func exit Oded Gabbay
2021-06-14 12:50 ` [PATCH 4/9] habanalabs: remove node from list before freeing the node Oded Gabbay
2021-06-14 12:50 ` [PATCH 5/9] habanalabs/gaudi: update coresight configuration Oded Gabbay
2021-06-14 12:50 ` [PATCH 6/9] habanalabs/gaudi: set the correct rc in case of err Oded Gabbay
2021-06-14 12:50 ` [PATCH 7/9] habanalabs: added open_stats info ioctl Oded Gabbay
2021-06-14 12:50 ` [PATCH 8/9] habanalabs/goya: add '__force' attribute to suppress false alarm Oded Gabbay
2021-06-14 12:51 ` [PATCH 9/9] habanalabs/gaudi: print last QM PQEs on error Oded Gabbay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFCwf10WzmED-c3ofsXxx309prcpo-wma_i+hcOdG3Ckg_a8DQ@mail.gmail.com \
--to=oded.gabbay@gmail.com \
--cc=David.Laight@aculab.com \
--cc=kelbaz@habana.ai \
--cc=linux-kernel@vger.kernel.org \
--cc=ogabbay@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.