Re: [PATCH v2] drm/amd/pm/powerplay/smumgr/fiji_smumgr: Add error check in fiji_populate_smc_boot_level()

2025-04-15 Thread Markus Elfring
> The return value of fiji_populate_smc_boot_level() is needs to be checked. should? > An error handling is also needed to phm_find_boot_level() to reset the > boot level when the function fails. A proper implementation can be found > in tonga

Re: [PATCH v2 RESEND] drm/msm/dpu: reorder pointer operations after sanity checks to avoid NULL deref

2025-04-05 Thread Markus Elfring
… > Fix this by reordering the dereference after the sanity checks. Can my previous patch review contribution trigger more desirable collateral evolution also for this development topic? https://lore.kernel.org/all/6f01f71b-284b-4841-bda9-a3934cb4e...@web.de/ https://lkml.org/lkml/2025/3/10/696

Re: [PATCH] backlight: qcom-wled: Add NULL check in the wled_configure

2025-04-05 Thread Markus Elfring
> When devm_kasprintf() fails, it returns a NULL pointer. However, this return > value is not properly checked in the function wled_configure. > > A NULL check should be added after the devm_kasprintf call to prevent > potential NULL pointer dereference error. * Please adhere to word wrapping pr

Re: [PATCH v3] backlight: pm8941: Add NULL check in wled_configure()

2025-04-05 Thread Markus Elfring
> devm_kasprintf() return NULL if memory allocation fails. Currently, … call? failed? > Add NULL check after devm_kasprintf() to prevent this issue. Do you propose to improve this function implementation a bit more? Regards, Markus

Re: [v4?] backlight: pm8941: Add NULL check in wled_configure()

2025-04-01 Thread Markus Elfring
… >patch description ;-). I think the original v3 was better worded. … Can you find the mentioning of adjustments helpful for better error handling? Regards, Markus

Re: [PATCH v2] backlight: pm8941: Add NULL check in wled_configure()

2025-03-31 Thread Markus Elfring
> devm_kasprintf() return NULL if memory allocation fails. Currently, call? failed? > wled_configure() does not check for this case, leading to a possible NULL > pointer dereference. You may omit the word “possible” in such a change description. (W

Re: [PATCH] drm/amdgpu/gfx12: correct cleanup of 'me' field with gfx_v12_0_me_fini()

2025-03-13 Thread Markus Elfring
… > can only release 'pfp' field of 'gfx'. The release function of 'me' field > should be gfx_v12_0_me_fini(). Do you care for an imperative wording in such a change description? https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rs

Re: [PATCH v2] drm/msm/dpu: reorder pointer operations after sanity checks to avoid NULL deref

2025-03-10 Thread Markus Elfring
… > Fix this by reordering the dereference after the sanity checks. Can another wording approach (like the following) be more appropriate? Thus move the assignment of the variable “dpu_enc” behind … Would an other summary phrase become nicer? Regards, Markus

Re: [PATCH] drm/msm/dpu: reorder pointer operations after sanity checks to avoid NULL deref

2025-03-09 Thread Markus Elfring
… > Fix this by reordering the dereference after the sanity checks. Another wording suggestion: Thus move the assignment of the variable “dpu_enc” behind a null pointer check. Would an other summary phrase be nicer? Regards, Markus

Re: [PATCH] drm/exynos/vidi: Remove redundant error handling in vidi_get_modes()

2025-03-07 Thread Markus Elfring
… > drm_edid_alloc() fails, the function will immediately return 0, … failed? … > the event of failure in these two functions, it is still necessary > to call the subsequent drm_edid_connector_update() function with … You may occasionally put more than 66 characters into text

Re: video: au1100fb: Move a variable assignment behind a null pointer check in au1100fb_setmode()

2025-03-05 Thread Markus Elfring
> No crash or anything can or will happen here. > > Markus, maybe you missed the "&" in front of "&fbdev->info" ? Would you get into the mood to adjust development views if you would take any feedback and further background information (by David Svoboda for example) better into account? https://wik

Re: [PATCH drm-next 1/2] vmalloc: Add atomic_vmap

2025-03-05 Thread Markus Elfring
> Some drivers can use vmap in drm_panic, however, vmap is sleepable and > takes locks. Since drm_panic will vmap in panic handler, atomic_vmap > requests pages with GFP_ATOMIC and maps KVA without locks and sleep. See also: https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tr

Re: video: au1100fb: Move a variable assignment behind a null pointer check in au1100fb_setmode()

2025-03-05 Thread Markus Elfring
> Anyway, none of that applies here, because this is just pointer math. Which data processing do you expect to be generally supported at the discussed source code place (according to the rules of the programming language “C”)? https://en.cppreference.com/w/c/language/behavior Regards, Markus

Re: [RFC] Clarification for “undefined behaviour”?

2025-03-05 Thread Markus Elfring
>> Dereferences of null pointers are treated in special ways. > > This not a dereference. It's just pointer math. Do you prefer the wording “member access through pointer” occasionally? https://en.cppreference.com/w/c/language/operator_member_access How do you tend to describe (and detect) null p

Re: [RFC] Clarification for “undefined behaviour”?

2025-03-05 Thread Markus Elfring
>>> The address of a data structure member was determined before >>> a corresponding null pointer check in the implementation of >>> the functions “dpu_hw_pp_enable_te” and “dpu_hw_pp_get_vsync_info”. >>> >>> Thus avoid the risk for undefined behaviour by removing extra >>> initialisations for the

[PATCH RESEND] drm/nouveau: Add a jump label in nouveau_gem_ioctl_pushbuf()

2025-03-03 Thread Markus Elfring
From: Markus Elfring Date: Wed, 5 Apr 2023 18:38:54 +0200 The label “out_prevalid” was used to jump to another pointer check despite of the detail in the implementation of the function “nouveau_gem_ioctl_pushbuf” that it was determined already in one case that the corresponding variable

[PATCH] drm/radeon: Simplify maximum determination in radeon_uvd_calc_upll_dividers()

2025-03-03 Thread Markus Elfring
From: Markus Elfring Date: Fri, 28 Feb 2025 17:32:45 +0100 Replace nested max() calls by single max3() call in this function implementation. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/radeon/radeon_uvd.c | 2 +- 1 file

[PATCH RESEND] drm/mm: Adjust input parameter validation in DECLARE_NEXT_HOLE_ADDR()

2025-03-03 Thread Markus Elfring
From: Markus Elfring Date: Mon, 17 Apr 2023 11:26:34 +0200 The address of a data structure member was determined before a corresponding null pointer check in the implementation of the macro “DECLARE_NEXT_HOLE_ADDR”. Thus avoid the risk for undefined behaviour by moving the assignment for the

Re: video: au1100fb: Move a variable assignment behind a null pointer check in au1100fb_setmode()

2025-03-03 Thread Markus Elfring
> struct fb_info *info = &fbdev->info; > > if (!fbdev) > return -EINVAL; Is such a null pointer check still relevant for the discussed function implementation? Regards, Markus

Re: [RESEND] drm/msm/dpu: Delete a variable initialisation before a null pointer check in two functions

2025-03-03 Thread Markus Elfring
>>> The address of a data structure member was determined before >>> a corresponding null pointer check in the implementation of >>> the functions “dpu_hw_pp_enable_te” and “dpu_hw_pp_get_vsync_info”. >>> >>> Thus avoid the risk for undefined behaviour by removing extra >>> initialisations for the

[PATCH] drm/amdgpu: Simplify maximum determination in si_calc_upll_dividers()

2025-03-02 Thread Markus Elfring
From: Markus Elfring Date: Fri, 28 Feb 2025 16:37:00 +0100 Replace nested max() calls by single max3() call in this function implementation. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/amd/amdgpu/si.c | 2 +- 1 file changed

[PATCH RESEND] drm/msm/dpu: Delete a variable initialisation before a null pointer check in two functions

2025-03-02 Thread Markus Elfring
From: Markus Elfring Date: Tue, 11 Apr 2023 18:24:24 +0200 The address of a data structure member was determined before a corresponding null pointer check in the implementation of the functions “dpu_hw_pp_enable_te” and “dpu_hw_pp_get_vsync_info”. Thus avoid the risk for undefined behaviour by

[PATCH RESEND] video: au1100fb: Move a variable assignment behind a null pointer check in au1100fb_setmode()

2025-03-02 Thread Markus Elfring
From: Markus Elfring Date: Thu, 13 Apr 2023 21:35:36 +0200 The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “au1100fb_setmode”. Thus avoid the risk for undefined behaviour by moving the assignment for the

[PATCH] drm/sun4i: dsi: Simplify maximum determination in sun6i_dsi_setup_timings()

2025-02-28 Thread Markus Elfring
From: Markus Elfring Date: Fri, 28 Feb 2025 18:25:31 +0100 Reduce nested max() calls by a single max3() call in this function implementation. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +- 1 file

[PATCH] drm: Simplify maximum determination in drm_ioctl()

2025-02-28 Thread Markus Elfring
From: Markus Elfring Date: Fri, 28 Feb 2025 17:18:07 +0100 Replace nested max() calls by single max3() call in this function implementation. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/drm_ioctl.c | 2 +- 1 file changed, 1

Re: [cocci] [PATCH v3 04/16] ALSA: ac97: convert timeouts to secs_to_jiffies()

2025-02-26 Thread Markus Elfring
… > This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with > the following Coccinelle rules: Is only a single SmPL script rule relevant here? > @depends on patch@ > expression E; > @@ > > -msecs_to_jiffies > +secs_to_jiffies > (E > - * \( 1000 \| MSEC_PER_SEC \) > ) I would

Re: [PATCH V2] drm/sched: fix fence reference count leak

2025-02-25 Thread Markus Elfring
… > fence callback add fails. failed? > To fix this, we should decrement the reference count of prev when … See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc4#n94 > v2: Patch version

Re: [PATCH] drm/scheduler: Fix mem leak when last_scheduled signaled

2025-02-25 Thread Markus Elfring
> Problem: If prev(last_scheduled) was already signaled I encountred a signalled? encountered? > memory leak in drm_sched_entity_fini. This is because the > prev(last_scheduled) fence is not free properly. freed?

Re: [PATCH v2?] drm/radeon: Add error handlings for r420 CP errata initialization

2025-02-20 Thread Markus Elfring
… > --- > drivers/gpu/drm/radeon/r420.c | 15 +++ … How do you think about to improve your version management? https://lore.kernel.org/all/?q=%22This+looks+like+a+new+version+of+a+previously+submitted+patch%22 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Docu

Re: [PATCH] drm/amdgpu: Remove redundant return value checks for amdgpu_ras_error_data_init()

2025-02-12 Thread Markus Elfring
> … This patch changes its return type … See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc2#n94 > Signed-off-by: Wentao Liang How good does such an email address fit to the Developer's Certificate of Origi

Re: [PATCH V3] drm: xlnx: zynqmp_dpsub: Add NULL checks in zynqmp_audio_init()

2025-02-11 Thread Markus Elfring
… > --- > drivers/gpu/drm/xlnx/zynqmp_dp_audio.c | 4 … See also: https://lore.kernel.org/all/?q=%22This+looks+like+a+new+version+of+a+previously+submitted+patch%22 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc2

Re: [v2] drm: xlnx: zynqmp_dpsub: Add NULL checks in zynqmp_audio_init()

2025-02-11 Thread Markus Elfring
… > Add NULL check in zynqmp_audio_init(), to handle kernel NULL > pointer dereference error. * Can it be more desirable to prevent such issues? * Would the message subject have been nicer with a key word like “PATCH” (besides other refinements)? … > --- > drivers/gpu/drm/xlnx/zynqmp_dp_audi

Re: [PATCH] drm: xlnx: zynqmp_dpsub: Add NULL checks in zynqmp_audio_init()

2025-02-08 Thread Markus Elfring
> devm_kasprintf() can return a NULL pointer on failure,but this > returned value in zynqmp_audio_init() is not checked. Another wording suggestion: devm_kasprintf() calls can return null pointers on failure. But some return values were not checked in zynqmp_audio_init(). > Add NULL check in zyn

Re: [01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too

2025-02-02 Thread Markus Elfring
> As it stands, I'll fix up the current rules in v2 following your > suggestion to keep the multiplication in each line to allow Coccinelle > to use the commutativity properties and find more instances. Corresponding software development challenges can eventually be clarified further. > I'll re

Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too

2025-01-30 Thread Markus Elfring
> Teach the script to suggest conversions for timeout patterns where the > arguments to msecs_to_jiffies() are expressions as well. Does anything hinder to benefit any more from a source code analysis approach (like the following by the extended means of the semantic patch language)? // SPDX-Lic

Re: [01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too

2025-01-29 Thread Markus Elfring
>> … >>> +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci >>> @@ -11,12 +11,22 @@ >>> >>> virtual patch >> … >>> -@depends on patch@ constant C; @@ >>> +@depends on patch@ >>> +expression E; >>> +@@ >>> >>> -- msecs_to_jiffies(C * MSEC_PER_SEC) >>> -+ secs_to_jiffies(C) >>> +-msecs_to_jiffies >

Re: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too

2025-01-28 Thread Markus Elfring
> Teach the script to suggest conversions for timeout patterns where the > arguments to msecs_to_jiffies() are expressions as well. I propose to take another look at implementation details for such a script variant according to the semantic patch language. … > +++ b/scripts/coccinelle/misc/secs

Re: drm/mediatek: Initialize pointer before use to avoid undefiend behaviour

2024-12-27 Thread Markus Elfring
>> … >>> --- >>> Coverity Message: >>> CID 1601557: (#1 of 1): Uninitialized pointer read (UNINIT) >>> 3. uninit_use: Using uninitialized value next. >> >> May such information become a part for the final change description? >> > Ofcourse, it shouldn't be the part of the change description. I sugg

Re: [PATCH] drm/mediatek: Initialize pointer before use to avoid undefiend behaviour

2024-12-24 Thread Markus Elfring
> Initialize the pointer with NULL as mtk_drm_of_get_ddp_ep_cid > function might return before assigning value to next pointer > but yet further dereference to next can lead to some undefined > behavior as it may point to some invalid location. * You may occasionally put more than 62 characters in

Re: [PATCH v9 2/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen

2024-12-18 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/clients/drm_log.c > @@ -0,0 +1,370 @@ … > +static int drm_log_count_modeset(struct drm_client_dev *client) > +{ > + struct drm_mode_set *mode_set; > + int count = 0; > + > + mutex_lock(&client->modeset_mutex); > + drm_client_for_each_modeset(mode_set, clien

Re: [PATCH] drm/msm: Check return value of of_dma_configure()

2024-11-30 Thread Markus Elfring
> Because the of_dma_configure() will returns '-EPROBE_DEFER' if the probe return? … > Stop pretending that it will always suceess, quit if it fail. succeed?failed? How do you think about to add any tags (

Re: [cocci] [PATCH v2 02/21] coccinelle: misc: Add secs_to_jiffies script

2024-11-16 Thread Markus Elfring
Why is a change description missing here? … > +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci > @@ -0,0 +1,21 @@ … > +/// Find usages of: > +/// - msecs_to_jiffies(value*1000) > +/// - msecs_to_jiffies(value*MSEC_PER_SEC) I suggest to take another look at corresponding development documentat

Re: [PATCH 05/10] media: platform: mediatek: add isp_7x camsys unit

2024-11-04 Thread Markus Elfring
… > +++ b/drivers/media/platform/mediatek/isp/isp_7x/camsys/mtk_cam.c > @@ -0,0 +1,4168 @@ … > +void mtk_cam_dev_req_try_queue(struct mtk_cam_device *cam) > +{ … > + spin_lock(&cam->running_job_lock); > + job_count = cam->running_job_count; > + spin_unlock(&cam->running_job_lock); … Un

Re: [PATCH v2] amdgpu: prevent NULL pointer dereference if ATIF is not supported

2024-10-31 Thread Markus Elfring
… > Although this case may be unrealistic for the current code, it is > still better to protect against possible bugs. > > Bail out also when status is AE_NOT_FOUND. … How do you think about to add any tags (like “Fixes” and “Cc”) accordingly? https://git.kernel.org/pub/scm/linux/kernel/git/torval

Re: [PATCH v3] drm/amdgpu: Fix the memory allocation issue in amdgpu_discovery_get_nps_info()

2024-10-29 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c > @@ -1757,11 +1757,13 @@ int amdgpu_discovery_get_nps_info(struct > amdgpu_device *adev, > > switch (le16_to_cpu(nps_info->v1.header.version_major)) { > case 1: > + mem_ranges = kvcalloc(nps_info->v1.count, > +

Re: [v10 4/5] drm/mediatek: ovl: Add blend_modes to driver data

2024-10-08 Thread Markus Elfring
>> … >>> pre-multiplied is supported in the current platform. >> … >> >> format would be? … > blend_modes is the driver data that describes the supported blend mode > in current platform no matter format would be any one. > > This sentence is describing mtk_ovl_fmt_convert() will c

Re: [PATCH v10 0/2] Add driver for Sharp Memory LCD

2024-10-08 Thread Markus Elfring
> This patch series add support for the monochrome Sharp Memory LCD panels. … > --- > Changes in v10: … Is the support for the application of scope-based resource management still ignored here? Regards, Markus

Re: [PATCH v10 4/5] drm/mediatek: ovl: Add blend_modes to driver data

2024-10-08 Thread Markus Elfring
… > pre-multiplied is supported in the current platform. … format would be? Regards, Markus

Re: [PATCH v10 1/5] drm/mediatek: ovl: Fix XRGB format breakage for blend_modes unsupported SoCs

2024-10-08 Thread Markus Elfring
… > Note that ignore pixel alpha bit is not supported if the SoC is not > supported the blend_modes. supporting the blending modes? > So it will break the original setting of XRGB foramt for the format? > Signed-off-by: Jason-JH.Lin

Re: [PATCH v10 0/5] Fix degradation problem of alpha blending series

2024-10-08 Thread Markus Elfring
… > Fix the SoC degradation problem by this sreies. series? Regards, Markus

Re: [PATCH v9 4/5] drm/mediatek: ovl: Add blend_modes to driver data

2024-10-07 Thread Markus Elfring
… > premultiplied supported in current platform. … format would be? Regards, Markus

Re: [PATCH v9 1/5] drm/mediatek: ovl: Fix XRGB format breakage for blend_modes unsupported SoCs

2024-10-07 Thread Markus Elfring
… > Make the constatnt alpha only enable when having a vliad blend_mode or … Another wording suggestion: Enable the constant alpha channel only when having a valid blending mode? … > Signed-off-by: Jason-JH.Lin Does a dot really belong to this personal name? https://git.kernel.org/pub/scm/linu

Re: [PATCH v3 04/14] drm/mediatek: Fix XRGB setting error in Mixer

2024-10-07 Thread Markus Elfring
> Although the alpha channel in XRGB formats can be ignored, ALPHA_CON > must be configured accordingly when using XRGB formats or it will still > affects CRC generation. affect? Can such a change description become a bit nicer with an additional imperative wording? https://git.kernel.org/pub/

Re: [PATCH v9 0/2] Add driver for Sharp Memory LCD

2024-10-07 Thread Markus Elfring
> This patch series add support for the monochrome Sharp Memory LCD panels. … > --- > Changes in v9: … Would you like to benefit from the application of scope-based resource management (also for this software component)? Regards, Markus

Re: [PATCH] drm/fsl-dcu: Remove redundant dev_err()

2024-10-06 Thread Markus Elfring
> There is no need to call the dev_err() function directly to print a > custom message when handling an error from platform_get_irq() function > as it is going to display an appropriate error message in case of a > failure. Can such a change description become a bit nicer with an additional impera

[PATCH] drm: rcar-du: Reduce of_node_put(cmm) calls in rcar_du_cmm_init()

2024-10-03 Thread Markus Elfring
From: Markus Elfring Date: Thu, 3 Oct 2024 19:56:29 +0200 An of_node_put(cmm) call was immediately used after a null pointer check for an of_find_device_by_node() call in this function implementation. Thus call such a function instead directly before the check. This issue was transformed by

[PATCH] drm/kmb: Use common error handling code in kmb_probe()

2024-10-03 Thread Markus Elfring
From: Markus Elfring Date: Thu, 3 Oct 2024 13:20:05 +0200 Add a label so that a bit of exception handling can be better reused in a subsequent if branch of this function implementation. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu

Re: [PATCH v8 2/2] drm/tiny: Add driver for Sharp Memory LCD

2024-10-02 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/tiny/sharp-memory.c > @@ -0,0 +1,681 @@ … > +static int sharp_memory_maintain_display(struct sharp_memory_device *smd) > +{ … > + u8 *tx_buffer = smd->tx_buffer; > + > + mutex_lock(&smd->tx_mutex); … > + mutex_unlock(&smd->tx_mutex); > + > + return ret; > +

[PATCH] fbdev: omapfb: Call of_node_put(ep) only once in omapdss_of_find_source_for_first_ep()

2024-09-25 Thread Markus Elfring
From: Markus Elfring Date: Wed, 25 Sep 2024 21:12:36 +0200 An of_node_put(ep) call was immediately used after a pointer check for a of_graph_get_remote_port() call in this function implementation. Thus call such a function only once instead directly before the check. This issue was transformed

Re: [PATCH] drm/xe/query: Refactor copy_to_user() usage in four functions

2024-09-18 Thread Markus Elfring
>> Assign return values from copy_to_user() calls to additional local variables >> so that four kfree() calls and return statements can be omitted accordingly. … >> +++ b/drivers/gpu/drm/xe/xe_query.c >> @@ -220,13 +220,11 @@ static int query_engines(struct xe_device *xe, >> >> engines->num_en

[PATCH] drm/xe/query: Refactor copy_to_user() usage in four functions

2024-09-18 Thread Markus Elfring
From: Markus Elfring Date: Wed, 18 Sep 2024 09:43:07 +0200 Assign return values from copy_to_user() calls to additional local variables so that four kfree() calls and return statements can be omitted accordingly. This issue was transformed by using the Coccinelle software. Signed-off-by

[PATCH 2/2] drm/mediatek: Use common error handling code in mtk_gem_prime_vmap()

2024-09-17 Thread Markus Elfring
From: Markus Elfring Date: Tue, 17 Sep 2024 19:06:23 +0200 Add a jump target so that a bit of exception handling can be better reused at the end of this function implementation. Signed-off-by: Markus Elfring --- drivers/gpu/drm/mediatek/mtk_gem.c | 10 ++ 1 file changed, 6 insertions

[PATCH 1/2] drm/mediatek: Avoid duplicate sg_free_table(sgt) call in mtk_gem_prime_vmap()

2024-09-17 Thread Markus Elfring
From: Markus Elfring Date: Tue, 17 Sep 2024 18:50:37 +0200 A sg_free_table(sgt) call was immediately used after a null pointer check for the data structure member “kvaddr” in this function implementation. Thus use such a function call only once instead directly before the check. This issue was

[PATCH 0/2] drm/mediatek: Adjustments for mtk_gem_prime_vmap()

2024-09-17 Thread Markus Elfring
From: Markus Elfring Date: Tue, 17 Sep 2024 19:16:45 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Avoid duplicate sg_free_table(sgt) call Use common error handling code drivers/gpu/drm/mediatek/mtk_gem.c | 14

[PATCH] drm/bridge: imx: Use of_node_put(remote) call only once in imx8qxp_pc_bridge_probe()

2024-09-17 Thread Markus Elfring
From: Markus Elfring Date: Tue, 17 Sep 2024 16:40:18 +0200 A of_node_put(remote) call was immediately used after a null pointer check for the data structure member “next_bridge” in this function implementation. Thus use such a function call only once instead directly before the check. This

Re: [PATCH 8/9] accel/rocket: Add job submission IOCTL

2024-09-11 Thread Markus Elfring
… > +++ b/drivers/accel/rocket/rocket_job.h > @@ -0,0 +1,49 @@ … > +#ifndef __ROCKET_JOB_H__ > +#define __ROCKET_JOB_H__ … I suggest to omit leading underscores from such identifiers. https://wiki.sei.cmu.edu/confluence/display/c/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier Regards, Ma

Re: [PATCH 8/9] accel/rocket: Add job submission IOCTL

2024-09-11 Thread Markus Elfring
… > +++ b/drivers/accel/rocket/rocket_job.c > @@ -0,0 +1,708 @@ … > +static int rocket_job_push(struct rocket_job *job) > +{ … > + mutex_lock(&rdev->sched_lock); > + drm_sched_job_arm(&job->base); … > + drm_sched_entity_push_job(&job->base); > + > + mutex_unlock(&rdev->sched_lock);

Re: [PATCH v3 3/3] drm: xlnx: zynqmp_dpsub: Add DP audio support

2024-09-10 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/xlnx/zynqmp_dp_audio.c > @@ -0,0 +1,461 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * ZynqMP DisplayPort Subsystem Driver - Audio support > + * > + * Copyright (C) 2015 - 2023 Xilinx, Inc. > + * > + * Authors: … Would such information need another adjustment (acco

Re: [PATCH v3 3/3] drm: xlnx: zynqmp_dpsub: Add DP audio support

2024-09-10 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/xlnx/zynqmp_dp_audio.c > @@ -0,0 +1,461 @@ … > +static int dp_dai_hw_free(struct snd_pcm_substream *substream, > + struct snd_soc_dai *socdai) > +{ … > + struct zynqmp_dpsub_audio *audio = dpsub->audio; > + > + mutex_lock(&audio->enable_lock);

Re: [PATCH 1/5] drm/amdgpu: Move a variable assignment behind a null pointer check in amdgpu_ras_interrupt_dispatch()

2024-09-09 Thread Markus Elfring
assignment > for the variable “data” behind the null pointer check. > > This issue was detected by using the Coccinelle software. > > Fixes: c030f2e4166c3f5597c7e7a70bcd9ab383695de4 ("drm/amdgpu: add > amdgpu_ras.c to support ras (v2)") > Signed-off-by: Markus Elfri

Re: [PATCH] drm/msm: allow returning NULL from crete_address_space

2024-09-09 Thread Markus Elfring
> Under some circumstances it might be required to return NULL from the > create_address_space callback, meaning that the driver should use global > address space. … Please avoid a typo in the summary phrase. Regards, Markus

Re: [PATCH v5 2/4] drm/bridge: synopsys: Add DW HDMI QP TX Controller support library

2024-09-08 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c > @@ -0,0 +1,708 @@ … > +static int dw_hdmi_qp_i2c_xfer(struct i2c_adapter *adap, > +struct i2c_msg *msgs, int num) > +{ … > + mutex_lock(&i2c->lock); … > + dw_hdmi_qp_mod(hdmi, 0, I2CM_OP_DONE_MASK_N | I2CM_

Re: [PATCH] treewide: Correct the typo 'retun'

2024-09-07 Thread Markus Elfring
… > should be instead of 'return'. “return” instead? Can a corresponding imperative wording be preferred for a better change description? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.11-rc6#n94 Regards, Ma

Re: [v2] drm/imagination: Use memdup_user() helper

2024-09-03 Thread Markus Elfring
Switching to memdup_user(), which combines kmalloc() and copy_from_user(), and it can simplfy code. By the way: Would it have been nicer to avoid a typo anyhow in such a change description? >>> Applied, thanks! >>> >>> [1/1] drm/imagination: Use memdup_user() helper >>> commit: 2

Re: [PATCH -next v2] drm/imagination: Use memdup_user() helper

2024-09-02 Thread Markus Elfring
> > Switching to memdup_user(), which combines kmalloc() and copy_from_user(), > > and it can simplfy code. > > Applied, thanks! > > [1/1] drm/imagination: Use memdup_user() helper > commit: 2872a57c7ad427d428c6d12e95e55b32bdc8e3b8 Do you find any previous contributions still similarly inter

Re: [PATCH v3 2/2] mtd: rawnand: nuvoton: add new driver for the Nuvoton MA35 SoC

2024-08-28 Thread Markus Elfring
> Nuvoton MA35 SoCs NAND Flash Interface Controller > supports 2KB, 4KB and 8KB page size, and up to 8-bit, > 12-bit, and 24-bit hardware ECC calculation circuit > to protect data communication. You may occasionally put more than 53 characters into text lines of such a change description. https://

Re: [PATCH V2 01/10] accel/amdxdna: Add a new driver for AMD AI Engine

2024-08-07 Thread Markus Elfring
If you temporarily find the circumstances too challenging for applications of scope-based resource management, I suggest to use the following statements instead (so that a bit of redundant code can be avoided). … > +++ b/drivers/accel/amdxdna/aie2_pci.c > @@ -0,0 +1,182 @@ … > +static int aie2_

Re: [PATCH V2 00/10] AMD XDNA driver

2024-08-06 Thread Markus Elfring
>> https://lkml.org/lkml/2024/7/19/803 >> https://lore.kernel.org/linux-kernel/010a46ba-9dc4-e3e3-7894-b28b312c6...@amd.com/ >> [01/10] accel/amdxdna: Add a new driver for AMD AI Engine >> “guard looks cleaner. We will use it.” > We reconsidered this request Interesting … > and searched accel an

Re: [PATCH 3/3] drm/omap: Fix locking in omap_gem_new_dmabuf()

2024-08-06 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/omapdrm/omap_gem.c … > @@ -1418,21 +1416,17 @@ struct drm_gem_object *omap_gem_new_dmabuf(struct > drm_device *dev, size_t size, > pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL); > if (!pages) { > omap_gem_free_object

Re: [PATCH V2 00/10] AMD XDNA driver

2024-08-06 Thread Markus Elfring
… > Changes since v1: > - Remove some inline defines > - Minor changes based code review comments … How “good” does such a version description fit to previous patch review feedback (like the following)? https://lkml.org/lkml/2024/7/19/803 https://lore.kernel.org/linux-kernel/010a46ba-9dc4-e3e3-78

Re: [PATCH net-next v17 03/14] netdev: support binding dma-buf to netdevice

2024-08-06 Thread Markus Elfring
>> … >>> +++ b/include/net/devmem.h >>> @@ -0,0 +1,115 @@ >> … >>> +#ifndef _NET_DEVMEM_H >>> +#define _NET_DEVMEM_H >> … >> >> I suggest to omit leading underscores from such identifiers. >> https://wiki.sei.cmu.edu/confluence/display/c/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier >> >

Re: [PATCH v5 1/2] drm/loongson: Introduce component framework support

2024-07-30 Thread Markus Elfring
>> … >>> +++ b/drivers/gpu/drm/loongson/loongson_drv.h >>> @@ -0,0 +1,108 @@ >> … >>> +#ifndef __LOONGSON_DRV_H__ >>> +#define __LOONGSON_DRV_H__ >> … >> >> I suggest to omit leading underscores from such identifiers. … > I suggest add this rules to the checkpatch.pl script, … I hope that you woul

Re: [PATCH net-next v17 03/14] netdev: support binding dma-buf to netdevice

2024-07-30 Thread Markus Elfring
… > +++ b/include/net/devmem.h > @@ -0,0 +1,115 @@ … > +#ifndef _NET_DEVMEM_H > +#define _NET_DEVMEM_H … I suggest to omit leading underscores from such identifiers. https://wiki.sei.cmu.edu/confluence/display/c/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier Regards, Markus

Re: [PATCH v3 2/2] drm/tiny: Add driver for Sharp Memory LCD

2024-07-29 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/tiny/sharp-memory.c > @@ -0,0 +1,684 @@ … > static int sharp_memory_update_display(struct sharp_memory_device *smd, > +struct drm_framebuffer *fb, > +struct drm_rect clip, > +

Re: [PATCH v5 2/2] drm/loongson: Add dummy gpu driver as a subcomponent

2024-07-29 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/loongson/Makefile > @@ -17,6 +17,9 @@ loongson-y := \ > lsdc_probe.o \ > lsdc_ttm.o > > +loongson-y += \ > + loonggpu_pci_drv.o > + > loongson-y += loongson_device.o \ … Why do you propose to adjust the macro contents multiple times here? (Can it be suffi

Re: [PATCH v5 1/2] drm/loongson: Introduce component framework support

2024-07-29 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/loongson/loongson_drv.c > @@ -0,0 +1,298 @@ … > +static int loongson_drm_driver_probe(struct platform_device *pdev) > +{ … > + dev_info(&pdev->dev, "probed\n"); … > +} … Do you find such information really relevant? Regards, Markus

Re: [PATCH v5 2/2] drm/loongson: Add dummy gpu driver as a subcomponent

2024-07-29 Thread Markus Elfring
… > the driver is loaded, drm/loongson driver still need to wait all of needs to wait on …? … > design. Therefore, add a dummy driver for the GPU, … Is there a need to reconsider the categorisation and usability descriptions another bit for such

Re: [PATCH v5 1/2] drm/loongson: Introduce component framework support

2024-07-28 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/loongson/loongson_drv.h > @@ -0,0 +1,108 @@ … > +#ifndef __LOONGSON_DRV_H__ > +#define __LOONGSON_DRV_H__ … I suggest to omit leading underscores from such identifiers. https://wiki.sei.cmu.edu/confluence/display/c/DCL37-C.+Do+not+declare+or+define+a+reserved+identifier

Re: [PATCH v5 1/2] drm/loongson: Introduce component framework support

2024-07-28 Thread Markus Elfring
… > +++ b/drivers/gpu/drm/loongson/loongson_drv.c > @@ -0,0 +1,298 @@ … > +static int loongson_drm_freeze(struct drm_device *ddev) > +{ … > + /* unpin all of buffers in the VRAM */ > + mutex_lock(&ldrm->gem.mutex); … > + mutex_unlock(&ldrm->gem.mutex); > + > + lsdc_bo_evict_vram(dde

Re: [PATCH] drm/nouveau/debugfs: Simplify character output in nouveau_debugfs_vbios_image()

2024-07-24 Thread Markus Elfring
>> Is there some reason this whole thing isn't just >> >> seq_write(m, drm->vbios.data, drm->vbios.length) … > I don't know if my answer is relevant or not here but: > for () seq_putc();    ==> will fill 'm' with everything that fits in I find such a discussion approach strange. > and >

Re: [PATCH v4] drm/loongson: Introduce component framework support

2024-07-24 Thread Markus Elfring
> In some display subsystems, the functionality of a PCIe device may too might be? … > of the dirver is loaded, … driver? … > its dependencies ready before it can register the service to userspace.

Re: [PATCH v4 0/1] drm/loongson: Introduce component framework support

2024-07-23 Thread Markus Elfring
… > v3 -> v4: > * Tiny refinement and clean up. I suggest to reconsider the need for a cover letter according to a single patch. Regards, Markus

[PATCH v2] drm/nouveau/debugfs: Optimise data output in nouveau_debugfs_vbios_image()

2024-07-23 Thread Markus Elfring
From: Markus Elfring Date: Tue, 23 Jul 2024 18:08:15 +0200 Some characters should be put into a sequence. * Thus print all data by the corresponding function “seq_write” at once. * Return also the value from this function call. * Omit a local variable which became redundant with this

Re: [PATCH v7 05/28] dma-heap: Add proper kref handling on dma-buf heaps

2024-07-22 Thread Markus Elfring
>> … >>> +++ b/drivers/dma-buf/dma-heap.c >> … >>> +static void dma_heap_release(struct kref *ref) >>> +{ >> … >>> + mutex_lock(&heap_list_lock); >>> + list_del(&heap->list); >>> + mutex_unlock(&heap_list_lock); >> … >> >> Under which circumstances would you become interested to apply a

Re: [PATCH v7 05/28] dma-heap: Add proper kref handling on dma-buf heaps

2024-07-20 Thread Markus Elfring
… > +++ b/drivers/dma-buf/dma-heap.c … > +static void dma_heap_release(struct kref *ref) > +{ … > + mutex_lock(&heap_list_lock); > + list_del(&heap->list); > + mutex_unlock(&heap_list_lock); … Under which circumstances would you become interested to apply a statement like “guard(mutex)

Re: [PATCH 04/10] accel/amdxdna: Add hardware context

2024-07-20 Thread Markus Elfring
> … The tile columns belong to … which …? … > +++ b/drivers/accel/amdxdna/aie2_ctx.c > @@ -0,0 +1,181 @@ … > +void aie2_hwctx_fini(struct amdxdna_hwctx *hwctx) > +{ > + struct amdxdna_dev *xdn

Re: [PATCH 03/10] accel/amdxdna: Add hardware resource solver

2024-07-20 Thread Markus Elfring
> The AI Engine consists of 2D array of tiles arranged as columns. The > resource solver provides the interfaces to manage allocation of the tile > columns for a hardware context. The basic column allocation and release > functions are provided. Can such a change description be improved with imper

Re: [PATCH 02/10] accel/amdxdna: Support hardware mailbox

2024-07-20 Thread Markus Elfring
… > +++ b/drivers/accel/amdxdna/amdxdna_mailbox.c > @@ -0,0 +1,582 @@ … > +int xdna_mailbox_send_msg(struct mailbox_channel *mb_chann, > + const struct xdna_mailbox_msg *msg, u64 tx_timeout) > +{ > + struct xdna_msg_header *header; > + struct mailbox_msg *mb_msg; I pr

Re: [PATCH 01/10] accel/amdxdna: Add a new driver for AMD AI Engine

2024-07-20 Thread Markus Elfring
… > +++ b/drivers/accel/amdxdna/aie2_pci.h > @@ -0,0 +1,144 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Copyright (C) 2023-2024, Advanced Micro Devices, Inc. > + */ > + > +#ifndef _AIE2_PCI_H_ > +#define _AIE2_PCI_H_ … Please omit leading underscores from such identifiers. https://wik

Re: [PATCH 01/10] accel/amdxdna: Add a new driver for AMD AI Engine

2024-07-19 Thread Markus Elfring
… > +++ b/drivers/accel/amdxdna/aie2_pci.c > @@ -0,0 +1,182 @@ … > +static int aie2_init(struct amdxdna_dev *xdna) > +{ … > + const struct firmware *fw; I suggest to take another software design option better into account also according to the application of scope-based resource management. *

  1   2   3   4   5   6   7   8   >