Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3552055imm; Sun, 29 Jul 2018 22:16:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcA9VUrQUMkDZNdhO8CH0hJ0T8lq85ZkJBUiAYG6jFMK1RWeYmnsnsWgFWT08aGJ2oEsmJt X-Received: by 2002:a17:902:8215:: with SMTP id x21-v6mr14931354pln.175.1532927816448; Sun, 29 Jul 2018 22:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532927816; cv=none; d=google.com; s=arc-20160816; b=BaRBybbn4rz+fXlpSIbzj9YSq10sta+CZwfp655RE/ZQuJkuz2RiFoMhdX1+mJ6UGM hkks2HxHWh0P1wRiS4XxgewkloiDBsIjCLBvUMMktfMkPSM7097pMjk3ql4evUq8NzRJ mTS9EZMF1NZOGzYdWnK9Mvl6tm6SaLlgBs6/VJc8R0RQAbhTxJ5VYi2wmXrAojrJi5VQ /pO0ogwM9VbwoaRIYSgkCO2XIQ2lKLPgXC7JzglUwS9M20Aktcn3arJ6ST9lU1E4EYXS IIad1phd6Fvqpmr8ulw8Pxdj3Ixk2uX2B8AnVqp7xpyMk8vVzuJiIiRW3XWexr8Zqgld mJ2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id :mime-version:references:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=sONmerpSoZKdWTV+b9p+1dqg5twMw0MQ7NfCCgCeMg8=; b=W227s85ZvhH9mrz/1eFt4hchyLQMqyP7OzMrJ/DPDPm9xuELzpYIWFHApo4MGZTaw9 f5H/ssHxM8105haVi5CpAYjqLnIvuCwjjTAjUVaaRK7gd2bJNNpIx90zvP9u/9XE/qZU 949bAJ38LLrJF/D7cvScIBLlHQqOsOVuzcUQWY4nAzeiNW6jaV132G76wfWQIAFquHnJ P0bjj6v3FzKxIthaNPnboRG5I69Mf8DPHwp9SWUTYL3DuQ6b2xD+7kpPvJImvIM8dOvE ZIFBrubcxuH3pvlbFLqcYiFsNiAhwVSrBVsCG98aEcmROBX5ERISWKr0igXdABZiddqc Vv5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 89-v6si6384624pld.390.2018.07.29.22.16.41; Sun, 29 Jul 2018 22:16:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726508AbeG3GsZ (ORCPT + 99 others); Mon, 30 Jul 2018 02:48:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43310 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726094AbeG3GsY (ORCPT ); Mon, 30 Jul 2018 02:48:24 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6U5DvJi079422 for ; Mon, 30 Jul 2018 01:15:12 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2khqukfkrf-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 30 Jul 2018 01:15:12 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Jul 2018 06:15:09 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 30 Jul 2018 06:15:03 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6U5F2Y135258544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Jul 2018 05:15:02 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 34488AE045; Mon, 30 Jul 2018 08:15:05 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 59860AE04D; Mon, 30 Jul 2018 08:15:04 +0100 (BST) Received: from mschwideX1 (unknown [9.145.66.78]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 30 Jul 2018 08:15:04 +0100 (BST) Date: Mon, 30 Jul 2018 07:14:58 +0200 From: Martin Schwidefsky To: Huaisheng HS1 Ye Cc: "linux-s390@vger.kernel.org" , "heiko.carstens@de.ibm.com" , "bart.vanassche@wdc.com" , "martin.petersen@oracle.com" , "axboe@kernel.dk" , "keescook@chromium.org" , "ross.zwisler@linux.intel.com" , "willy@infradead.org" , "vishal.l.verma@intel.com" , "dave.jiang@intel.com" , "viro@zeniv.linux.org.uk" , "gregkh@linuxfoundation.org" , "jack@suse.cz" , "agk@redhat.com" , "snitzer@redhat.com" , "dm-devel@redhat.com" , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "NingTing Cheng" , "colyli@suse.de" , Huaisheng Ye , "linux-nvdimm@lists.01.org" , "dan.j.williams@intel.com" Subject: Re: [External] [PATCH v2 2/6] s390, dcssblk: kaddr and pfn can be NULL to ->direct_access() In-Reply-To: References: <20180725162849.8320-1-yehs2007@zoho.com> <20180725162849.8320-3-yehs2007@zoho.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18073005-0028-0000-0000-000002E23595 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18073005-0029-0000-0000-0000239A34C8 Message-Id: <20180730071458.42e3c5a1@mschwideX1> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-30_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807300059 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 28 Jul 2018 04:07:25 +0000 Huaisheng HS1 Ye wrote: > May I have your ack's for this patch? The whole series would be applied > to libnvdimm if it could get your approval. > And any suggestion is welcome. Sure, it is just two additional ifs. I did not think that this needed an ack, but here you go: Acked-by: Martin Schwidefsky > > Cheers, > Huaisheng Ye > > > From: Huaisheng Ye > > Sent: Thursday, July 26, 2018 12:29 AM > > > > From: Huaisheng Ye > > > > dcssblk_direct_access() needs to check the validity of pointers kaddr > > and pfn for NULL assignment. If anyone equals to NULL, it doesn't need > > to calculate the value. > > > > If either of them is equal to NULL, that is to say callers may > > have no need for kaddr or pfn, so this patch is prepared for allowing > > them to pass in NULL instead of having to pass in a pointer or local > > variable that they then just throw away. > > > > Signed-off-by: Huaisheng Ye > > --- > > drivers/s390/block/dcssblk.c | 8 +++++--- > > 1 file changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c > > index ed60728..23e526c 100644 > > --- a/drivers/s390/block/dcssblk.c > > +++ b/drivers/s390/block/dcssblk.c > > @@ -922,9 +922,11 @@ static DEVICE_ATTR(save, S_IWUSR | S_IRUSR, dcssblk_save_show, > > unsigned long dev_sz; > > > > dev_sz = dev_info->end - dev_info->start + 1; > > - *kaddr = (void *) dev_info->start + offset; > > - *pfn = __pfn_to_pfn_t(PFN_DOWN(dev_info->start + offset), > > - PFN_DEV|PFN_SPECIAL); > > + if (kaddr) > > + *kaddr = (void *) dev_info->start + offset; > > + if (pfn) > > + *pfn = __pfn_to_pfn_t(PFN_DOWN(dev_info->start + offset), > > + PFN_DEV|PFN_SPECIAL); > > > > return (dev_sz - offset) / PAGE_SIZE; > > } > > -- > > 1.8.3.1 > -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.