Skip to contentSkip to conversation

drivers/accel/habanalabs: Remove unnecessary braces from if statement

PATCH Applied Malkoot Khan 2 participants 2 messages Dec 28, 2023 – Jan 3, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/accel/habanalabs: Remove unnecessary braces from if statement

The coding style in the Linux kernel prefers not to use braces for single-statement if conditions.
This patch removes the unnecessary braces from an if statement in the file drivers/accel/habanalabs/common/command_submission.c, which also resolves a coding style warning.

---
 drivers/accel/habanalabs/common/command_submission.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/accel/habanalabs/common/command_submission.c +1 -2
index 3aa6eeef443b..39e23d625a3c 100644
@@ -1360,9 +1360,8 @@ static int hl_cs_sanity_checks(struct hl_fpriv *hpriv, union hl_cs_args *args)
 			return -EINVAL;
 		}
 
-	if (!hl_device_operational(hdev, &status)) {
+	if (!hl_device_operational(hdev, &status))
 		return -EBUSY;
-	}
 
 	if ((args->in.cs_flags & HL_CS_FLAGS_STAGED_SUBMISSION) &&
 			!hdev->supports_staged_submission) {
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1 Applied
#1 lore raw
Quoted 16 lines · Malkoot Khan

The coding style in the Linux kernel prefers not to use braces for single-statement if conditions.
This patch removes the unnecessary braces from an if statement in the file drivers/accel/habanalabs/common/command_submission.c, which also resolves a coding style warning.

---
  drivers/accel/habanalabs/common/command_submission.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/accel/habanalabs/common/command_submission.c +0 -0
index 3aa6eeef443b..39e23d625a3c 100644

drivers/accel/habanalabs/common/command_submission.c static int hl_cs_sanity_checks(struct hl_fpriv *hpriv, union hl_cs_args *args) · line 1367

Quoted 10 lines
drivers/accel/habanalabs/common/command_submission.c +1 -2
@@ -1360,9 +1360,8 @@ static int hl_cs_sanity_checks(struct hl_fpriv *hpriv, union hl_cs_args *args)
  			return -EINVAL;
  		}
 
-	if (!hl_device_operational(hdev, &status)) {
+	if (!hl_device_operational(hdev, &status))
  		return -EBUSY;
-	}
 
  	if ((args->in.cs_flags & HL_CS_FLAGS_STAGED_SUBMISSION) &&
  			!hdev->supports_staged_submission) {

Thanks for the patch.

Applied to -next.
Oded