sm501: Clean up local variables in sm501_2d_operation