Skip to content

Commit

Permalink
WIP fix hiffy
Browse files Browse the repository at this point in the history
  • Loading branch information
cbiffle committed May 6, 2024
1 parent e9ee461 commit bc804be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions task/hiffy/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub(crate) fn send(

let op = match stack[fp + 1] {
Some(op) => {
if op > core::u16::MAX.into() {
if op > u16::MAX.into() {
return Err(Failure::Fault(Fault::BadParameter(1)));
}

Expand All @@ -136,7 +136,7 @@ pub(crate) fn send(
for i in base..base + nbytes {
payload[i - base] = match stack[i] {
Some(byte) => {
if byte > core::u8::MAX.into() {
if byte > u8::MAX.into() {
return Err(Failure::Fault(Fault::BadParameter(2)));
}

Expand Down Expand Up @@ -238,7 +238,7 @@ pub(crate) fn send_lease_read(

let op = match stack[fp + 1] {
Some(op) => {
if op > core::u16::MAX.into() {
if op > u16::MAX.into() {
return Err(Failure::Fault(Fault::BadParameter(1)));
}

Expand All @@ -261,7 +261,7 @@ pub(crate) fn send_lease_read(
for i in base..base + nbytes {
payload[i - base] = match stack[i] {
Some(byte) => {
if byte > core::u8::MAX.into() {
if byte > u8::MAX.into() {
return Err(Failure::Fault(Fault::BadParameter(2)));
}

Expand Down Expand Up @@ -365,7 +365,7 @@ pub(crate) fn send_lease_write(

let op = match stack[fp + 1] {
Some(op) => {
if op > core::u16::MAX.into() {
if op > u16::MAX.into() {
return Err(Failure::Fault(Fault::BadParameter(1)));
}

Expand All @@ -388,7 +388,7 @@ pub(crate) fn send_lease_write(
for i in base..base + nbytes {
payload[i - base] = match stack[i] {
Some(byte) => {
if byte > core::u8::MAX.into() {
if byte > u8::MAX.into() {
return Err(Failure::Fault(Fault::BadParameter(2)));
}

Expand Down Expand Up @@ -518,7 +518,7 @@ pub(crate) fn send_lease_read_write(
// get id of the operation we've been asked to call
let op = match stack[fp + 1] {
Some(op) => {
if op > core::u16::MAX.into() {
if op > u16::MAX.into() {
return Err(Failure::Fault(Fault::BadParameter(1)));
}

Expand All @@ -539,7 +539,7 @@ pub(crate) fn send_lease_read_write(
for i in base..base + nbytes {
payload[i - base] = match stack[i] {
Some(byte) => {
if byte > core::u8::MAX.into() {
if byte > u8::MAX.into() {
return Err(Failure::Fault(Fault::BadParameter(2)));
}

Expand Down
2 changes: 1 addition & 1 deletion task/hiffy/src/stm32g0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn i2c_args_to_device(
// and correctly specify a port index: this is an error.
//
let port = stack[1].ok_or(Fault::EmptyParameter(1))?;
let port = if port > core::u8::MAX.into() {
let port = if port > u8::MAX.into() {
return Err(Failure::Fault(Fault::BadParameter(1)));
} else {
PortIndex(port as u8)
Expand Down
2 changes: 1 addition & 1 deletion task/hiffy/src/stm32h7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ fn i2c_args(

let port = match stack[1] {
Some(port) => {
if port > core::u8::MAX.into() {
if port > u8::MAX.into() {
return Err(Failure::Fault(Fault::BadParameter(1)));
}

Expand Down

0 comments on commit bc804be

Please sign in to comment.