In the function amdgpu_uvd_cs_msg(), every branch in the switch
statement will have a return, so the code below the switch statement
will not be executed.
Eliminate the follow smatch warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:845 amdgpu_uvd_cs_msg() warn:
ignoring unreachable code.
Reported-by: Abaci Robot <abaci(a)linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong(a)linux.alibaba.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index 82f0542..375b346 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -842,8 +842,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,
DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
return -EINVAL;
}
- BUG();
- return -EINVAL;
}
/**
--
1.8.3.1
In the function amdgpu_uvd_cs_msg(), every branch in the switch
statement will have a return, so the code below the switch statement
will not be executed.
Eliminate the follow smatch warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:845 amdgpu_uvd_cs_msg() warn:
ignoring unreachable code.
Reported-by: Abaci Robot <abaci(a)linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong(a)linux.alibaba.com>
---
Changes in v2:
-For the follow advice: https://lore.kernel.org/patchwork/patch/1435074/
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index 82f0542..b32ed85 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -840,7 +840,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,
default:
DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
- return -EINVAL;
}
BUG();
return -EINVAL;
--
1.8.3.1
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: dc8276b78917 ("staging: media: tegra-vde: use pm_runtime_resume_and_get()")
Reported-by: Hulk Robot <hulkci(a)huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1(a)huawei.com>
---
drivers/staging/media/tegra-vde/vde.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
index e025b69776f2..321d14ba2e56 100644
--- a/drivers/staging/media/tegra-vde/vde.c
+++ b/drivers/staging/media/tegra-vde/vde.c
@@ -1071,7 +1071,8 @@ static int tegra_vde_probe(struct platform_device *pdev)
* power-cycle it in order to put hardware into a predictable lower
* power state.
*/
- if (pm_runtime_resume_and_get(dev) < 0)
+ err = pm_runtime_resume_and_get(dev);
+ if (err < 0)
goto err_pm_runtime;
pm_runtime_put(dev);
From: Rob Clark <robdclark(a)chromium.org>
In some cases, like double-buffered rendering, missing vblanks can
trick the GPU into running at a lower frequence, when really we
want to be running at a higher frequency to not miss the vblanks
in the first place.
This is partially inspired by a trick i915 does, but implemented
via dma-fence for a couple of reasons:
1) To continue to be able to use the atomic helpers
2) To support cases where display and gpu are different drivers
The last patch is just proof of concept, in reality I think it
may want to be a bit more clever. But sending this out as it
is as an RFC to get feedback.
Rob Clark (3):
dma-fence: Add boost fence op
drm/atomic: Call dma_fence_boost() when we've missed a vblank
drm/msm: Wire up gpu boost
drivers/gpu/drm/drm_atomic_helper.c | 11 +++++++++++
drivers/gpu/drm/msm/msm_fence.c | 10 ++++++++++
drivers/gpu/drm/msm/msm_gpu.c | 13 +++++++++++++
drivers/gpu/drm/msm/msm_gpu.h | 2 ++
include/linux/dma-fence.h | 26 ++++++++++++++++++++++++++
5 files changed, 62 insertions(+)
--
2.30.2
On 2021-04-27 7:27, Fabio M. De Francesco wrote:
> In the documentation of functions, removed excess parameters, described
> undocumented ones, and fixed syntax errors.
>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco(a)gmail.com>
> ---
>
> Changes from v1: Cc'ed all the maintainers.
Looks like Alex already applied V1. So this one doesn't apply. "git am
-3" tells me:
Applying: drm/amd/amdgpu: Fix errors in documentation of function parameters
Using index info to reconstruct a base tree...
M drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
M drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
M drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Regards,
Felix
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 12 ++++++------
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c | 4 +++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 8 ++++----
> 3 files changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 2e9b16fb3fcd..bf2939b6eb43 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -76,7 +76,7 @@ struct amdgpu_atif {
> /**
> * amdgpu_atif_call - call an ATIF method
> *
> - * @handle: acpi handle
> + * @atif: acpi handle
> * @function: the ATIF function to execute
> * @params: ATIF function params
> *
> @@ -166,7 +166,6 @@ static void amdgpu_atif_parse_functions(struct amdgpu_atif_functions *f, u32 mas
> /**
> * amdgpu_atif_verify_interface - verify ATIF
> *
> - * @handle: acpi handle
> * @atif: amdgpu atif struct
> *
> * Execute the ATIF_FUNCTION_VERIFY_INTERFACE ATIF function
> @@ -240,8 +239,7 @@ static acpi_handle amdgpu_atif_probe_handle(acpi_handle dhandle)
> /**
> * amdgpu_atif_get_notification_params - determine notify configuration
> *
> - * @handle: acpi handle
> - * @n: atif notification configuration struct
> + * @atif: acpi handle
> *
> * Execute the ATIF_FUNCTION_GET_SYSTEM_PARAMETERS ATIF function
> * to determine if a notifier is used and if so which one
> @@ -304,7 +302,7 @@ static int amdgpu_atif_get_notification_params(struct amdgpu_atif *atif)
> /**
> * amdgpu_atif_query_backlight_caps - get min and max backlight input signal
> *
> - * @handle: acpi handle
> + * @atif: acpi handle
> *
> * Execute the QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS ATIF function
> * to determine the acceptable range of backlight values
> @@ -363,7 +361,7 @@ static int amdgpu_atif_query_backlight_caps(struct amdgpu_atif *atif)
> /**
> * amdgpu_atif_get_sbios_requests - get requested sbios event
> *
> - * @handle: acpi handle
> + * @atif: acpi handle
> * @req: atif sbios request struct
> *
> * Execute the ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS ATIF function
> @@ -899,6 +897,8 @@ void amdgpu_acpi_fini(struct amdgpu_device *adev)
> /**
> * amdgpu_acpi_is_s0ix_supported
> *
> + * @adev: amdgpu_device_pointer
> + *
> * returns true if supported, false if not.
> */
> bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev)
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
> index 5af464933976..98d31ebad9ce 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
> @@ -111,6 +111,8 @@ static const char *amdkfd_fence_get_timeline_name(struct dma_fence *f)
> * a KFD BO and schedules a job to move the BO.
> * If fence is already signaled return true.
> * If fence is not signaled schedule a evict KFD process work item.
> + *
> + * @f: dma_fence
> */
> static bool amdkfd_fence_enable_signaling(struct dma_fence *f)
> {
> @@ -131,7 +133,7 @@ static bool amdkfd_fence_enable_signaling(struct dma_fence *f)
> /**
> * amdkfd_fence_release - callback that fence can be freed
> *
> - * @fence: fence
> + * @f: dma_fence
> *
> * This function is called when the reference count becomes zero.
> * Drops the mm_struct reference and RCU schedules freeing up the fence.
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c
> index b43e68fc1378..ed3014fbb563 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c
> @@ -719,7 +719,7 @@ static void unlock_spi_csq_mutexes(struct amdgpu_device *adev)
> }
>
> /**
> - * @get_wave_count: Read device registers to get number of waves in flight for
> + * get_wave_count: Read device registers to get number of waves in flight for
> * a particular queue. The method also returns the VMID associated with the
> * queue.
> *
> @@ -755,19 +755,19 @@ static void get_wave_count(struct amdgpu_device *adev, int queue_idx,
> }
>
> /**
> - * @kgd_gfx_v9_get_cu_occupancy: Reads relevant registers associated with each
> + * kgd_gfx_v9_get_cu_occupancy: Reads relevant registers associated with each
> * shader engine and aggregates the number of waves that are in flight for the
> * process whose pasid is provided as a parameter. The process could have ZERO
> * or more queues running and submitting waves to compute units.
> *
> * @kgd: Handle of device from which to get number of waves in flight
> * @pasid: Identifies the process for which this query call is invoked
> - * @wave_cnt: Output parameter updated with number of waves in flight that
> + * @pasid_wave_cnt: Output parameter updated with number of waves in flight that
> * belong to process with given pasid
> * @max_waves_per_cu: Output parameter updated with maximum number of waves
> * possible per Compute Unit
> *
> - * @note: It's possible that the device has too many queues (oversubscription)
> + * Note: It's possible that the device has too many queues (oversubscription)
> * in which case a VMID could be remapped to a different PASID. This could lead
> * to an iaccurate wave count. Following is a high-level sequence:
> * Time T1: vmid = getVmid(); vmid is associated with Pasid P1
Multi line comment have been aligned starting with a *
The closing */ has been shifted to a new line.
Single space replaced with tab space
This is done to maintain code uniformity.
Signed-off-by: Shubhankar Kuranagatti <shubhankarvk(a)gmail.com>
---
drivers/i2c/i2c-core-smbus.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c
index d2d32c0fd8c3..205750518c21 100644
--- a/drivers/i2c/i2c-core-smbus.c
+++ b/drivers/i2c/i2c-core-smbus.c
@@ -66,10 +66,11 @@ static inline void i2c_smbus_add_pec(struct i2c_msg *msg)
}
/* Return <0 on CRC error
- If there was a write before this read (most cases) we need to take the
- partial CRC from the write part into account.
- Note that this function does modify the message (we need to decrease the
- message length to hide the CRC byte from the caller). */
+ * If there was a write before this read (most cases) we need to take the
+ * partial CRC from the write part into account.
+ * Note that this function does modify the message (we need to decrease the
+ * message length to hide the CRC byte from the caller).
+ */
static int i2c_smbus_check_pec(u8 cpec, struct i2c_msg *msg)
{
u8 rpec = msg->buf[--msg->len];
@@ -113,7 +114,7 @@ EXPORT_SYMBOL(i2c_smbus_read_byte);
s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value)
{
return i2c_smbus_xfer(client->adapter, client->addr, client->flags,
- I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL);
+ I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, NULL);
}
EXPORT_SYMBOL(i2c_smbus_write_byte);
@@ -387,7 +388,8 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr,
if (read_write == I2C_SMBUS_READ) {
msg[1].flags |= I2C_M_RECV_LEN;
msg[1].len = 1; /* block length will be added by
- the underlying bus driver */
+ * the underlying bus driver
+ */
i2c_smbus_try_get_dmabuf(&msg[1], 0);
} else {
msg[0].len = data->block[0] + 2;
@@ -418,7 +420,8 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr,
msg[1].flags |= I2C_M_RECV_LEN;
msg[1].len = 1; /* block length will be added by
- the underlying bus driver */
+ * the underlying bus driver
+ */
i2c_smbus_try_get_dmabuf(&msg[1], 0);
break;
case I2C_SMBUS_I2C_BLOCK_DATA:
--
2.17.1