All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kristen Carlson Accardi <kristen@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH] simfs: fix incorrect math again
Date: Thu, 14 Oct 2010 11:18:00 -0700	[thread overview]
Message-ID: <1287080280-26368-1-git-send-email-kristen@linux.intel.com> (raw)
In-Reply-To: <4CB5B7D2.3070608@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 996 bytes --]

---
 src/simfs.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/simfs.c b/src/simfs.c
index fd768ef..bcb6ff8 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -231,8 +231,7 @@ static void sim_fs_op_read_block_cb(const struct ofono_error *error,
 		tocopy = MIN(256 - op->offset % 256,
 				op->num_bytes - op->current * 256);
 	} else {
-		bufoff = (op->current - start_block - 1) * 256 +
-				op->offset % 256;
+		bufoff = op->current * 256;
 		dataoff = 0;
 		tocopy = MIN(256, op->num_bytes - op->current * 256);
 	}
@@ -294,8 +293,7 @@ static gboolean sim_fs_op_read_block(gpointer user_data)
 			toread = MIN(256 - op->offset % 256,
 					op->num_bytes - op->current * 256);
 		} else {
-			bufoff = (op->current - start_block - 1) * 256 +
-					op->offset % 256;
+			bufoff = op->current * 256;
 			seekoff = SIM_CACHE_HEADER_SIZE + op->current * 256;
 			toread = MIN(256, op->num_bytes - op->current * 256);
 		}
-- 
1.7.2.3


  reply	other threads:[~2010-10-14 18:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04 22:33 [PATCH 0/4] Icon patches (rebased) Kristen Carlson Accardi
2010-10-04 22:33 ` [PATCH 1/4] simfs: cache images Kristen Carlson Accardi
2010-10-12  1:16   ` Denis Kenzior
2010-10-04 22:33 ` [PATCH 2/4] sim: implement GetIcon Kristen Carlson Accardi
2010-10-13 13:44   ` Denis Kenzior
2010-10-04 22:33 ` [PATCH 3/4] simfs: fix incorrect math when calculating length to copy Kristen Carlson Accardi
2010-10-13 13:44   ` Denis Kenzior
2010-10-14 18:18     ` Kristen Carlson Accardi [this message]
2010-11-02 14:41       ` [PATCH] simfs: fix incorrect math again Kristen Carlson Accardi
2010-11-02 14:57         ` Denis Kenzior
2010-11-29 19:13           ` [PATCH] simfs: make sim_fs_read_block work for > 256 byte files Kristen Carlson Accardi
2010-10-04 22:33 ` [PATCH 4/4] simutil: add file type for EFimg Kristen Carlson Accardi
2010-10-12  3:16   ` Denis Kenzior

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=1287080280-26368-1-git-send-email-kristen@linux.intel.com \
    --to=kristen@linux.intel.com \
    --cc=ofono@ofono.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.