Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks

2023-03-03 Thread Deepak R Varma
On Thu, Mar 02, 2023 at 11:37:30AM -0500, Harry Wentland wrote: > > > On 3/1/23 15:21, Deepak R Varma wrote: > > On Mon, Jan 23, 2023 at 12:23:19AM +0530, Deepak R Varma wrote: > >> On Sun, Jan 15, 2023 at 12:52:10PM -0800, Joe Perches wrote: > >>> On Sun,

Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks

2023-03-01 Thread Deepak R Varma
On Mon, Jan 23, 2023 at 12:23:19AM +0530, Deepak R Varma wrote: > On Sun, Jan 15, 2023 at 12:52:10PM -0800, Joe Perches wrote: > > On Sun, 2023-01-15 at 15:30 +0530, Deepak R Varma wrote: > > > The if / else block code has same effect irrespective of the logical > > >

Re: [PATCH] drm/amd/display: Remove duplicate/repeating expression

2023-02-10 Thread Deepak R Varma
On Fri, Feb 10, 2023 at 10:22:00AM -0500, Harry Wentland wrote: > On 2/10/23 05:11, Deepak R Varma wrote: > > Remove duplicate or repeating expressions in the if condition > > evaluation. Issue identified using doubletest.cocci Coccinelle semantic > > patch. > > > &

[PATCH] drm/amd/display: Remove duplicate/repeating expression

2023-02-10 Thread Deepak R Varma
Remove duplicate or repeating expressions in the if condition evaluation. Issue identified using doubletest.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- .../gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] drm/amd/display: Remove duplicate/repeating expressions

2023-02-10 Thread Deepak R Varma
Remove duplicate or repeating expressions in the if condition evaluation. Issue identified using doubletest.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- .../gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c| 4 +--- 1 file changed, 1 insertion(+), 3 deletions

Re: [PATCH 0/4] drm/amd/display: Use min()/max() helper macros

2023-01-22 Thread Deepak R Varma
On Sun, Jan 15, 2023 at 02:48:45AM +0530, Deepak R Varma wrote: > This patch series proposes using standard min() / max() helper macros instead > of > direct variable comparison using the ternary operator or if/else evaluations. > I > have tested the change using a dummy mod

Re: [PATCH] drm/amd/display: Simplify same effect if/else blocks

2023-01-22 Thread Deepak R Varma
On Sun, Jan 15, 2023 at 12:52:10PM -0800, Joe Perches wrote: > On Sun, 2023-01-15 at 15:30 +0530, Deepak R Varma wrote: > > The if / else block code has same effect irrespective of the logical > > evaluation. Hence, simply the implementation by removing the unnecessary > > c

[PATCH 2/4] drm/amd/display: dcn20: Use min()/max() helper macros

2023-01-15 Thread Deepak R Varma
Use the standard min() / max() helper macros instead of direct variable comparison using if/else blocks or ternary operator. Change identified using minmax.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- .../gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c | 5

[PATCH 1/3] drm/amd/pm/powerplay/smumgr: use bitwise or for addition

2023-01-15 Thread Deepak R Varma
For bit mask addition, it is recommended to use or operator "|" instead of numerical addition as the former is quicker and cleaner. Change suggested by orplus.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_sm

[PATCH 0/4] drm/amd/display: Use min()/max() helper macros

2023-01-15 Thread Deepak R Varma
This patch series proposes using standard min() / max() helper macros instead of direct variable comparison using the ternary operator or if/else evaluations. I have tested the change using a dummy module and similar simulations on my x86 machine. Deepak R Varma (4): drm/amd/display: Use min

[PATCH 2/3] drm/amd/pm/powerplay/hwmgr: use bitwise or for bitmasks addition

2023-01-15 Thread Deepak R Varma
For bit mask addition, it is recommended to use or operator "|" instead of numerical addition as the former is quicker and cleaner. Change suggested by orplus.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 8 +

[PATCH 3/4] drm/amd/display: dcn21: Use min()/max() helper macros

2023-01-15 Thread Deepak R Varma
Use the standard min() / max() helper macros instead of direct variable comparison using if/else blocks or ternary operator. Change identified using minmax.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- .../gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c | 5

[PATCH 4/4] drm/amd/display: dcn32: Use min()/max() helper macros

2023-01-15 Thread Deepak R Varma
Use the standard min() / max() helper macros instead of direct variable comparison using if/else blocks or ternary operator. Change identified using minmax.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 4 ++-- 1 file

[PATCH] drm/amd/display: avoid variable reinitialization

2023-01-15 Thread Deepak R Varma
The member variable set_odm_combine is already initialized and hence the reinitialization instruction can be removed. Issue identified using the dubleinit.cocci Coccinelle semantic patch script. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_optc.c | 1 - 1 file

[PATCH 3/3] drm/amd/pm/powerplay/smumgr/ci: use bitwise or for bitmasks addition

2023-01-15 Thread Deepak R Varma
For bit mask addition, it is recommended to use or operator "|" instead of numerical addition as the former is quicker and cleaner. Change suggested by orplus.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/pm/powerplay/smumgr/ci_smumgr.c | 2

[PATCH 1/4] drm/amd/display: Use min()/max() macros in dcn_calc_math

2023-01-15 Thread Deepak R Varma
Use the standard min() / max() helper macros instead of direct variable comparison using if/else blocks or ternary operator. Change identified using minmax.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- .../gpu/drm/amd/display/dc/dml/calcs/dcn_calc_math.c | 10

[PATCH] drm/amd/display: use swap() helper macro in bios_parser

2023-01-15 Thread Deepak R Varma
Use swap() helper macro instead of open coded swap instructions. The change also facilitates code cleanup and realignment for improved readability. Issue identified using swap.cocci Coccinelle semantic patch script. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/display/dc/bios

[PATCH] drm/amd/display: Simplify same effect if/else blocks

2023-01-15 Thread Deepak R Varma
script. Signed-off-by: Deepak R Varma --- Please note: The proposed change is compile tested only. If there are any inbuilt test cases that I should run for further verification, I will appreciate guidance about it. Thank you. drivers/gpu/drm/amd/display/dc/core/dc.c | 11 +++ 1 file

[PATCH 0/3] drm/amd/pm/powerplay: use bitwise or for bitmasks addition

2023-01-15 Thread Deepak R Varma
The patch series proposes usage of bitwise or "|" operator for addition of bitmasks instead of using numerial additions. The former is quicker and cleaner. The proposed change is compile tested. Deepak R Varma (3): drm/amd/pm/powerplay/smumgr: use bitwise or for addition drm/amd/pm

[PATCH] drm/amd/display: Conversion to bool not necessary

2023-01-12 Thread Deepak R Varma
m/amd/display: Create a file dedicated for CRTC") Reported-by: kernel test robot Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm

Re: [PATCH] drm/amd/display: No need for Null pointer check before kfree

2023-01-09 Thread Deepak R Varma
On Wed, Dec 28, 2022 at 12:09:51AM +0530, Deepak R Varma wrote: > kfree() & vfree() internally performs NULL check on the pointer handed > to it and take no action if it indeed is NULL. Hence there is no need > for a pre-check of the memory pointer before handing it to > kfree()/vf

Re: [PATCH] drm/amdkfd: replace idr_init() by idr_init_base()

2020-11-05 Thread Deepak R Varma
On Wed, Nov 04, 2020 at 03:01:17PM -0500, Felix Kuehling wrote: > On 2020-11-04 10:13 a.m., Deepak R Varma wrote: > > idr_init() uses base 0 which is an invalid identifier. The new function > > idr_init_base allows IDR to set the ID lookup from base 1. This avoids > > all l

[PATCH] drm/amdgpu: replace idr_init() by idr_init_base()

2020-11-04 Thread Deepak R Varma
Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/

[PATCH] drm/amdkfd: replace idr_init() by idr_init_base()

2020-11-04 Thread Deepak R Varma
Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c index ba2c2ce0c55a..b3

[PATCH 5/6] drm/amdgpu/amdgpu: use "*" adjacent to data name

2020-11-02 Thread Deepak R Varma
should be "foo *bar" ERROR: "foo*bar" should be "foo *bar" ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ato

[PATCH 4/6] drm/amdgpu/sdma: use "*" adjacent to data name

2020-11-02 Thread Deepak R Varma
should be "foo *bar" ERROR: "foo*bar" should be "foo *bar" ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 6

[PATCH 1/6] drm/amdgpu/vcn: use "*" adjacent to data name

2020-11-02 Thread Deepak R Varma
quot; should be "foo *bar" ERROR: "foo*bar" should be "foo *bar" ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c

[PATCH 6/6] drm/amdgpu: use "*" adjacent to data name

2020-11-02 Thread Deepak R Varma
should be "foo *bar" ERROR: "foo*bar" should be "foo *bar" ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/atom.c | 16 drivers/gpu/drm/amd/amdgpu/at

[PATCH 3/6] drm/amdgpu/jpeg: use "*" adjacent to data name

2020-11-02 Thread Deepak R Varma
should be "foo *bar" ERROR: "foo*bar" should be "foo *bar" ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c

[PATCH 2/6] drm/amdgpu/umc: use "*" adjacent to data name

2020-11-02 Thread Deepak R Varma
should be "foo *bar" ERROR: "foo*bar" should be "foo *bar" ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/umc_v6_1.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/umc_v8_7.c | 4 ++--

[PATCH] drm/amdgpu: do not initialise global variables to 0 or NULL

2020-11-02 Thread Deepak R Varma
Initializing global variable to 0 or NULL is not necessary and should be avoided. Issue reported by checkpatch script as: ERROR: do not initialise globals to 0 (or NULL). Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 46 - drivers/gpu/drm

[PATCH 1/6] drm/amdgpu/dce: improve code indentation and alignment

2020-11-02 Thread Deepak R Varma
General code indentation and alignment changes such as replace spaces by tabs or align function arguments as per the coding style guidelines. Issue reported by checkpatch script. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu

[PATCH 6/6] drm/amdgpu: improve code indentation and alignment

2020-11-02 Thread Deepak R Varma
General code indentation and alignment changes such as replace spaces by tabs or align function arguments as per the coding style guidelines. The patch covers various .c files for this driver. Issue reported by checkpatch script. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu

[PATCH 5/6] drm/amdgpu/amdgpu: improve code indentation and alignment

2020-11-02 Thread Deepak R Varma
General code indentation and alignment changes such as replace spaces by tabs or align function arguments as per the coding style guidelines. The patch corrects issues for various amdgpu_*.c files for this driver. Issue reported by checkpatch script. Signed-off-by: Deepak R Varma --- drivers

[PATCH 3/6] drm/amdgpu/vcn: improve code indentation and alignment

2020-11-02 Thread Deepak R Varma
General code indentation and alignment changes such as replace spaces by tabs or align function arguments as per the coding style guidelines. Issue reported by checkpatch script. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5

[PATCH 4/6] drm/amdgpu/nbio: improve code indentation and alignment

2020-11-02 Thread Deepak R Varma
General code indentation and alignment changes such as replace spaces by tabs or align function arguments as per the coding style guidelines. Issue reported by checkpatch script. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c | 4 ++-- drivers/gpu/drm/amd/amdgpu

[PATCH 2/6] drm/amdgpu/gfx: improve code indentation and alignment

2020-11-02 Thread Deepak R Varma
General code indentation and alignment changes such as replace spaces by tabs or align function arguments as per the coding style guidelines. Issue reported by checkpatch script. Signed-off-by: Deepak R Varma --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 10 +- drivers/gpu/drm/amd/amdgpu

Re: [Outreachy kernel] [PATCH] drm/amdgpu: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()

2020-10-30 Thread Deepak R Varma
; Am 30.10.20 um 08:57 schrieb Deepak R Varma: > > > > > On Fri, Oct 30, 2020 at 08:11:20AM +0100, Greg KH wrote: > > > > > > On Fri, Oct 30, 2020 at 08:52:45AM +0530, Deepak R Varma wrote: > > > > > > > Using DEFINE_DEBUGFS_ATTRIBUTE macro wit

Re: [Outreachy kernel] [PATCH] drm/amdgpu: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()

2020-10-30 Thread Deepak R Varma
On Fri, Oct 30, 2020 at 08:11:20AM +0100, Greg KH wrote: > On Fri, Oct 30, 2020 at 08:52:45AM +0530, Deepak R Varma wrote: > > Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe() > > function in place of the debugfs_create_file() function will make the > >

[PATCH] drm/amdgpu: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()

2020-10-29 Thread Deepak R Varma
Issue reported by Coccinelle script: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci Signed-off-by: Deepak R Varma --- Please Note: This is a Outreachy project task patch. drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 20 ++-- 1 file changed, 10 insertions(+), 10 del

[PATCH] drm/amd/pm: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()

2020-10-29 Thread Deepak R Varma
Issue reported by Coccinelle script: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci Signed-off-by: Deepak R Varma --- Please Note: This is a Outreachy project task patch. .../gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c | 5 ++--- 1 file changed, 2 insertions(+), 3 del

[PATCH v2] drm/amd/pm: replace kmalloc+memcpy by kmemdup

2020-10-29 Thread Deepak R Varma
Use kmemdup() for instructions using kmalloc() + memcpy(). More information here: https://lwn.net/Articles/198928/ Issue reported by coccinelle script: scripts/coccinelle/api/memdup.cocci Signed-off-by: Deepak R Varma --- Changes since v1: - Update patch subject and log message to match