Return-Path: MIME-Version: 1.0 In-Reply-To: <8b5debfa0905290643o45b6488cp177eafac3b629dd1@mail.gmail.com> References: <1243601080-27314-1-git-send-email-alok.barsode@azingo.com> <20090529132046.GA10997@jh-x301> <8b5debfa0905290643o45b6488cp177eafac3b629dd1@mail.gmail.com> Date: Fri, 29 May 2009 19:36:32 +0530 Message-ID: <8b5debfa0905290706i4a35e75cs559bf687a25a3ab9@mail.gmail.com> Subject: Re: [PATCH 1/1] Adding start_discovery functionality to hciops plugin. From: alok barsode To: linux-bluetooth@vger.kernel.org Content-Type: multipart/mixed; boundary=000e0cd47dda70c020046b0d9591 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: --000e0cd47dda70c020046b0d9591 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Johan, On Fri, May 29, 2009 at 7:13 PM, alok barsode wrote= : > Hi Johan, > > On Fri, May 29, 2009 at 6:50 PM, Johan Hedberg = wrote: >> Hi Alok, >> >> One minor comment: >> >> On Fri, May 29, 2009, alokbarsode@gmail.com wrote: >>> +static int hciops_start_discovery(int index, gboolean periodic) >>> +{ >>> + =A0 =A0 inquiry_cp inq_cp; >>> + =A0 =A0 periodic_inquiry_cp cp; >> >> Put these two variables into the if-else statement since that's the only >> place where they are used. Otherwise the patch looks pretty good. > Done. attaching the modified patch. Attaching corrected patch. fixed a whitespace and removed the stop_discovery declaration. > >> >> Johan Alok. --000e0cd47dda70c020046b0d9591 Content-Type: text/x-diff; charset=US-ASCII; name="0001-Adding-start_discovery-functionality-to-hciops-plugi.patch" Content-Disposition: attachment; filename="0001-Adding-start_discovery-functionality-to-hciops-plugi.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fvayr6lq1 RnJvbSBlNWU1YzBjMDNmMGI5YWMyMDIzMWFjOTM3YTY1ZWYyYTU0NzU2MTUzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbG9rIEJhcnNvZGUgPGFsb2suYmFyc29k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