Hi Douglas,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on v5.3-rc1 next-20190723]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/Douglas-Gilbert/sg-v4-interface-rq-sharing-multiple-rqs/20190525-161346
base:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/mkp/scsi.git 
for-next
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-rc1-7-g2b96cd8-dirty
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <l...@intel.com>


sparse warnings: (new ones prefixed by >>)

>> drivers/scsi/sg.c:2808:20: sparse: sparse: incorrect type in initializer 
>> (different base types) @@    expected int gfp @@    got restricted gfp_t 
>> [usertyint gfp @@
>> drivers/scsi/sg.c:2808:20: sparse:    expected int gfp
>> drivers/scsi/sg.c:2808:20: sparse:    got restricted gfp_t [usertype]
>> drivers/scsi/sg.c:2811:51: sparse: sparse: restricted gfp_t degrades to 
>> integer
>> drivers/scsi/sg.c:2811:49: sparse: sparse: incorrect type in argument 2 
>> (different base types) @@    expected restricted gfp_t [usertype] flags @@   
>>  got  [usertype] flags @@
>> drivers/scsi/sg.c:2811:49: sparse:    expected restricted gfp_t [usertype] 
>> flags
>> drivers/scsi/sg.c:2811:49: sparse:    got unsigned int
   drivers/scsi/sg.c:2813:51: sparse: sparse: restricted gfp_t degrades to 
integer
   drivers/scsi/sg.c:2813:49: sparse: sparse: incorrect type in argument 2 
(different base types) @@    expected restricted gfp_t [usertype] flags @@    
got  [usertype] flags @@
   drivers/scsi/sg.c:2813:49: sparse:    expected restricted gfp_t [usertype] 
flags
   drivers/scsi/sg.c:2813:49: sparse:    got unsigned int
   include/linux/spinlock.h:393:9: sparse: sparse: context imbalance in 
'sg_add_request' - different lock contexts for basic block

vim +2808 drivers/scsi/sg.c

  2797  
  2798  /*
  2799   * Makes a new sg_request object. If 'first' is set then use GFP_KERNEL 
which
  2800   * may take time but has improved chance of success, otherwise use 
GFP_ATOMIC.
  2801   * Note that basic initialization is done but srp is not added to 
either sfp
  2802   * list. On error returns twisted negated errno value (not NULL).
  2803   */
  2804  static struct sg_request *
  2805  sg_mk_srp(struct sg_fd *sfp, bool first)
  2806  {
  2807          struct sg_request *srp;
> 2808          int gfp =  __GFP_NOWARN;
  2809  
  2810          if (first)      /* prepared to wait if none already outstanding 
*/
> 2811                  srp = kzalloc(sizeof(*srp), gfp | GFP_KERNEL);
  2812          else
  2813                  srp = kzalloc(sizeof(*srp), gfp | GFP_ATOMIC);
  2814          if (srp) {
  2815                  spin_lock_init(&srp->req_lck);
  2816                  atomic_set(&srp->rq_st, SG_RS_INACTIVE);
  2817                  srp->parentfp = sfp;
  2818                  return srp;
  2819          } else {
  2820                  return ERR_PTR(-ENOMEM);
  2821          }
  2822  }
  2823  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Reply via email to