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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6032FEB64D9 for ; Tue, 27 Jun 2023 10:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231314AbjF0K0a (ORCPT ); Tue, 27 Jun 2023 06:26:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231208AbjF0K0C (ORCPT ); Tue, 27 Jun 2023 06:26:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40CD33AAA; Tue, 27 Jun 2023 03:24:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6F6D661117; Tue, 27 Jun 2023 10:24:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D5F7C433C9; Tue, 27 Jun 2023 10:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1687861466; bh=F1Hg7UsWABbNZA5AQvDBMQsjEQe6h9OaplyEUWz37bw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V2NwjqsUMcDX/nRTxfVAJKchvBq0J8/jCjoiPE/BVWSq5g708DSLg16ic9OHGuGIA yuU5bxvGd6YG+SSKFuayAVa/x5wvWepMKMdGGFdgfHwAvR+pb341M0KuWKavjeak5J sma7fq1Z3LAEcoV/YQiR7MTXGlucUZab2xSmpk5M= Date: Tue, 27 Jun 2023 12:24:24 +0200 From: Greg Kroah-Hartman To: Petr Tesarik Cc: Stefano Stabellini , Thomas Bogendoerfer , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , "Rafael J. Wysocki" , Juergen Gross , Oleksandr Tyshchenko , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Andy Shevchenko , Hans de Goede , Jason Gunthorpe , Kees Cook , Saravana Kannan , "moderated list:XEN HYPERVISOR ARM" , "moderated list:ARM PORT" , open list , "open list:MIPS" , "open list:XEN SWIOTLB SUBSYSTEM" , Roberto Sassu , Kefeng Wang , petr@tesarici.cz Subject: Re: [PATCH v3 1/7] swiotlb: make io_tlb_default_mem local to swiotlb.c Message-ID: <2023062745-routing-palace-d0b4@gregkh> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Tue, Jun 27, 2023 at 11:54:23AM +0200, Petr Tesarik wrote: > +/** > + * is_swiotlb_active() - check if the software IO TLB is initialized > + * @dev: Device to check, or %NULL for the default IO TLB. > + */ > bool is_swiotlb_active(struct device *dev) > { > - struct io_tlb_mem *mem = dev->dma_io_tlb_mem; > + struct io_tlb_mem *mem = dev > + ? dev->dma_io_tlb_mem > + : &io_tlb_default_mem; That's impossible to read and maintain over time, sorry. Please use real "if () else" lines, so that it can be maintained over time. thanks, greg k-h