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

scsi: bfa: Convert bfad_reset_sdev_bflags() from a macro into a function

Before modifying bfad_reset_sdev_bflags(), convert it from a macro into a
function.

Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20221031224728.2607760-4-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
2e5a6c3b 379e2554

+27 -26
+27
drivers/scsi/bfa/bfad_bsg.c
··· 2540 2540 return 0; 2541 2541 } 2542 2542 2543 + /* 2544 + * Set the SCSI device sdev_bflags - sdev_bflags are used by the 2545 + * SCSI mid-layer to choose LUN Scanning mode REPORT_LUNS vs. Sequential Scan 2546 + * 2547 + * Internally iterates over all the ITNIM's part of the im_port & sets the 2548 + * sdev_bflags for the scsi_device associated with LUN #0. 2549 + */ 2550 + static void bfad_reset_sdev_bflags(struct bfad_im_port_s *im_port, 2551 + int lunmask_cfg) 2552 + { 2553 + const u32 scan_flags = BLIST_NOREPORTLUN | BLIST_SPARSELUN; 2554 + struct bfad_itnim_s *itnim; 2555 + struct scsi_device *sdev; 2556 + 2557 + list_for_each_entry(itnim, &im_port->itnim_mapped_list, list_entry) { 2558 + sdev = scsi_device_lookup(im_port->shost, itnim->channel, 2559 + itnim->scsi_tgt_id, 0); 2560 + if (sdev) { 2561 + if (lunmask_cfg == BFA_TRUE) 2562 + sdev->sdev_bflags |= scan_flags; 2563 + else 2564 + sdev->sdev_bflags &= ~scan_flags; 2565 + scsi_device_put(sdev); 2566 + } 2567 + } 2568 + } 2569 + 2543 2570 /* Function to reset the LUN SCAN mode */ 2544 2571 static void 2545 2572 bfad_iocmd_lunmask_reset_lunscan_mode(struct bfad_s *bfad, int lunmask_cfg)
-26
drivers/scsi/bfa/bfad_im.h
··· 198 198 int bfad_im_bsg_request(struct bsg_job *job); 199 199 int bfad_im_bsg_timeout(struct bsg_job *job); 200 200 201 - /* 202 - * Macro to set the SCSI device sdev_bflags - sdev_bflags are used by the 203 - * SCSI mid-layer to choose LUN Scanning mode REPORT_LUNS vs. Sequential Scan 204 - * 205 - * Internally iterate's over all the ITNIM's part of the im_port & set's the 206 - * sdev_bflags for the scsi_device associated with LUN #0. 207 - */ 208 - #define bfad_reset_sdev_bflags(__im_port, __lunmask_cfg) do { \ 209 - struct scsi_device *__sdev = NULL; \ 210 - struct bfad_itnim_s *__itnim = NULL; \ 211 - u32 scan_flags = BLIST_NOREPORTLUN | BLIST_SPARSELUN; \ 212 - list_for_each_entry(__itnim, &((__im_port)->itnim_mapped_list), \ 213 - list_entry) { \ 214 - __sdev = scsi_device_lookup((__im_port)->shost, \ 215 - __itnim->channel, \ 216 - __itnim->scsi_tgt_id, 0); \ 217 - if (__sdev) { \ 218 - if ((__lunmask_cfg) == BFA_TRUE) \ 219 - __sdev->sdev_bflags |= scan_flags; \ 220 - else \ 221 - __sdev->sdev_bflags &= ~scan_flags; \ 222 - scsi_device_put(__sdev); \ 223 - } \ 224 - } \ 225 - } while (0) 226 - 227 201 #endif