diff mbox series

[v2,2/3] mctp pcc: Allow PCC Data Type in MCTP resource.

Message ID 20240528191823.17775-3-admiyo@os.amperecomputing.com (mailing list archive)
State Changes Requested
Headers show
Series MCTP over PCC | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 904 this patch: 904
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 2 maintainers not CCed: acpica-devel@lists.linux.dev linux-acpi@vger.kernel.org
netdev/build_clang success Errors and warnings before: 906 this patch: 906
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 908 this patch: 908
netdev/checkpatch warning CHECK: Unnecessary parentheses around 'address.resource_type != 10' CHECK: Unnecessary parentheses around 'address.resource_type < 0xC0' CHECK: Unnecessary parentheses around 'address.resource_type > 2' WARNING: From:/Signed-off-by: email address mismatch: 'From: Adam Young <admiyo@amperecomputing.com>' != 'Signed-off-by: Adam Young <admiyo@os.amperecomputing.com>' WARNING: braces {} are not necessary for single statement blocks WARNING: line length of 109 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

admiyo@os.amperecomputing.com May 28, 2024, 7:18 p.m. UTC
From: Adam Young <admiyo@amperecomputing.com>

Note that this patch sfor code that will be merged
in via ACPICA changes.  The corresponding patch in ACPCA
has already merged.

Signed-off-by: Adam Young <admiyo@os.amperecomputing.com>
---
 drivers/acpi/acpica/rsaddr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ratheesh Kannoth May 29, 2024, 3:25 a.m. UTC | #1
On 2024-05-29 at 00:48:22, admiyo@os.amperecomputing.com (admiyo@os.amperecomputing.com) wrote:
> From: Adam Young <admiyo@amperecomputing.com>
> --- a/drivers/acpi/acpica/rsaddr.c
> +++ b/drivers/acpi/acpica/rsaddr.c
> @@ -282,7 +282,7 @@ acpi_rs_get_address_common(struct acpi_resource *resource,
>
>  	/* Validate the Resource Type */
>
> -	if ((address.resource_type > 2) && (address.resource_type < 0xC0)) {
> +	if ((address.resource_type > 2) && (address.resource_type < 0xC0) && (address.resource_type != 10)) {
use macros or enums instead of hard coded numbers. That will improve code readability.

>  		return (FALSE);
>  	}
>
> --
> 2.34.1
>
Adam Young May 30, 2024, 4:24 p.m. UTC | #2
On 5/28/24 23:25, Ratheesh Kannoth wrote:
> On 2024-05-29 at 00:48:22, admiyo@os.amperecomputing.com (admiyo@os.amperecomputing.com) wrote:
>> From: Adam Young <admiyo@amperecomputing.com>
>> --- a/drivers/acpi/acpica/rsaddr.c
>> +++ b/drivers/acpi/acpica/rsaddr.c
>> @@ -282,7 +282,7 @@ acpi_rs_get_address_common(struct acpi_resource *resource,
>>
>>   	/* Validate the Resource Type */
>>
>> -	if ((address.resource_type > 2) && (address.resource_type < 0xC0)) {
>> +	if ((address.resource_type > 2) && (address.resource_type < 0xC0) && (address.resource_type != 10)) {
> use macros or enums instead of hard coded numbers. That will improve code readability.

In general I agree, but this code is generated  from ACPICA and will not 
be directly commited.  The corresponding patch to acpica has already 
merged. What you see here is what the code will look like post-process 
from ACPICA conversion.


>
>>   		return (FALSE);
>>   	}
>>
>> --
>> 2.34.1
>>
diff mbox series

Patch

diff --git a/drivers/acpi/acpica/rsaddr.c b/drivers/acpi/acpica/rsaddr.c
index fff48001d7ef..6bd9704f17b0 100644
--- a/drivers/acpi/acpica/rsaddr.c
+++ b/drivers/acpi/acpica/rsaddr.c
@@ -282,7 +282,7 @@  acpi_rs_get_address_common(struct acpi_resource *resource,
 
 	/* Validate the Resource Type */
 
-	if ((address.resource_type > 2) && (address.resource_type < 0xC0)) {
+	if ((address.resource_type > 2) && (address.resource_type < 0xC0) && (address.resource_type != 10)) {
 		return (FALSE);
 	}