From: Alex Elder <elder@linaro.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
mka@chromium.org, evgreen@chromium.org, andersson@kernel.org,
quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com,
quic_jponduru@quicinc.com, quic_subashab@quicinc.com,
elder@kernel.org, netdev@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 9/9] net: ipa: use a bitmap for enabled endpoints
Date: Wed, 2 Nov 2022 07:44:35 -0500 [thread overview]
Message-ID: <0ba56650-e1bf-5a8f-86cd-8406f3dc75be@linaro.org> (raw)
In-Reply-To: <20221101213404.3e4c3b8f@kernel.org>
On 11/1/22 11:34 PM, Jakub Kicinski wrote:
> On Sat, 29 Oct 2022 19:18:28 -0500 Alex Elder wrote:
>> /* Set up the defined endpoint bitmap */
>> ipa->defined = bitmap_zalloc(ipa->endpoint_count, GFP_KERNEL);
>> ipa->set_up = bitmap_zalloc(ipa->endpoint_count, GFP_KERNEL);
>> + ipa->enabled = bitmap_zalloc(ipa->endpoint_count, GFP_KERNEL);
>> if (!ipa->defined || !ipa->set_up) {
>
> This condition should now check if ipa->enabled
You're right.
> And the error handling patch needs to free it, in case it was something
> else that didn't get allocated?
See below, but in any case, I'll make sure this is right.
> Frankly I have gotten mass-NULL-checks wrong more than once myself so
> I'd steer clear of those, they are strangely error prone.
I don't typically do it, and generally don't like it,
but I think I was trying to make it look cleaner
somehow. I'll check every one in separately in v2.
>> dev_err(dev, "unable to allocate endpoint bitmaps\n");
>
> this error message should not be here (patch 5 adds it I think)
> memory allocation failures produce a splat, no need to print errors
At the end of the series, the structure of this
error handling changes, and I think this is
correct. But now that you point this out I
think the way this evolves in the series could
use some improvement so I'll take another look
at it and hopefully make it better.
I don't normally report anything on allocation
failures for that reason; thanks for pointing
this out.
I really appreciate your feedback. I'll send
out version 2 today.
-Alex
>> + bitmap_free(ipa->set_up);
>> + ipa->set_up = NULL;
>> bitmap_free(ipa->defined);
prev parent reply other threads:[~2022-11-02 12:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-30 0:18 [PATCH net-next 0/9] net: ipa: support more endpoints Alex Elder
2022-10-30 0:18 ` [PATCH net-next 1/9] net: ipa: reduce arguments to ipa_table_init_add() Alex Elder
2022-10-30 0:18 ` [PATCH net-next 2/9] net: ipa: use ipa_table_mem() in ipa_table_reset_add() Alex Elder
2022-10-30 0:18 ` [PATCH net-next 3/9] net: ipa: add a parameter to aggregation registers Alex Elder
2022-10-30 0:18 ` [PATCH net-next 4/9] net: ipa: add a parameter to suspend registers Alex Elder
2022-10-30 0:18 ` [PATCH net-next 5/9] net: ipa: use a bitmap for defined endpoints Alex Elder
2022-10-30 0:18 ` [PATCH net-next 6/9] net: ipa: use a bitmap for available endpoints Alex Elder
2022-10-30 0:18 ` [PATCH net-next 7/9] net: ipa: support more filtering endpoints Alex Elder
2022-10-30 0:18 ` [PATCH net-next 8/9] net: ipa: use a bitmap for set-up endpoints Alex Elder
2022-10-30 0:18 ` [PATCH net-next 9/9] net: ipa: use a bitmap for enabled endpoints Alex Elder
2022-11-02 4:34 ` Jakub Kicinski
2022-11-02 12:44 ` Alex Elder [this message]
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=0ba56650-e1bf-5a8f-86cd-8406f3dc75be@linaro.org \
--to=elder@linaro.org \
--cc=andersson@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=elder@kernel.org \
--cc=evgreen@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mka@chromium.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_avuyyuru@quicinc.com \
--cc=quic_cpratapa@quicinc.com \
--cc=quic_jponduru@quicinc.com \
--cc=quic_subashab@quicinc.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox