Need help I don’t understand this error message

Trying to have two fingerprint scanners open two separate doors and I keep getting error message such as “Redeclaration of unit8_t p” not sure what to do.

#include <Adafruit_Fingerprint.h>
#include <Stepper.h> //New

const int stepsPerRevolution = 200;
Stepper myStepper(stepsPerRevolution, 9, 11, 10, 6); // we use pins 9, 11, 10, 6

#if (defined(AVR) || defined(ESP8266)) && !defined(AVR_ATmega2560)
// For UNO and others without hardware serial, we must use software serial...
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
// Set up the serial port to use softwareserial..

SoftwareSerial mySerial1(2,3); //SoftwareSerial mySerial(2,3)
Adafruit_Fingerprint finger1= Adafruit_Fingerprint(&mySerial1);

SoftwareSerial mySerial2 (5,6);
Adafruit_Fingerprint finger2 = Adafruit_Fingerprint(&mySerial2);

#else
// On Leonardo/M0/etc, others with hardware serial, use hardware serial!
// #0 is green wire, #1 is white
#define Serial1
#define Serial2
#endif

void setup()
{
Serial.begin(9600);
while (!Serial); // For Yun/Leo/Micro/Zero/...
delay(100);
Serial.println("\n\nAdafruit finger detect test");

// set the data rate for the sensor serial port
finger1.begin(57600);
finger2.begin(57600);
delay(5);
if (finger1.verifyPassword()) {
Serial.println("Found fingerprint sensor!");

} else {
Serial.println("Did not find fingerprint sensor :(");
while (1) { delay(1000); }
}

if (finger2.verifyPassword()) {
Serial.println("Found fingerprint sensor!");

} else {
Serial.println("Did not find fingerprint sensor :(");
while (1) { delay(1000); }

Serial.println(F("Reading sensor parameters"));
finger1.getParameters();
finger2.getParameters();
Serial.print(F("Status: 0x")); Serial.println(finger1.status_reg, HEX);
Serial.print(F("Sys ID: 0x")); Serial.println(finger1.system_id, HEX);
Serial.print(F("Capacity: ")); Serial.println(finger1.capacity);
Serial.print(F("Security level: ")); Serial.println(finger1.security_level);
Serial.print(F("Device address: ")); Serial.println(finger1.device_addr, HEX);
Serial.print(F("Packet len: ")); Serial.println(finger1.packet_len);
Serial.print(F("Baud rate: ")); Serial.println(finger1.baud_rate);

Serial.print(F("Status: 0x")); Serial.println(finger2.status_reg, HEX);
Serial.print(F("Sys ID: 0x")); Serial.println(finger2.system_id, HEX);
Serial.print(F("Capacity: ")); Serial.println(finger2.capacity);
Serial.print(F("Security level: ")); Serial.println(finger2.security_level);
Serial.print(F("Device address: ")); Serial.println(finger2.device_addr, HEX);
Serial.print(F("Packet len: ")); Serial.println(finger2.packet_len);
Serial.print(F("Baud rate: ")); Serial.println(finger2.baud_rate);

finger1.getTemplateCount();
finger2.getTemplateCount();

if (finger1.templateCount == 0) {
Serial.print("Sensor doesn't contain any fingerprint data. Please run the 'enroll' example.");
}
else {
Serial.println("Waiting for valid finger...");
Serial.print("Sensor contains "); Serial.print(finger1.templateCount); Serial.println(" templates");
}

if (finger2.templateCount == 0) {
Serial.print("Sensor doesn't contain any fingerprint data. Please run the 'enroll' example.");
}
else {
Serial.println("Waiting for valid finger...");
Serial.print("Sensor contains "); Serial.print(finger2.templateCount); Serial.println(" templates");
}

}
}
void loop() { // run over and over again

uint8_t getFingerprintID1();
delay(1000); //Changed, orginial (50) //don't ned to run this at full speed.
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
uint8_t getFingerprintID2();
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:

}
uint8_t getFingerprintID1(){
uint8_t p = finger1.getImage();

switch (p) {
case FINGERPRINT_OK:
Serial.println("Image taken");
break;
case FINGERPRINT_NOFINGER:
Serial.println("No finger detected");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
return p;
case FINGERPRINT_IMAGEFAIL:
Serial.println("Imaging error");
return p;
default:
Serial.println("Unknown error");
return p;
}

// OK success!

p = finger1.image2Tz();

switch (p) {
case FINGERPRINT_OK:
Serial.println("Image converted");
break;
case FINGERPRINT_IMAGEMESS:
Serial.println("Image too messy");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println("Could not find fingerprint features");
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println("Could not find fingerprint features");
return p;
default:
Serial.println("Unknown error");
return p;
}

// OK converted!
p = finger1.fingerSearch();

if (p == FINGERPRINT_OK) {
Serial.println("Found a match"); // initialize the serial port:
myStepper.setSpeed(90);// Motor speed2
Serial.begin(9600);//Serial code
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Communication error");
return p;
} else if (p == FINGERPRINT_NOTFOUND) {
tone(5,3000,1000); //Code for the buzzer to sound when you cannot find a fingerprint.
Serial.println("tone on"); //Displays on serial monitor that the tone is on.
Serial.println("Did not find a match");
return p;
} else {
Serial.println("Unknown error");
return p;
}

// found a match!
Serial.print("Found ID #"); Serial.print(finger1.fingerID);
Serial.print("Found ID #"); Serial.print(finger2.fingerID);
Serial.print(" with confidence of "); Serial.println(finger1.confidence);
Serial.print(" with confidence of "); Serial.println(finger2.confidence);
return finger1.fingerID;
return finger2.fingerID;
}

// returns -1 if failed, otherwise returns ID #
uint8_t getFingerprintIDez(){
uint8_t p = finger1.getImage();
uint8_t p = finger2.getImage(); // Error in the code "redeclaration of unit8_t p'
if (p != FINGERPRINT_OK) return -1;

}

p = finger1.image2Tz();
p = finger2.image2Tz();
if (p != FINGERPRINT_OK) return -1;
p = finger1.fingerFastSearch();
p = finger2.fingerFastSearch();

if (p != FINGERPRINT_OK)return -1;

// found a match!
Serial.print("Found ID #"); Serial.print(finger1.fingerID);
Serial.print(" with confidence of "); Serial.println(finger1.confidence);
Serial.print("Found ID #"); Serial.print(finger2.fingerID);
Serial.print(" with confidence of "); Serial.println(finger2.confidence);
return finger1.fingerID;
return finger2.fingerID;
}

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

[code]
  uint8_t p = finger1.getImage();
  uint8_t p = finger2.getImage(); // Error in the code "redeclaration of unit8_t p'
[/code]

You have declared the same variable twice, hence the error. If you need two variables then give them a different name from each other

Your problems are mostly in getFingerprintIDez(), which you never use. You can delete that function and the compile errors will go away.

WARNING: When you have two instances of SoftwareSerial, only one can be listening for input at a time.

SoftwareSerial mySerial1(2, 3); //SoftwareSerial mySerial(2,3)
SoftwareSerial mySerial2 (5, 6);

This might be OK if the fingerprint readers only reply when prompted.

Rather than having two copies of getFingerprintID(), neither of which you actually called, you can pass a reference to the reader to a single function:

#include <Adafruit_Fingerprint.h>
#include <Stepper.h> //New

const int stepsPerRevolution = 200;
Stepper myStepper(stepsPerRevolution, 9, 11, 10, 6); // we use pins 9, 11, 10, 6

#if (defined(AVR) || defined(ESP8266)) && !defined(AVR_ATmega2560)
// For UNO and others without hardware serial, we must use software serial...
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
// Set up the serial port to use softwareserial..

SoftwareSerial mySerial1(2, 3); //SoftwareSerial mySerial(2,3)
Adafruit_Fingerprint finger1 = Adafruit_Fingerprint(&mySerial1);

SoftwareSerial mySerial2 (5, 6);
Adafruit_Fingerprint finger2 = Adafruit_Fingerprint(&mySerial2);

#else
// On Leonardo/M0/etc, others with hardware serial, use hardware serial!
// #0 is green wire, #1 is white
#define Serial1
#define Serial2
#endif

void setup()
{
  Serial.begin(9600);
  while (!Serial); // For Yun/Leo/Micro/Zero/...
  delay(100);
  Serial.println("\n\nAdafruit finger detect test");

  // set the data rate for the sensor serial port
  finger1.begin(57600);
  finger2.begin(57600);
  delay(5);
  if (finger1.verifyPassword())
  {
    Serial.println("Found fingerprint sensor!");

  }
  else
  {
    Serial.println("Did not find fingerprint sensor :(");
    while (1)
    {
      delay(1000);
    }
  }

  if (finger2.verifyPassword())
  {
    Serial.println("Found fingerprint sensor!");
  }
  else
  {
    Serial.println("Did not find fingerprint sensor :(");
    while (1)
    {
      delay(1000);
    }

    Serial.println(F("Reading sensor parameters"));
    finger1.getParameters();
    finger2.getParameters();
    Serial.print(F("Status: 0x")); Serial.println(finger1.status_reg, HEX);
    Serial.print(F("Sys ID: 0x")); Serial.println(finger1.system_id, HEX);
    Serial.print(F("Capacity: ")); Serial.println(finger1.capacity);
    Serial.print(F("Security level: ")); Serial.println(finger1.security_level);
    Serial.print(F("Device address: ")); Serial.println(finger1.device_addr, HEX);
    Serial.print(F("Packet len: ")); Serial.println(finger1.packet_len);
    Serial.print(F("Baud rate: ")); Serial.println(finger1.baud_rate);

    Serial.print(F("Status: 0x")); Serial.println(finger2.status_reg, HEX);
    Serial.print(F("Sys ID: 0x")); Serial.println(finger2.system_id, HEX);
    Serial.print(F("Capacity: ")); Serial.println(finger2.capacity);
    Serial.print(F("Security level: ")); Serial.println(finger2.security_level);
    Serial.print(F("Device address: ")); Serial.println(finger2.device_addr, HEX);
    Serial.print(F("Packet len: ")); Serial.println(finger2.packet_len);
    Serial.print(F("Baud rate: ")); Serial.println(finger2.baud_rate);

    finger1.getTemplateCount();
    finger2.getTemplateCount();

    if (finger1.templateCount == 0)
    {
      Serial.print("Sensor doesn't contain any fingerprint data. Please run the 'enroll' example.");
    }
    else
    {
      Serial.println("Waiting for valid finger...");
      Serial.print("Sensor contains "); Serial.print(finger1.templateCount); Serial.println(" templates");
    }

    if (finger2.templateCount == 0)
    {
      Serial.print("Sensor doesn't contain any fingerprint data. Please run the 'enroll' example.");
    }
    else
    {
      Serial.println("Waiting for valid finger...");
      Serial.print("Sensor contains "); Serial.print(finger2.templateCount); Serial.println(" templates");
    }

  }
}

void loop()   // run over and over again
{
  int ID1 = getFingerprintID(finger1);
  if (ID1 != -1)
  {
    delay(1000); //Changed, orginial (50) //don't ned to run this at full speed.
    Serial.println("counterclockwise");
    myStepper.step(-stepsPerRevolution);
    delay(500);
  }

  int ID2 = getFingerprintID(finger2);
  if (ID2 != -1)
  {
    Serial.println("clockwise");
    myStepper.step(stepsPerRevolution);
    delay(500);
    // step one revolution in the other direction:
  }
}

int getFingerprintID(Adafruit_Fingerprint finger)
{
  uint8_t p = finger.getImage();

  switch (p)
  {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.println("No finger detected");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }

  // OK success!

  p = finger.image2Tz();

  switch (p)
  {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return -1;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return -1;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return -1;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return -1;
    default:
      Serial.println("Unknown error");
      return -1;
  }

  // OK converted!
  p = finger.fingerSearch();

  if (p == FINGERPRINT_OK)
  {
    Serial.println("Found a match"); // initialize the serial port:
    myStepper.setSpeed(90); // Motor speed2
    Serial.begin(9600); //Serial code
  }
  else if (p == FINGERPRINT_PACKETRECIEVEERR)
  {
    Serial.println("Communication error");
    return -1;
  }
  else if (p == FINGERPRINT_NOTFOUND)
  {
    tone(5, 3000, 1000); //Code for the buzzer to sound when you cannot find a fingerprint.
    Serial.println("tone on"); //Displays on serial monitor that the tone is on.
    Serial.println("Did not find a match");
    return -1;
  }
  else
  {
    Serial.println("Unknown error");
    return -1;
  }

  // found a match!
  Serial.print("Found ID #"); Serial.print(finger.fingerID);
  Serial.print(" with confidence of "); Serial.println(finger1.confidence);
  return finger.fingerID;
}

Thank you!