From: Tales Aparecida <tales.aparecida@gmail.com>
To: davidgow@google.com, "Harry Wentland" <harry.wentland@amd.com>,
"Leo Li" <sunpeng.li@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>
Cc: siqueirajordao@riseup.net, magalilemes00@gmail.com,
tales.aparecida@gmail.com, amd-gfx@lists.freedesktop.org,
mwen@igalia.com, mairacanal@riseup.net,
Isabella Basso <isabbasso@riseup.net>,
andrealmeid@riseup.net, Trevor Woerner <twoerner@gmail.com>
Subject: [PATCH 2/2] drm/amd/display: fix minor codestyle problems
Date: Thu, 11 Aug 2022 17:43:27 -0300 [thread overview]
Message-ID: <20220811204327.411709-3-tales.aparecida@gmail.com> (raw)
In-Reply-To: <20220811204327.411709-1-tales.aparecida@gmail.com>
Fixes five checkpatch warnings:
CHECK: Please don't use multiple blank lines
+
+
ERROR: Macros with complex values should be enclosed in parentheses
+#define MAX_I64 \
+ (int64_t)((1ULL << 63) - 1)
WARNING: Missing a blank line after declarations
+ struct bw_fixed res;
+ ASSERT(value < BW_FIXED_MAX_I32 && value > BW_FIXED_MIN_I32);
ERROR: that open brace { should be on the previous line
+ do
+ {
ERROR: that open brace { should be on the previous line
+ if (remainder >= arg2_value)
+ {
Signed-off-by: Tales Aparecida <tales.aparecida@gmail.com>
---
drivers/gpu/drm/amd/display/dc/dml/calcs/bw_fixed.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dml/calcs/bw_fixed.c b/drivers/gpu/drm/amd/display/dc/dml/calcs/bw_fixed.c
index 2d46bc527b21..3aa8dd0acd5e 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/calcs/bw_fixed.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/calcs/bw_fixed.c
@@ -25,9 +25,8 @@
#include "dm_services.h"
#include "bw_fixed.h"
-
#define MAX_I64 \
- (int64_t)((1ULL << 63) - 1)
+ ((int64_t)((1ULL << 63) - 1))
#define MIN_I64 \
(-MAX_I64 - 1)
@@ -49,6 +48,7 @@ static uint64_t abs_i64(int64_t arg)
struct bw_fixed bw_int_to_fixed_nonconst(int64_t value)
{
struct bw_fixed res;
+
ASSERT(value < BW_FIXED_MAX_I32 && value > BW_FIXED_MIN_I32);
res.value = value << BW_FIXED_BITS_PER_FRACTIONAL_PART;
return res;
@@ -78,14 +78,12 @@ struct bw_fixed bw_frc_to_fixed(int64_t numerator, int64_t denominator)
{
uint32_t i = BW_FIXED_BITS_PER_FRACTIONAL_PART;
- do
- {
+ do {
remainder <<= 1;
res_value <<= 1;
- if (remainder >= arg2_value)
- {
+ if (remainder >= arg2_value) {
res_value |= 1;
remainder -= arg2_value;
}
--
2.37.0
next prev parent reply other threads:[~2022-08-11 20:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 20:43 [PATCH 0/2] drm/amd/display: fix MIN_I64 overflow on bw_fixed.c Tales Aparecida
2022-08-11 20:43 ` [PATCH 1/2] drm/amd/display: fix overflow on MIN_I64 definition Tales Aparecida
2022-08-11 20:43 ` Tales Aparecida [this message]
2022-08-15 20:31 ` [PATCH 2/2] drm/amd/display: fix minor codestyle problems Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220811204327.411709-3-tales.aparecida@gmail.com \
--to=tales.aparecida@gmail.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrealmeid@riseup.net \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=davidgow@google.com \
--cc=harry.wentland@amd.com \
--cc=isabbasso@riseup.net \
--cc=magalilemes00@gmail.com \
--cc=mairacanal@riseup.net \
--cc=mwen@igalia.com \
--cc=siqueirajordao@riseup.net \
--cc=sunpeng.li@amd.com \
--cc=twoerner@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).