On 10/8/19 9:50 AM, Douglas Gilbert wrote: > Simple refactoring of the sg_vma_fault() function. > > Signed-off-by: Douglas Gilbert <dgilbert@xxxxxxxxxxxx> > --- > drivers/scsi/sg.c | 33 +++++++++++++++++++++++---------- > 1 file changed, 23 insertions(+), 10 deletions(-) > > diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c > index 903faafaeff9..befcbfbcece1 100644 > --- a/drivers/scsi/sg.c > +++ b/drivers/scsi/sg.c > @@ -1389,14 +1389,16 @@ sg_fasync(int fd, struct file *filp, int mode) > return fasync_helper(fd, filp, mode, &sfp->async_qp); > } > > +/* Note: the error return: VM_FAULT_SIGBUS causes a "bus error" */ > static vm_fault_t > sg_vma_fault(struct vm_fault *vmf) > { > - struct vm_area_struct *vma = vmf->vma; > - struct sg_fd *sfp; > + int k, length; > unsigned long offset, len, sa; > + struct vm_area_struct *vma = vmf->vma; > struct sg_scatter_hold *rsv_schp; > - int k, length; > + struct sg_device *sdp; > + struct sg_fd *sfp; > const char *nbp = "==NULL, bad"; > > if (!vma) { Of course, one would prefer normal kernel-doc style for the comment ... Otherwise: Reviewed-by: Hannes Reinecke <hare@xxxxxxxx> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 247165 (AG München), GF: Felix Imendörffer