i think you have done reverse, arguments have to be assigned to the variables and processed. but you are assigning some value of variables to the argument.so no use in argument.
If possible post your actual requirement
You´re absolutelly right.
I didn´t noticed that redundance.
Maybe the argument purpose was to define a default input parameter.
Due at Read_id funcion, the default statement at switch instruction performs that atribution, the sugested manner you posted, will not generate an unnused code assembled. However, in most compilers, that waste is warned and maybe it was the reason of the doubt in the thread.
you forgot to put a break in case 2, if you dont when you come to case 2 you will set the id to SENSOR3 and also execute the default case and so on, until find the break line, setting id to -1.
you also have redundancy in your code, as bigdogguro told you.