Skip to content

Commit

Permalink
[CWS] remove useless kv.Code != 0 checks (DataDog#32789)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux authored Jan 9, 2025
1 parent c8aab9b commit 50b30dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/security/probe/constantfetch/fallback.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ func getBpfProgAuxIDOffset(kv *kernel.Version) uint64 {
idOffset = 24
case kv.IsInRangeCloseOpen(kernel.Kernel5_8, kernel.Kernel5_13):
idOffset = 28
case kv.Code != 0 && kv.Code >= kernel.Kernel5_13:
case kv.Code >= kernel.Kernel5_13:
idOffset = 32
}

Expand Down Expand Up @@ -483,7 +483,7 @@ func getBpfProgAuxNameOffset(kv *kernel.Version) uint64 {
nameOffset = 544
case kv.IsInRangeCloseOpen(kernel.Kernel5_17, kernel.Kernel6_1):
nameOffset = 528
case kv.Code != 0 && kv.Code >= kernel.Kernel6_1:
case kv.Code >= kernel.Kernel6_1:
nameOffset = 912
}

Expand Down Expand Up @@ -588,7 +588,7 @@ func getPipeInodeInfoBufsOffset(kv *kernel.Version) uint64 {
case kv.IsInRangeCloseOpen(kernel.Kernel5_6, kernel.Kernel5_8) ||
kv.IsInRangeCloseOpen(kernel.Kernel5_10, kernel.Kernel5_11):
offset = 144
case kv.Code != 0 && kv.Code >= kernel.Kernel5_8:
case kv.Code >= kernel.Kernel5_8:
offset = 152
}

Expand Down

0 comments on commit 50b30dd

Please sign in to comment.