Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3890523ybl; Mon, 12 Aug 2019 08:03:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0fe43mZ2APHsB3vkkUH8jdHWnkt12FAL13bCM48+yGfB4JdsAD2nt2Nyy76PclwDqtqJ3 X-Received: by 2002:aa7:940c:: with SMTP id x12mr36542631pfo.80.1565622207655; Mon, 12 Aug 2019 08:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565622207; cv=none; d=google.com; s=arc-20160816; b=KK6pu92x7jdtOaLjedgdAlRxWwkt2So8RHKM+JcAKQQjWb64f74xKdBgUVGGUFnzqy pTXRHx4fYk0Dpr7TWG0N7ulnilGVsmiJxmIXpx4gXd6VjVWBp2s9iAuQhvIs+CaOsZdh u8MWw/cO4UHC/J33YgPPRRpuHds38qYixlUVPkj8dXk+ZNaSt+Z8E8j/P952Jyky2T1D RaElcjgBrbUb0Nt5XsEJQXRTvo6cF6dCt2xJVfo/O6exHQNONqzcX/2I+u98wx9GIWzz qUoXYEfNPiiPfXtumHBHzlIfuB7egEghtb0alDG4FiWejs4bDMtWjl6YqkP2hzX4680z lkOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UhputOm7Ak6HCMxwndND9cIz3++zl7ARWXtZ8+0gz9o=; b=O5thrvD9Jlka8J28T7sBM99Ax6GPPAbpe8Es87xVTDzgA+kriOZi/CgD6Nqx3TqxaD 7sNPXBd7njjCQOF85LZ0Pl/3lXFO1ZRIawr1UlgIU36QlODC4srXO+MPrRuIxYdJO6cY 47Q+wEqRMN4CkwzdmVv+26/yNMrcC8pG7HtPkdXrwB82ll0aWMB1bmLrLBpmr54ii4DD MISzeTJLgFK3gmjEnuyA7EmGN3JgZRBCUuLNN6FNyLTL2fVvTG2te3/zkq3YQFxUJWHY 7OKnnr9QKftIC85LRznIRQFjxUKyuhnSLG56/41V5nsH0kKVa2vlY/LXMuwvMSqCxNiE 1q8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rudSRbBv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w26si4521630pfn.94.2019.08.12.08.03.10; Mon, 12 Aug 2019 08:03:27 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rudSRbBv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727060AbfHLPCQ (ORCPT + 99 others); Mon, 12 Aug 2019 11:02:16 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:33502 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbfHLPCQ (ORCPT ); Mon, 12 Aug 2019 11:02:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UhputOm7Ak6HCMxwndND9cIz3++zl7ARWXtZ8+0gz9o=; b=rudSRbBvABcwONIWmJQsPrqfy oT9J49pX1Xpt6dG8Xjtvf4/1jzNESJ9C91FA5RTNHKSP0WR7mKO91LsujMJswJC8g63QG5vjGmBJe w8ParGgO9AbOawH4FsMaH2uQY9DdaklyjbS8+IzIe9Nl48iANlzXBUxK9eX6Q7KMUJz57ogF8lJYX 0j9KFtMMsAwJabswbufx58p/bhIBrlm5AT9RpL8+PPSCzfIE+u93+c3C/5LjLo2a6fXZH/HpvTCbK aj7FwBjwn3lV0N0M4jjT4OVuja1X9Eu7ZV0dBXN5uGcjgvvLPO4UOcQ+ViWcRBoH/S3/Hroeeo/v2 Jy+p/QLqA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hxBpv-0005ZL-CF; Mon, 12 Aug 2019 15:02:15 +0000 Date: Mon, 12 Aug 2019 08:02:15 -0700 From: Christoph Hellwig To: Atish Patra Cc: linux-kernel@vger.kernel.org, Albert Ou , Anup Patel , Palmer Dabbelt , Johan Hovold , Paul Walmsley , linux-riscv@lists.infradead.org Subject: Re: [v5 PATCH] RISC-V: Fix unsupported isa string info. Message-ID: <20190812150215.GF26897@infradead.org> References: <20190807182316.28013-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190807182316.28013-1-atish.patra@wdc.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + for (e = mandatory_ext; *e != '\0'; ++e) { > + if (isa[0] != e[0]) { > +#if defined(CONFIG_FP) > + if ((isa[0] == 'f') || (isa[0] == 'd')) > + continue; > +#endif > + unsupported_isa[index] = e[0]; > + index++; > + } I'd just use if (IS_ENABLED()) here to get full compiler coverage. Also no need for the inner braces. > + if (isa[0] != '\0') { > + /* Add remainging isa strings */ > + for (e = isa; *e != '\0'; ++e) { > +#if !defined(CONFIG_VIRTUALIZATION) > + if (e[0] != 'h') > +#endif > + seq_write(f, e, 1); > + } > + } This one I don't get. Why do we want to check CONFIG_VIRTUALIZATION? > seq_puts(f, "\n"); > > /* > * If we were given an unsupported ISA in the device tree then print > * a bit of info describing what went wrong. > */ > - if (isa[0] != '\0') > - pr_info("unsupported ISA \"%s\" in device tree\n", orig_isa); > + if (unsupported_isa[0]) > + pr_info("unsupported ISA extensions \"%s\" in device tree for cpu [%ld]\n", > + unsupported_isa, cpuid); And I'm not even sure why we care about unsupported extensions. Sooner or late a few will op up and they should be harmless.