From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BA8AC31E57 for ; Mon, 17 Jun 2019 09:25:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57DE320657 for ; Mon, 17 Jun 2019 09:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728202AbfFQJZS (ORCPT ); Mon, 17 Jun 2019 05:25:18 -0400 Received: from verein.lst.de ([213.95.11.211]:35010 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726286AbfFQJZS (ORCPT ); Mon, 17 Jun 2019 05:25:18 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 1D06168AFE; Mon, 17 Jun 2019 11:24:47 +0200 (CEST) Date: Mon, 17 Jun 2019 11:24:46 +0200 From: Christoph Hellwig To: Ming Lei Cc: Christoph Hellwig , linux-scsi@vger.kernel.org, "Martin K . Petersen" , James Bottomley , Bart Van Assche , Hannes Reinecke , Jim Gill , Cathy Avery , "Ewan D . Milne" , Brian King , James Smart , "Juergen E . Fischer" , Michael Schmitz , Finn Thain , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-usb@vger.kernel.org, Dan Carpenter , Benjamin Block , Kim Bradley Subject: Re: [PATCH V4 09/16] staging: rtsx: use sg helper to operate scatterlist 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-Disposition: inline In-Reply-To: <20190617091524.GB31002@ming.t460p> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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.