diff mbox series

[v1] drivers:coresight:Use min macro

Message ID 20240822073600.1359333-1-11162571@vivo.com (mailing list archive)
State New, archived
Headers show
Series [v1] drivers:coresight:Use min macro | expand

Commit Message

Yang Ruibin Aug. 22, 2024, 7:36 a.m. UTC
Instead of using the min() implementation of
the ternary operator, use real macros.

Signed-off-by: Yang Ruibin <11162571@vivo.com>
---
 drivers/hwtracing/coresight/coresight-catu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Yang Ruibin Aug. 22, 2024, 9:41 a.m. UTC | #1
Sorry, please ignore this patch.
Because the corresponding header file is not included, there may be 
compilation errors.

在 2024/8/22 15:36, Yang Ruibin 写道:
> Instead of using the min() implementation of
> the ternary operator, use real macros.
>
> Signed-off-by: Yang Ruibin <11162571@vivo.com>
> ---
>   drivers/hwtracing/coresight/coresight-catu.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c
> index bfea880d6..7ea67d56e 100644
> --- a/drivers/hwtracing/coresight/coresight-catu.c
> +++ b/drivers/hwtracing/coresight/coresight-catu.c
> @@ -152,8 +152,7 @@ static void catu_dump_table(struct tmc_sg_table *catu_table)
>   		catu_table, catu_table->table_daddr);
>   
>   	while (offset < buf_size) {
> -		table_end = offset + SZ_1M < buf_size ?
> -			    offset + SZ_1M : buf_size;
> +		table_end = min(offset + SZ_1M, buf_size);
>   		table = catu_get_table(catu_table, offset, NULL);
>   		for (i = 0; offset < table_end; i++, offset += CATU_PAGE_SIZE)
>   			dev_dbg(catu_table->dev, "%d: %llx\n", i, table[i]);
diff mbox series

Patch

diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c
index bfea880d6..7ea67d56e 100644
--- a/drivers/hwtracing/coresight/coresight-catu.c
+++ b/drivers/hwtracing/coresight/coresight-catu.c
@@ -152,8 +152,7 @@  static void catu_dump_table(struct tmc_sg_table *catu_table)
 		catu_table, catu_table->table_daddr);
 
 	while (offset < buf_size) {
-		table_end = offset + SZ_1M < buf_size ?
-			    offset + SZ_1M : buf_size;
+		table_end = min(offset + SZ_1M, buf_size);
 		table = catu_get_table(catu_table, offset, NULL);
 		for (i = 0; offset < table_end; i++, offset += CATU_PAGE_SIZE)
 			dev_dbg(catu_table->dev, "%d: %llx\n", i, table[i]);