linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH] decode-dimms: Default to merging cells in side-by-side output mode
Date: Mon, 22 Oct 2012 12:39:31 +0200	[thread overview]
Message-ID: <20121022123931.42a1b76c@endymion.delvare> (raw)

Default to merging cells in side-by-side output mode. Add an option to
revert to no cell merging.
---
 eeprom/decode-dimms |    9 +++++++++
 1 file changed, 9 insertions(+)

--- i2c-tools.orig/eeprom/decode-dimms	2012-10-22 11:26:16.531386765 +0200
+++ i2c-tools/eeprom/decode-dimms	2012-10-22 11:26:30.979391794 +0200
@@ -1696,6 +1696,8 @@ foreach (@ARGV) {
 			"                          (useful for postprocessing the output)\n",
 			"      --side-by-side      Display all DIMMs side-by-side if possible\n",
 			"      --merge-cells       Merge neighbour cells with identical values\n",
+			"                          (side-by-side output only, default)\n",
+			"      --no-merge-cells    Don't merge neighbour cells with identical values\n",
 			"                          (side-by-side output only)\n",
 			"  -c, --checksum          Decode completely even if checksum fails\n",
 			"  -x,                     Read data from hexdump files\n",
@@ -1729,6 +1731,10 @@ EOF
 		$opt_merge = 1;
 		next;
 	}
+	if ($_ eq '--no-merge-cells') {
+		$opt_merge = 0;
+		next;
+	}
 	if ($_ eq '-c' || $_ eq '--checksum') {
 		$opt_igncheck = 1;
 		next;
@@ -1750,6 +1756,9 @@ EOF
 	push @dimm, { eeprom => basename($_), file => $_ } if $use_hexdump;
 }
 
+# Default values
+$opt_merge = 1 unless defined $opt_merge;
+
 # From a sysfs device path and an attribute name, return the attribute
 # value, or undef (stolen from sensors-detect)
 sub sysfs_device_attribute


-- 
Jean Delvare

                 reply	other threads:[~2012-10-22 10:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121022123931.42a1b76c@endymion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).