mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Ankit Agrawal <agrawal.ag.ankit@gmail.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/clocksource/qcom: Add missing iounmap() on error when reading clock frequency.
Date: Thu, 11 Jul 2024 10:11:21 +0200	[thread overview]
Message-ID: <793b70b2-d6c1-4e4b-96a5-8a257837eafb@linaro.org> (raw)
In-Reply-To: <20240711054934.GA37910@bnew-VirtualBox>

On 11.07.2024 7:49 AM, Ankit Agrawal wrote:
> On Wed, Jul 10, 2024 at 01:54:01PM +0200, Konrad Dybcio wrote:
>> On 10.07.2024 1:08 PM, Ankit Agrawal wrote:
>>> Add the missing iounmap() when clock frequency fails to get read by the
>>> of_property_read_u32() call.
>>>
>>> Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@gmail.com>
>>> ---
>>
>> Or even better, you can extract:
>>
>> drivers/platform/x86/intel/pmc/core_ssram.c
>> 32:DEFINE_FREE(pmc_core_iounmap, void __iomem *, iounmap(_T));
>>
>> into a common header, call it something less intel-specific and use
>> it with __free() here
> 
> Can you please give a place where adding it would be appropriate? I am
> new to contributing here, so any guidance on where to add the
> DEFINE_FREE would be really helpful!

I'd say include/linux/io.h sounds alright, but worst case scenario the
maintainer of that file will ask you to move it somewhere else

> Also, just trying to think out loud. Will the cpu0_base pointer (and
> also the source_base pointer) be required once this function exits? If
> so, I think I will also need to use no_free_ptr() to ensure that the
> memory doesn't get iounmap-ed once the function exits.

Ohh right source_base is a global variable.. perhaps the original patch
here makes more sense given we definitely don't wanna unmap that..

So I'd say let's go with this one after all

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

  reply	other threads:[~2024-07-11  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10 11:08 Ankit Agrawal
2024-07-10 11:54 ` Konrad Dybcio
2024-07-11  5:49   ` Ankit Agrawal
2024-07-11  8:11     ` Konrad Dybcio [this message]
2024-07-11  8:13       ` Konrad Dybcio
2024-07-12  8:36         ` Ankit Agrawal

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=793b70b2-d6c1-4e4b-96a5-8a257837eafb@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agrawal.ag.ankit@gmail.com \
    --cc=andersson@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®