From: Christoph Hellwig Subject: Re: [PATCH V4 09/16] staging: rtsx: use sg helper to operate scatterlist Date: Mon, 17 Jun 2019 11:24:46 +0200 Message-ID: <20190617092446.GA8707@lst.de> References: <20190617030349.26415-1-ming.lei@redhat.com> <20190617030349.26415-10-ming.lei@redhat.com> <20190617082706.GI7455@lst.de> <20190617091524.GB31002@ming.t460p> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20190617091524.GB31002@ming.t460p> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Ming Lei Cc: Michael Schmitz , devel@driverdev.osuosl.org, Hannes Reinecke , Benjamin Block , Bart Van Assche , linux-scsi@vger.kernel.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, James Smart , "Ewan D . Milne" , Jim Gill , James Bottomley , Brian King , Finn Thain , "Martin K . Petersen" , Kim Bradley , "Juergen E . Fischer" , Christoph Hellwig , Dan Carpenter List-Id: linux-scsi@vger.kernel.org > + struct scatterlist *sg = *cur_sg ?: > + (struct scatterlist *)scsi_sglist(srb); > + No need for the cast here. And I have to say I hate that GNU C non-standard shortshut in ? :. Why not simply: struct scatterlist *sg = *cur_sg; if (!sg) sg = scsi_sglist(srb); Which is a little more verbose, but much more readabe. The rest of the patch looks fine to me.