mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-24 19:44:55 +00:00
[SCSI] fnic: remove redundant BUG_ONs and fix checks on unsigned
The shost sg tablesize is set to FNIC_MAX_SG_DESC_CNT and fnic uses scsi_dma_map, so both BUG_ONs can be removed. scsi_dma_map may return -ENOMEM, sg_count should be int to catch that. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
This commit is contained in:
parent
e08afeb7e6
commit
87a2d34b03
@ -245,7 +245,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
|
|||||||
struct vnic_wq_copy *wq,
|
struct vnic_wq_copy *wq,
|
||||||
struct fnic_io_req *io_req,
|
struct fnic_io_req *io_req,
|
||||||
struct scsi_cmnd *sc,
|
struct scsi_cmnd *sc,
|
||||||
u32 sg_count)
|
int sg_count)
|
||||||
{
|
{
|
||||||
struct scatterlist *sg;
|
struct scatterlist *sg;
|
||||||
struct fc_rport *rport = starget_to_rport(scsi_target(sc->device));
|
struct fc_rport *rport = starget_to_rport(scsi_target(sc->device));
|
||||||
@ -260,9 +260,6 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
|
|||||||
char msg[2];
|
char msg[2];
|
||||||
|
|
||||||
if (sg_count) {
|
if (sg_count) {
|
||||||
BUG_ON(sg_count < 0);
|
|
||||||
BUG_ON(sg_count > FNIC_MAX_SG_DESC_CNT);
|
|
||||||
|
|
||||||
/* For each SGE, create a device desc entry */
|
/* For each SGE, create a device desc entry */
|
||||||
desc = io_req->sgl_list;
|
desc = io_req->sgl_list;
|
||||||
for_each_sg(scsi_sglist(sc), sg, sg_count, i) {
|
for_each_sg(scsi_sglist(sc), sg, sg_count, i) {
|
||||||
@ -344,7 +341,7 @@ int fnic_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
|
|||||||
struct fnic *fnic;
|
struct fnic *fnic;
|
||||||
struct vnic_wq_copy *wq;
|
struct vnic_wq_copy *wq;
|
||||||
int ret;
|
int ret;
|
||||||
u32 sg_count;
|
int sg_count;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned long ptr;
|
unsigned long ptr;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user