Re: [PATCH v2 2/2] scsi: qla1280: Fix DEBUG_QLA1280 compilation issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2021-08-19 at 11:07 -0700, Bart Van Assche wrote:
> On 8/19/21 2:32 AM, John Garry wrote:
> > The driver does not compile under DEBUG_QLA1280 flag:
> > - Debug statements expect an integer for printing a SCSI lun value,
> > but
> >    its size is 64b. So change SCSI_LUN_32() to cast to an int, as
> > would be
> >    expected from a "_32" function.
> > - lower_32_bits() expects %x, as opposed to %lx, so fix that.
> > 
> > Also delete ql1280_dump_device(), which looks to have never been
> > referenced.
> > 
> > Signed-off-by: John Garry <john.garry@xxxxxxxxxx>
> > ---
> >   drivers/scsi/qla1280.c | 27 ++-------------------------
> >   1 file changed, 2 insertions(+), 25 deletions(-)
> > 
> > diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
> > index b4f7d8d7a01c..9a7e84b49d41 100644
> > --- a/drivers/scsi/qla1280.c
> > +++ b/drivers/scsi/qla1280.c
> > @@ -494,7 +494,7 @@ __setup("qla1280=", qla1280_setup);
> >   #define CMD_HOST(Cmnd)		Cmnd->device->host
> >   #define SCSI_BUS_32(Cmnd)	Cmnd->device->channel
> >   #define SCSI_TCN_32(Cmnd)	Cmnd->device->id
> > -#define SCSI_LUN_32(Cmnd)	Cmnd->device->lun
> > +#define SCSI_LUN_32(Cmnd)	((int)Cmnd->device->lun)
> 
> How about using 'unsigned int' instead of 'int' since LUN numbers
> are positive integers?

All the use points in the driver are ints currently so matching the use
makes more sense than matching the standard and risking signed to
unsigned conversion warnings.

James





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux