* Kernel contribution
[not found] <CAPBgb4kMvA1TEW79o5XnVmv80viKumG4-01NCGk2LKq3uB4S3w@mail.gmail.com>
@ 2024-11-12 19:27 ` Ragavendra
0 siblings, 0 replies; only message in thread
From: Ragavendra @ 2024-11-12 19:27 UTC (permalink / raw)
To: kernelnewbies
[-- Attachment #1.1: Type: text/plain, Size: 2365 bytes --]
hi all,
My name is Ragavendra and I have about fifteen years of work experience in
the IT industry mostly in web development. However I did diploma in
embedded systems in CDAC in 2005 and have been using Linux since then. I
submitted my first patch in 2015 and am planning to contribute again now
for a while.
I went over the emails in the mailing list for the last few weeks or months
to see how I can contribute. As a result, I signed up in Coverity and found
one issue I thought I can help is say with the `1585136 Uninitialized
scalar variable`.
////
diff --git a/drivers/clk/sophgo/clk-cv18xx-pll.c
b/drivers/clk/sophgo/clk-cv18xx-pll.c
index 29e24098bf5f..a39a14fc39c2 100644
--- a/drivers/clk/sophgo/clk-cv18xx-pll.c
+++ b/drivers/clk/sophgo/clk-cv18xx-pll.c
@@ -327,7 +327,8 @@ static int fpll_find_rate(struct cv1800_clk_pll *pll,
static int fpll_determine_rate(struct clk_hw *hw, struct clk_rate_request
*req)
{
struct cv1800_clk_pll *pll = hw_to_cv1800_clk_pll(hw);
- u32 val, ssc_syn_set;
+ u32 val = 0;
+ u32 ssc_syn_set = 0;
if (!fpll_is_factional_mode(pll))
return ipll_determine_rate(hw, req);
fpll_find_rate(pll, &pll->pll_limit[2], req->best_parent_rate,
&req->rate, &val, &ssc_syn_set);
////
Here, I am assuming that the default value for u32 is 0, if not please let
me know what it should be or how it is determined.
I know if it is of type pointer, its value should be NULL.
Another example I saw was like below, where the enum was initialized which
I am assuming to be is based on context.
////
diff --git a/drivers/cpufreq/amd-pstate-ut.c
b/drivers/cpufreq/amd-pstate-ut.c
index 24432bd78a5a39..d52f26d1ffbab1 100644
--- a/drivers/cpufreq/amd-pstate-ut.c
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/cpufreq/amd-pstate-ut.c?id=3e39e68dfbb6d4fe8c1943003d2f2a6f3255c902>
+++ b/drivers/cpufreq/amd-pstate-ut.c
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/cpufreq/amd-pstate-ut.c?id=93497752dfed196b41d2804503e80b9a04318adb>
@@ -267,7 +267,7 @@ static int amd_pstate_set_mode(enum amd_pstate_mode
mode)
static void amd_pstate_ut_check_driver(u32 index)
{
- enum amd_pstate_mode mode1, mode2;
+ enum amd_pstate_mode mode1, mode2 = AMD_PSTATE_DISABLE;
int ret;
////
--
Thanks & regards,
Ragavendra BN
[-- Attachment #1.2: Type: text/html, Size: 3328 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-12 19:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAPBgb4kMvA1TEW79o5XnVmv80viKumG4-01NCGk2LKq3uB4S3w@mail.gmail.com>
2024-11-12 19:27 ` Kernel contribution Ragavendra
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).