Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: bfa: Remove unused parsers

bfa has a set of structure parsers, of which quite a few are unused.
Remove the unused set.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20241117135215.38771-3-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Dr. David Alan Gilbert and committed by
Martin K. Petersen
575143ab 52172a35

-151
-134
drivers/scsi/bfa/bfa_fcbuild.c
··· 260 260 } 261 261 262 262 enum fc_parse_status 263 - fc_plogi_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name) 264 - { 265 - struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1); 266 - struct fc_logi_s *plogi; 267 - struct fc_ls_rjt_s *ls_rjt; 268 - 269 - switch (els_cmd->els_code) { 270 - case FC_ELS_LS_RJT: 271 - ls_rjt = (struct fc_ls_rjt_s *) (fchs + 1); 272 - if (ls_rjt->reason_code == FC_LS_RJT_RSN_LOGICAL_BUSY) 273 - return FC_PARSE_BUSY; 274 - else 275 - return FC_PARSE_FAILURE; 276 - case FC_ELS_ACC: 277 - plogi = (struct fc_logi_s *) (fchs + 1); 278 - if (len < sizeof(struct fc_logi_s)) 279 - return FC_PARSE_FAILURE; 280 - 281 - if (!wwn_is_equal(plogi->port_name, port_name)) 282 - return FC_PARSE_FAILURE; 283 - 284 - if (!plogi->class3.class_valid) 285 - return FC_PARSE_FAILURE; 286 - 287 - if (be16_to_cpu(plogi->class3.rxsz) < (FC_MIN_PDUSZ)) 288 - return FC_PARSE_FAILURE; 289 - 290 - return FC_PARSE_OK; 291 - default: 292 - return FC_PARSE_FAILURE; 293 - } 294 - } 295 - 296 - enum fc_parse_status 297 263 fc_plogi_parse(struct fchs_s *fchs) 298 264 { 299 265 struct fc_logi_s *plogi = (struct fc_logi_s *) (fchs + 1); ··· 326 360 return FC_PARSE_FAILURE; 327 361 328 362 if (prli->parampage.servparams.target != 1) 329 - return FC_PARSE_FAILURE; 330 - 331 - return FC_PARSE_OK; 332 - } 333 - 334 - enum fc_parse_status 335 - fc_prli_parse(struct fc_prli_s *prli) 336 - { 337 - if (prli->parampage.type != FC_TYPE_FCP) 338 - return FC_PARSE_FAILURE; 339 - 340 - if (!prli->parampage.imagepair) 341 - return FC_PARSE_FAILURE; 342 - 343 - if (!prli->parampage.servparams.initiator) 344 363 return FC_PARSE_FAILURE; 345 364 346 365 return FC_PARSE_OK; ··· 399 448 return FC_PARSE_FAILURE; 400 449 401 450 return FC_PARSE_OK; 402 - } 403 - 404 - enum fc_parse_status 405 - fc_adisc_parse(struct fchs_s *fchs, void *pld, u32 host_dap, wwn_t node_name, 406 - wwn_t port_name) 407 - { 408 - struct fc_adisc_s *adisc = (struct fc_adisc_s *) pld; 409 - 410 - if (adisc->els_cmd.els_code != FC_ELS_ACC) 411 - return FC_PARSE_FAILURE; 412 - 413 - if ((adisc->nport_id == (host_dap)) 414 - && wwn_is_equal(adisc->orig_port_name, port_name) 415 - && wwn_is_equal(adisc->orig_node_name, node_name)) 416 - return FC_PARSE_OK; 417 - 418 - return FC_PARSE_FAILURE; 419 - } 420 - 421 - enum fc_parse_status 422 - fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, wwn_t port_name) 423 - { 424 - struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1); 425 - 426 - if (pdisc->class3.class_valid != 1) 427 - return FC_PARSE_FAILURE; 428 - 429 - if ((be16_to_cpu(pdisc->class3.rxsz) < 430 - (FC_MIN_PDUSZ - sizeof(struct fchs_s))) 431 - || (pdisc->class3.rxsz == 0)) 432 - return FC_PARSE_FAILURE; 433 - 434 - if (!wwn_is_equal(pdisc->port_name, port_name)) 435 - return FC_PARSE_FAILURE; 436 - 437 - if (!wwn_is_equal(pdisc->node_name, node_name)) 438 - return FC_PARSE_FAILURE; 439 - 440 - return FC_PARSE_OK; 441 - } 442 - 443 - enum fc_parse_status 444 - fc_abts_rsp_parse(struct fchs_s *fchs, int len) 445 - { 446 - if ((fchs->cat_info == FC_CAT_BA_ACC) 447 - || (fchs->cat_info == FC_CAT_BA_RJT)) 448 - return FC_PARSE_OK; 449 - 450 - return FC_PARSE_FAILURE; 451 451 } 452 452 453 453 u16 ··· 568 666 return sizeof(struct fc_rpsc_acc_s); 569 667 } 570 668 571 - u16 572 - fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name) 573 - { 574 - struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1); 575 - 576 - if (len < sizeof(struct fc_logi_s)) 577 - return FC_PARSE_LEN_INVAL; 578 - 579 - if (pdisc->els_cmd.els_code != FC_ELS_ACC) 580 - return FC_PARSE_ACC_INVAL; 581 - 582 - if (!wwn_is_equal(pdisc->port_name, port_name)) 583 - return FC_PARSE_PWWN_NOT_EQUAL; 584 - 585 - if (!pdisc->class3.class_valid) 586 - return FC_PARSE_NWWN_NOT_EQUAL; 587 - 588 - if (be16_to_cpu(pdisc->class3.rxsz) < (FC_MIN_PDUSZ)) 589 - return FC_PARSE_RXSZ_INVAL; 590 - 591 - return FC_PARSE_OK; 592 - } 593 - 594 669 static void 595 670 fc_gs_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code) 596 671 { ··· 629 750 memset(gpnid, 0, sizeof(fcgs_gpnid_req_t)); 630 751 gpnid->dap = port_id; 631 752 return sizeof(fcgs_gpnid_req_t) + sizeof(struct ct_hdr_s); 632 - } 633 - 634 - u16 635 - fc_ct_rsp_parse(struct ct_hdr_s *cthdr) 636 - { 637 - if (be16_to_cpu(cthdr->cmd_rsp_code) != CT_RSP_ACCEPT) { 638 - if (cthdr->reason_code == CT_RSN_LOGICAL_BUSY) 639 - return FC_PARSE_BUSY; 640 - else 641 - return FC_PARSE_FAILURE; 642 - } 643 - 644 - return FC_PARSE_OK; 645 753 } 646 754 647 755 u16
-17
drivers/scsi/bfa/bfa_fcbuild.h
··· 139 139 140 140 enum fc_parse_status fc_plogi_parse(struct fchs_s *fchs); 141 141 142 - enum fc_parse_status fc_abts_rsp_parse(struct fchs_s *buf, int len); 143 - 144 142 u16 fc_rspnid_build(struct fchs_s *fchs, void *pld, u32 s_id, 145 143 u16 ox_id, u8 *name); 146 144 u16 fc_rsnn_nn_build(struct fchs_s *fchs, void *pld, u32 s_id, ··· 171 173 u16 fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, 172 174 u32 d_id, u32 s_id, __be16 ox_id, wwn_t port_name, 173 175 wwn_t node_name); 174 - 175 - enum fc_parse_status fc_adisc_parse(struct fchs_s *fchs, void *pld, 176 - u32 host_dap, wwn_t node_name, wwn_t port_name); 177 176 178 177 enum fc_parse_status fc_adisc_rsp_parse(struct fc_adisc_s *adisc, int len, 179 178 wwn_t port_name, wwn_t node_name); ··· 225 230 void fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, 226 231 __be16 ox_id); 227 232 228 - enum fc_parse_status fc_plogi_rsp_parse(struct fchs_s *fchs, int len, 229 - wwn_t port_name); 230 - 231 - enum fc_parse_status fc_prli_parse(struct fc_prli_s *prli); 232 - 233 - enum fc_parse_status fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, 234 - wwn_t port_name); 235 - 236 233 u16 fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id, 237 234 u32 s_id, __be16 ox_id, u16 rx_id); 238 235 ··· 233 246 u16 fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, 234 247 u32 d_id, u32 s_id, __be16 ox_id, int num_pages); 235 248 236 - u16 fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name); 237 - 238 249 u16 fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, 239 250 u16 ox_id, int num_pages, enum fc_tprlo_type tprlo_type, 240 251 u32 tpr_id); 241 - 242 - u16 fc_ct_rsp_parse(struct ct_hdr_s *cthdr); 243 252 244 253 #endif