summaryrefslogtreecommitdiff
path: root/Documentation/power/opp.rst
AgeCommit message (Collapse)AuthorFilesLines
2024-01-23Documentation: power: Use kcalloc() instead of kzalloc()Erick Archer1-1/+1
As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrapping around and a smaller allocation being made than the caller was expecting. Using those allocations could lead to linear overflows of heap memory and other misbehaviors. So, in the example code use the purpose specific kcalloc() function instead of the argument size * count in the kzalloc() function. At the same time, modify the translations accordingly. Signed-off-by: Erick Archer <erick.archer@gmx.com> Reviewed-by: Hu Haowen <2023002089@link.tyut.edu.cn> Reviewed-by: Yanteng Si <siyanteng@loongson.cn> Reviewed-by: Hu Haowen <2023002089@link.tyut.edu.cn> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2021-12-27Documentation: power: Update outdated contents in opp.rstTang Yizhou1-7/+7
Three problems have been revised: 1. CONFIG_PM_OPP no longer depends on CONFIG_PM. 2. opp_find_freq_{ceil, floor} is renamed as dev_pm_opp_find_freq_{ceil, floor}. 3. Make it clear that the 'opp' struct is actually dev_pm_opp. Signed-off-by: Tang Yizhou <tangyizhou@huawei.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2019-11-20PM: Wrap documentation to fit in 80 columnsBjorn Helgaas1-15/+17
Wrap to 80 columns. No textual change except to correct some "it's" that should be "its". Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2019-07-26PM / OPP: Correct Documentation about library locationYue Hu1-1/+1
OPP library is now located in drivers/opp/ directory. Signed-off-by: Yue Hu <huyue2@yulong.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2019-06-15docs: power: convert docs to ReST and rename to *.rstMauro Carvalho Chehab1-0/+379
Convert the PM documents to ReST, in order to allow them to build with Sphinx. The conversion is actually: - add blank lines and indentation in order to identify paragraphs; - fix tables markups; - add some lists markups; - mark literal blocks; - adjust title markups. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>