Received: by 10.213.65.68 with SMTP id h4csp875500imn; Thu, 22 Mar 2018 10:27:30 -0700 (PDT) X-Google-Smtp-Source: AG47ELuILPef4JTeSzI2rXUXcyYNyd5nplooR/T2oFH8zJESfn4Mgc4e5/sw3UZdG9oNO/94FHs8 X-Received: by 2002:a17:902:5a4e:: with SMTP id f14-v6mr25557504plm.116.1521739650874; Thu, 22 Mar 2018 10:27:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521739650; cv=none; d=google.com; s=arc-20160816; b=wGbowiQ7aeOgO4jfO49fFmbSjYQlkkTjBfvca/o5YOswDTxu6iPFctEmB8S0NFDrsE 3pbj04DrVYG3igA7x06fRR3jcox+vwF1k1htHgVFw3dEH+8G+Fn2F/1cVmp4nL2wgoGd H9gz3vV0c5Xfflz6c0PKXIrvon58h5XCDqwndV4eQ1+m1SsW1x8ihNvcKDlE9ZDK+1aS xXXj/dtsT4WZ2KFLy6zcBEJ3GHKys2iRxgwfI2IL6I7zKEzV+gDXmo+lOxHvWQQgbsKi 0PEaWmiigeICA0rFLXEe6hYY9EgTjQ7zBpzkEn99y+UixaxUo0PfSeAYm6ZE+9bI/quK zCqQ== 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:arc-authentication-results; bh=tp6lggEtoneVrpTppeg0S4LL4hhNKR9LBLQIw0VV9ao=; b=yg7QVN0YGbsL3yg+kk/Ugb2/4mvmA5T0ZN40Pmnc+UZtwjRcchAa9f5K2rxC/sbLaP ZySUs51qifeSl9bb0lGHa/z5c/yBGgmsLSdwi/A81vGFDchQMnJ2bjkyeelUO1cvh699 BDyOGaBxM8Dj/FEyiEBos7Wg/jqLCvWCm9rG1xbGs7lziRQUfPoNyyIZnKEb+LqyUvSs NpRYZhKHlOc0dHl7morxwX64yQYbd6eieM07lwp9cjzWFQSEXbyTdeW0JxHjSmhpXRMK E7TxQC6RiFO1OtAAPYCGq54kdvsEVFak1ZeZx7U25sw88Fr3B+XFD0pHEIexrJrjNjtJ zW3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CwKRuxa3; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k128si4671633pgc.609.2018.03.22.10.27.14; Thu, 22 Mar 2018 10:27:30 -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=pass header.i=@gmail.com header.s=20161025 header.b=CwKRuxa3; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751789AbeCVR0N (ORCPT + 99 others); Thu, 22 Mar 2018 13:26:13 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:39492 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751628AbeCVR0L (ORCPT ); Thu, 22 Mar 2018 13:26:11 -0400 Received: by mail-wm0-f49.google.com with SMTP id f125so17529291wme.4; Thu, 22 Mar 2018 10:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tp6lggEtoneVrpTppeg0S4LL4hhNKR9LBLQIw0VV9ao=; b=CwKRuxa3dbo7502b2m+bu1kU4nEc+LzFXvlGLDymnk7aaetdF/Ck/mT3MHCcDtSdTx 5cW0+IvOEoQYIji3io62T+tj8qygoIl3Yu2JToGM+Lk6fcd1mbsv+Q5TyS/unJGXtBpI 8YMK2DvbA2kprIcTQHJYpAXD/mTYNjLjFjfFHVmEisUKM0hEHL58RTnG39wkK1GdPUvy Y+MQk3yO3Q6JLI53k6hJCYCNTaHliBDjC1CD5GxIkOR0Q+jDzMe8BqIylPawbvDRFoTj CyQtpCH+jP0wuJ0DMTk0a4izUbuHWRuNH33ffdHlsKjwFSsBlElRQeoko8QlNMVAAHDw vfWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tp6lggEtoneVrpTppeg0S4LL4hhNKR9LBLQIw0VV9ao=; b=pDGgUUI1aQ8URn/d5ZcITykTMZ9iM2RyOTA6z+QuYNqAQuACaT5Owc5ZE0KJZW3d7x CMPQUqwuiKIK0J6ZO0hsqeVvlmYEqjoBt0pIm63j9ue/HoufbivPajJoBJFcLoa3+ie7 dCjiNy2KPjnmRklwN0pOHKXp4BgjQp3bPcxMqzY3+Nk2belAK0OL2LglOF06zzTCvJg+ 8G+52DmOyGcnns+gmMRlIisrptqUlWjmT4hz6yo/DA5dV/PGwjOejKBc5nK96Mx80P0c Q06fsxbdHZ/AfsnBjBWSLKhHBctz80q6FD4U1YUg4lBtZ8ILBxgw/4htR/nlzPDaQLOv N8uQ== X-Gm-Message-State: AElRT7H9hQX9V/gXAaDResvgrFCqkKJVmQpcPT4yTjb4dGIdWJVq/z5I /28rqaQzrp0fF4VFFzGcERY= X-Received: by 10.80.183.65 with SMTP id g59mr6614012ede.129.1521739569712; Thu, 22 Mar 2018 10:26:09 -0700 (PDT) Received: from gmail.com (net-93-144-128-215.cust.dsl.teletu.it. [93.144.128.215]) by smtp.gmail.com with ESMTPSA id g55sm1919871eda.15.2018.03.22.10.26.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Mar 2018 10:26:08 -0700 (PDT) Date: Thu, 22 Mar 2018 18:26:08 +0100 From: Paolo Pisati To: Joe Perches Cc: Paolo Pisati , Alan Tull , Moritz Fischer , Rob Herring , Mark Rutland , linux-fpga@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] fpga: lattice machxo2: Add Lattice MachXO2 support Message-ID: <20180322172608.GA22179@harukaze> References: <1521653726-24625-1-git-send-email-p.pisati@gmail.com> <1521653726-24625-3-git-send-email-p.pisati@gmail.com> <1521655492.7999.13.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521655492.7999.13.camel@perches.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 21, 2018 at 11:04:52AM -0700, Joe Perches wrote: > > static const u8 cmd[] > here and everywhere else as all the tx_buf assignments > of cmd are to const void * Ok > Instead of multiple declarations of dump_status_reg > it's frequently nicer to use a style like > > static void debug_func(args...) > { > #ifdef DEBUG > [code...] > #endif > } > > so if function arguments ever need to be changed > it's only required to be changed in one spot and > not multiply compilation tested with and without > the DEBUG definition Ok > It's frequently nicer to use a static function > for these enum -> string conversions like: > > static const char *get_err_string(unsigned long err) > { > switch (err) { > case ENOERR: return "No Error"; > case EID: return "ID ERR"; > case ECMD: return "CMD ERR"; > [...] > } > return "default switch case"; > } Ok - checkpatch complained when i put the "case ...: return ...;" on the same line as you did here, that is why i ended up with the ugly "case...: $string; break" all on different lines > > + pr_debug("machxo2 status: 0x%08lX - done=%d, cfgena=%d, busy=%d, fail=%d, devver=%d, err=%s\n", > > + *status, test_bit(DONE, status), test_bit(ENAB, status), > > + test_bit(BUSY, status), test_bit(FAIL, status), > > + test_bit(DVER, status), ferr); > > So instead of ferr, this could use > get_err_string(*status) > > And please try to keep a consistent alignment for > indentation of multiple line statements I tried, but then checkpatch complained again about the indentation of the above block and i literally had to guess... Anyhow, thanks, i'll send a v8 with all these style fixes. -- bye, p.